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

fperrad at svn.parrot.org fperrad at svn.parrot.org
Thu Dec 17 18:13:08 UTC 2009


Author: fperrad
Date: Thu Dec 17 18:13:07 2009
New Revision: 43136
URL: https://trac.parrot.org/parrot/changeset/43136

Log:
[distutils] stores plumage description in a file

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

Modified: trunk/runtime/parrot/library/distutils.pir
==============================================================================
--- trunk/runtime/parrot/library/distutils.pir	Thu Dec 17 18:04:42 2009	(r43135)
+++ trunk/runtime/parrot/library/distutils.pir	Thu Dec 17 18:13:07 2009	(r43136)
@@ -2407,6 +2407,29 @@
 
 .sub '_plumage' :anon
     .param pmc kv :slurpy :named
+    $S0 = get_plumage(kv :flat :named)
+    $S1 = mk_plumage(kv :flat :named)
+    $I0 = file_exists($S0)
+    unless $I0 goto L1
+    print $S1
+    goto L2
+  L1:
+    $S2 = dirname($S0)
+    mkpath($S2, 1 :named('verbose'))
+    spew($S0, $S1, 1 :named('verbose'))
+  L2:
+.end
+
+.sub 'get_plumage'
+    .param pmc kv :slurpy :named
+    $S0 = get_name(kv :flat :named)
+    $S0 .= '.json'
+    $S0 = 'ports/plumage/' . $S0
+    .return ($S0)
+.end
+
+.sub 'mk_plumage' :anon
+    .param pmc kv :slurpy :named
 
     .local string name
     name = get_name(kv :flat :named)
@@ -2542,7 +2565,7 @@
 }
 TEMPLATE
     $S0 = sprintf $S0, $P0
-    print $S0
+    .return ($S0)
 .end
 
 .sub '_json_escape' :anon


More information about the parrot-commits mailing list