[svn:parrot] r42763 - trunk/runtime/parrot/library

fperrad at svn.parrot.org fperrad at svn.parrot.org
Sat Nov 21 18:28:56 UTC 2009


Author: fperrad
Date: Sat Nov 21 18:28:55 2009
New Revision: 42763
URL: https://trac.parrot.org/parrot/changeset/42763

Log:
[distutils] add a target 'plumage'

Modified:
   trunk/runtime/parrot/library/distutils.pir

Modified: trunk/runtime/parrot/library/distutils.pir
==============================================================================
--- trunk/runtime/parrot/library/distutils.pir	Sat Nov 21 18:28:15 2009	(r42762)
+++ trunk/runtime/parrot/library/distutils.pir	Sat Nov 21 18:28:55 2009	(r42763)
@@ -115,6 +115,9 @@
     .const 'Sub' _usage = '_usage'
     register_step('usage', _usage)
 
+    .const 'Sub' _plumage = '_plumage'
+    register_step('plumage', _plumage)
+
     $P0 = get_config()
     $S0 = $P0['osname']
     unless $S0 == 'MSWin32' goto L1
@@ -255,7 +258,9 @@
 
         clean:          Basic cleaning up.
 
-        update:         Update from repository.
+        update:         Update from the repository.
+
+        plumage:        Output a skeleton for Plumage
 
         help:           Print this help message.
 USAGE
@@ -1988,10 +1993,243 @@
   L2:
 .end
 
+=head3 Step plumage
+
+=over 4
+
+=item name
+
+=item abstract
+
+=item authority
+
+=item version
+
+=item license_type
+
+=item license_uri
+
+=item copyright_holder
+
+=item generated_by
+
+=item description
+
+=item keywords
+
+=item checkout_uri
+
+=item browser_uri
+
+=item project_uri
+
+=back
+
+=cut
+
+.sub '_plumage' :anon
+    .param pmc kv :slurpy :named
+    .local pmc data
+    data = new 'Hash'
+
+    $S0 = cwd()
+    $S0 = basename($S0)
+    $I0 = exists kv['name']
+    unless $I0 goto L1
+    $S0 = kv['name']
+    $S0 = downcase $S0
+  L1:
+    data['name'] = $S0
+
+    $S0 = 'ABSTRACT'
+    $I0 = exists kv['abstract']
+    unless $I0 goto L2
+    $S0 = kv['abstract']
+  L2:
+    data['abstract'] = $S0
+
+    $S0 = 'AUTHORITY'
+    $I0 = exists kv['authority']
+    unless $I0 goto L3
+    $S0 = kv['authority']
+  L3:
+    data['authority'] = $S0
+
+    $S0 = 'HEAD'
+    $I0 = exists kv['version']
+    unless $I0 goto L4
+    $S0 = kv['version']
+  L4:
+    data['version'] = $S0
+
+    $S0 = 'LICENSE TYPE'
+    $I0 = exists kv['license_type']
+    unless $I0 goto L5
+    $S0 = kv['license_type']
+  L5:
+    data['license_type'] = $S0
+
+    $S0 = 'LICENSE URI'
+    $I0 = exists kv['license_uri']
+    unless $I0 goto L6
+    $S0 = kv['license_uri']
+  L6:
+    data['license_uri'] = $S0
+
+    $S0 = 'COPYRIGHT HOLDER'
+    $I0 = exists kv['copyright_holder']
+    unless $I0 goto L7
+    $S0 = kv['copyright_holder']
+  L7:
+    data['copyright_holder'] = $S0
+
+    $S0 = 'GENERATED BY'
+    $I0 = exists kv['generated_by']
+    unless $I0 goto L8
+    $S0 = kv['generated_by']
+  L8:
+    data['generated_by'] = $S0
+
+    $S0 = 'DESCRIPTION'
+    $I0 = exists kv['description']
+    unless $I0 goto L9
+    $S0 = kv['description']
+  L9:
+    data['description'] = $S0
+
+    $S0 = ''
+    $I0 = exists kv['keywords']
+    unless $I0 goto L10
+    $P1 = kv['keywords']
+    $S1 = join "\", \"", $P1
+    $S0 = "\"" . $S1
+    $S0 .= "\""
+  L10:
+    data['keywords'] = $S0
+
+    $S0 = 'vcs'
+    $I0 = file_exists('CVS')
+    unless $I0 goto L21
+    $S0 = 'cvs'
+    goto L29
+  L21:
+    $I0 = file_exists('.git')
+    unless $I0 goto L22
+    $S0 = 'git'
+    goto L29
+  L22:
+    $I0 = file_exists('.hg')
+    unless $I0 goto L23
+    $S0 = 'hg'
+    goto L29
+  L23:
+    $I0 = file_exists('.svn')
+    unless $I0 goto L4
+    $S0 = 'svn'
+    goto L29
+  L24:
+  L29:
+    data['vcs'] = $S0
+
+    $S0 = 'CHECKOUT_URI'
+    $I0 = exists kv['checkout_uri']
+    unless $I0 goto L31
+    $S0 = kv['checkout_uri']
+  L31:
+    data['checkout_uri'] = $S0
+
+    $S0 = 'BROWSER_URI'
+    $I0 = exists kv['browser_uri']
+    unless $I0 goto L32
+    $S0 = kv['browser_uri']
+  L32:
+    data['browser_uri'] = $S0
+
+    $S0 = 'PROJECT_URI'
+    $I0 = exists kv['project_uri']
+    unless $I0 goto L33
+    $S0 = kv['project_uri']
+  L33:
+    data['project_uri'] = $S0
+
+    $S0 = <<'TEMPLATE'
+{
+    "meta-spec"    : {
+        "version"  : 1,
+        "uri"      : "https://trac.parrot.org/parrot/wiki/ModuleEcosystem"
+    },
+    "general"      : {
+        "name"     : "$name",
+        "abstract" : "$abstract",
+        "authority": "$authority",
+        "version"  : "$version",
+        "license"  : {
+            "type" : "$license_type",
+            "uri"  : "$license_uri"
+        },
+        "copyright_holder" : "$copyright_holder",
+        "generated_by"     : "$generated_by",
+        "keywords"         : [$keywords],
+        "description"      : "$description"
+    },
+    "instructions" : {
+        "fetch"    : {
+            "type" : "repository"
+        },
+        "build"    : {
+            "type" : "parrot_setup"
+        },
+        "test"     : {
+            "type" : "parrot_setup"
+        },
+        "install"  : {
+            "type" : "parrot_setup"
+        }
+    },
+    "dependency-info"  : {
+        "provides"     : ["$name"],
+        "requires"     : {
+            "fetch"    : ["$vcs"],
+            "build"    : [],
+            "test"     : ["perl5"],
+            "install"  : [],
+            "runtime"  : []
+        }
+    },
+    "resources"            : {
+        "repository"       : {
+             "type"        : "$vcs",
+             "checkout_uri": "$checkout_uri",
+             "browser_uri" : "$browser_uri",
+             "project_uri" : "$project_uri"
+        }
+    }
+}
+TEMPLATE
+    $S0 = interpolate($S0, data)
+    print $S0
+.end
+
 =head3 Step win32-inno-installer
 
 Only on Windows.
 
