OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-tools Date: 11-Feb-2005 16:32:54
Branch: HEAD Handle: 2005021115325400
Modified files:
openpkg-tools/cmd bf-mk.pl
Log:
add argument shifting and align command evaluation
Summary:
Revision Changes Path
1.17 +13 -16 openpkg-tools/cmd/bf-mk.pl
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-tools/cmd/bf-mk.pl
============================================================================
$ cvs diff -u -r1.16 -r1.17 bf-mk.pl
--- openpkg-tools/cmd/bf-mk.pl 11 Feb 2005 10:28:16 -0000 1.16
+++ openpkg-tools/cmd/bf-mk.pl 11 Feb 2005 15:32:54 -0000 1.17
@@ -471,7 +471,7 @@
%{driver.shtool} mkdir -f -m 775 $target || die "cannot create directory
\"$target\""
}
-oneshot ()
+cmd_oneshot ()
{
createslavestructure
@@ -536,7 +536,7 @@
)
}
-amend ()
+cmd_amend ()
{
createslavestructure
@@ -580,7 +580,7 @@
exit 0
}
-loop ()
+cmd_loop ()
{
round=1
while [ 1 ]; do
@@ -617,18 +617,15 @@
if [ ".$TERM" = .screen ]; then %{driver.shtool} echo -n
"k$HOST-$ARCH-$OS\\"; fi
cmd=""
-if [ ".$1" = ".-1" -o ".$1" = ".--oneshot" ]; then cmd="oneshot"; fi
-if [ ".$1" = ".-l" -o ".$1" = ".--loop" ]; then cmd="loop"; fi
-if [ ".$1" = ".-A" -o ".$1" = ".--amend" ]; then cmd="amend"; fi
-if [ ".$1" = ".-H" -o ".$1" = ".--help" ]; then cmd="help"; fi
-if [ ".$cmd" = . ]; then usage "ERROR"; fi
+if [ ".$1" = ".-1" -o ".$1" = ".--oneshot" ]; then shift; cmd="oneshot"; fi
+if [ ".$1" = ".-l" -o ".$1" = ".--loop" ]; then shift; cmd="loop"; fi
+if [ ".$1" = ".-A" -o ".$1" = ".--amend" ]; then shift; cmd="amend"; fi
+if [ ".$1" = ".-H" -o ".$1" = ".--help" ]; then shift; cmd="help"; fi
if [ ".$cmd" = .help ]; then usage; fi
-if [ ".$cmd" = .oneshot ]; then oneshot; fi
-if [ ".$cmd" = .loop ]; then loop; fi
-if [ ".$cmd" = .amend ]; then amend; fi
+if [ ".$cmd" = . ]; then usage "ERROR"; fi
+cmd_$cmd "$@"
exit 1
-
EOT
return &subst($cfg, $txt);
}
@@ -715,9 +712,9 @@
if [ ".$TERM" = .screen ]; then %{driver.shtool} echo -n "k$HOST
[WORKER]\\"; fi
cmd=""
-if [ ".$1" = ".-a" -o ".$1" = ".--attach" ]; then cmd="attach"; fi
-if [ ".$1" = ".-c" -o ".$1" = ".--create" ]; then cmd="create"; fi
-if [ ".$1" = ".-H" -o ".$1" = ".--help" ]; then cmd="help"; fi
+if [ ".$1" = ".-a" -o ".$1" = ".--attach" ]; then shift; cmd="attach"; fi
+if [ ".$1" = ".-c" -o ".$1" = ".--create" ]; then shift; cmd="create"; fi
+if [ ".$1" = ".-H" -o ".$1" = ".--help" ]; then shift; cmd="help"; fi
if [ ".$cmd" = .help ]; then usage; fi
# fallback to command autodetection
@@ -730,7 +727,7 @@
fi
if [ ".$cmd" = . ]; then usage "ERROR"; fi
-cmd_$cmd
+cmd_$cmd "$@"
exit 1
EOT
return &subst($cfg, $txt);
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]