[svn:parrot] r42426 - trunk/runtime/parrot/library
fperrad at svn.parrot.org
fperrad at svn.parrot.org
Wed Nov 11 21:12:48 UTC 2009
Author: fperrad
Date: Wed Nov 11 21:12:47 2009
New Revision: 42426
URL: https://trac.parrot.org/parrot/changeset/42426
Log:
[distutils] split exe_pbc/installable_pbc
Modified:
trunk/runtime/parrot/library/distutils.pir
Modified: trunk/runtime/parrot/library/distutils.pir
==============================================================================
--- trunk/runtime/parrot/library/distutils.pir Wed Nov 11 20:43:26 2009 (r42425)
+++ trunk/runtime/parrot/library/distutils.pir Wed Nov 11 21:12:47 2009 (r42426)
@@ -57,6 +57,8 @@
register_step_after('build', _build_pbc_pir)
.const 'Sub' _build_exe_pbc = '_build_exe_pbc'
register_step_after('build', _build_exe_pbc)
+ .const 'Sub' _build_installable_pbc = '_build_installable_pbc'
+ register_step_after('build', _build_installable_pbc)
.const 'Sub' _build_html_pod = '_build_html_pod'
register_step_after('build', _build_html_pod)
@@ -76,6 +78,8 @@
register_step_after('clean', _clean_pbc_pir)
.const 'Sub' _clean_exe_pbc = '_clean_exe_pbc'
register_step_after('clean', _clean_exe_pbc)
+ .const 'Sub' _clean_installable_pbc = '_clean_installable_pbc'
+ register_step_after('clean', _clean_installable_pbc)
.const 'Sub' _clean_html_pod = '_clean_html_pod'
register_step_after('clean', _clean_html_pod)
@@ -85,8 +89,8 @@
register_step_after('install', _install_dynops)
.const 'Sub' _install_dynpmc = '_install_dynpmc'
register_step_after('install', _install_dynpmc)
- .const 'Sub' _install_exe_pbc = '_install_exe_pbc'
- register_step_after('install', _install_exe_pbc)
+ .const 'Sub' _install_installable_pbc = '_install_installable_pbc'
+ register_step_after('install', _install_installable_pbc)
.const 'Sub' _test = '_test'
register_step('test', _test)
@@ -97,8 +101,8 @@
register_step_after('uninstall', _uninstall_dynops)
.const 'Sub' _uninstall_dynpmc = '_uninstall_dynpmc'
register_step_after('uninstall', _uninstall_dynpmc)
- .const 'Sub' _uninstall_exe_pbc = '_uninstall_exe_pbc'
- register_step_after('uninstall', _uninstall_exe_pbc)
+ .const 'Sub' _uninstall_installable_pbc = '_uninstall_installable_pbc'
+ register_step_after('uninstall', _uninstall_installable_pbc)
.const 'Sub' _usage = '_usage'
register_step('usage', _usage)
@@ -517,6 +521,52 @@
$I0 = length pbc
$I0 -= 4
$S0 = substr pbc, 0, $I0
+ $S1 = $S0 . exe
+ $I0 = newer($S1, pbc)
+ if $I0 goto L1
+ .local string cmd
+ cmd = get_bindir()
+ cmd .= "/pbc_to_exe"
+ cmd .= exe
+ cmd .= " "
+ cmd .= pbc
+ system(cmd)
+ goto L1
+ L2:
+.end
+
+=item installable_pbc
+
+hash
+
+the key is the executable pathname
+
+the value is the PBC pathname
+
+=cut
+
+.sub '_build_installable_pbc' :anon
+ .param pmc kv :slurpy :named
+ $I0 = exists kv['installable_pbc']
+ unless $I0 goto L1
+ $P0 = kv['installable_pbc']
+ build_installable_pbc($P0)
+ L1:
+.end
+
+.sub 'build_installable_pbc'
+ .param pmc hash
+ .local string exe
+ exe = get_exe()
+ $P0 = iter hash
+ L1:
+ unless $P0 goto L2
+ .local string bin, pbc
+ bin = shift $P0
+ pbc = $P0[bin]
+ $I0 = length pbc
+ $I0 -= 4
+ $S0 = substr pbc, 0, $I0
$S1 = "installable_" . $S0
$S1 .= exe
$I0 = newer($S1, pbc)
@@ -527,7 +577,6 @@
cmd .= exe
cmd .= " "
cmd .= pbc
- system(cmd)
cmd .= " --install"
system(cmd)
goto L1
@@ -1092,21 +1141,56 @@
obj = get_obj()
$P0 = iter hash
L1:
- unless $P0 goto L2
- bin = shift $P0
- pbc = hash[bin]
- $I0 = length pbc
- $I0 -= 4
- $S0 = substr pbc, 0, $I0
- $S1 = $S0 . exe
- unlink($S1)
- $S1 = 'installable_' . $S1
- unlink($S1)
- $S1 = $S0 . '.c'
- unlink($S1)
- $S1 = $S0 . obj
- unlink($S1)
- goto L1
+ unless $P0 goto L2
+ bin = shift $P0
+ pbc = hash[bin]
+ $I0 = length pbc
+ $I0 -= 4
+ $S0 = substr pbc, 0, $I0
+ $S1 = $S0 . exe
+ unlink($S1)
+ $S1 = $S0 . '.c'
+ unlink($S1)
+ $S1 = $S0 . obj
+ unlink($S1)
+ goto L1
+ L2:
+.end
+
+=item installable_pbc
+
+=cut
+
+.sub '_clean_installable_pbc' :anon
+ .param pmc kv :slurpy :named
+ $I0 = exists kv['installable_pbc']
+ unless $I0 goto L1
+ $P0 = kv['installable_pbc']
+ clean_installable_pbc($P0)
+ L1:
+.end
+
+.sub 'clean_installable_pbc'
+ .param pmc hash
+ .local string bin, exe, obj, pbc
+ exe = get_exe()
+ obj = get_obj()
+ $P0 = iter hash
+ L1:
+ unless $P0 goto L2
+ bin = shift $P0
+ pbc = hash[bin]
+ $I0 = length pbc
+ $I0 -= 4
+ $S0 = substr pbc, 0, $I0
+ $S1 = 'installable_' . $S0
+ $S1 .= exe
+ unlink($S1)
+ $S1 = $S0 . '.c'
+ unlink($S1)
+ $S1 = $S0 . obj
+ unlink($S1)
+ goto L1
L2:
.end
@@ -1409,20 +1493,20 @@
L2:
.end
-=item exe_pbc
+=item installable_pbc
=cut
-.sub '_install_exe_pbc' :anon
+.sub '_install_installable_pbc' :anon
.param pmc kv :slurpy :named
- $I0 = exists kv['exe_pbc']
+ $I0 = exists kv['installable_pbc']
unless $I0 goto L1
- $P0 = kv['exe_pbc']
- install_exe_pbc($P0)
+ $P0 = kv['installable_pbc']
+ install_installable_pbc($P0)
L1:
.end
-.sub 'install_exe_pbc'
+.sub 'install_installable_pbc'
.param pmc hash
.local string bin, bindir, pbc, exe
bindir = get_bindir()
@@ -1596,16 +1680,16 @@
L2:
.end
-.sub '_uninstall_exe_pbc' :anon
+.sub '_uninstall_installable_pbc' :anon
.param pmc kv :slurpy :named
- $I0 = exists kv['exe_pbc']
+ $I0 = exists kv['installable_pbc']
unless $I0 goto L1
- $P0 = kv['exe_pbc']
- uninstall_exe_pbc($P0)
+ $P0 = kv['installable_pbc']
+ uninstall_installable_pbc($P0)
L1:
.end
-.sub 'uninstall_exe_pbc'
+.sub 'uninstall_installable_pbc'
.param pmc hash
.local string bin, bindir, exe
bindir = get_bindir()
More information about the parrot-commits
mailing list