+=over 4
+
+=item installable_pbc
+
+=item dynops & dynpmc
+
+=item inst_lang
+
+=item inst_lib
+
+=item name
+
+=item version
+
+=back
+
 =cut
 
 .sub '_win32_inno_installer' :anon
@@ -2038,18 +2276,22 @@
     prefix = config['prefix']
     $P0['prefix'] = prefix
 
-    .local string version
+    .local string parrot_version
     $S1 = config['VERSION']
     $S2 = config['DEVEL']
-    version = $S1 . $S2
-    $P0['version'] = version
+    parrot_version = $S1 . $S2
+    $P0['parrot_version'] = parrot_version
 
-    .local string project
+    .local string name
     $S0 = cwd()
-    project = basename($S0)
-    $P0['project'] = project
+    name = basename($S0)
+    $I0 = exists kv['name']
+    unless $I0 goto L1
+    name = kv['name']
+  L1:
+    $P0['name'] = name
 
-    .local string date
+    .local string version
     $I0 = time
     $P1 = decodetime $I0
     $P2 = new 'FixedIntegerArray'
@@ -2060,8 +2302,12 @@
     $P2[1] = $I0
     $I0 = $P1[.TM_MDAY]
     $P2[2] = $I0
-    date = sprintf "%04d%02d%02d", $P2
-    $P0['date'] = date
+    version = sprintf "%04d%02d%02d", $P2
+    $I0 = exists kv['version']
+    unless $I0 goto L2
+    version = kv['version']
+  L2:
+    $P0['version'] = version
 
     .local string license
     $I0 = file_exists('LICENSE')
@@ -2087,8 +2333,8 @@
 ; generated by distutils.pir for the Inno Setup Script Compiler.
 
 [Setup]
-AppName=Parrot-$project
-AppVerName=Parrot-$version-$project-$date
+AppName=Parrot-$name
+AppVerName=Parrot-$parrot_version-$name-$version
 AppPublisher=Parrot Foundation
 AppPublisherURL=http://www.parrot.org/
 DefaultDirName={sd}$prefix
@@ -2096,7 +2342,7 @@
 AllowNoIcons=yes
 $license
 OutputDir=.\\
-OutputBaseFilename=setup-parrot-$version-$project-$date
+OutputBaseFilename=setup-parrot-$parrot_version-$name-$version
 Compression=lzma
 SolidCompression=yes
 Uninstallable=no


More information about the parrot-commits mailing list