aboutsummaryrefslogtreecommitdiffstats
path: root/packdrake
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-01-23 19:18:29 +0000
committerFrancois Pons <fpons@mandriva.com>2001-01-23 19:18:29 +0000
commit96c7624418b7b11ef42c95abb9059086de357c3b (patch)
tree5a689cd052d32660bfc26704f7f14bb33bdf509a /packdrake
parentc4fa5b0abb878f44e75f575e20d303304d4e6d36 (diff)
downloadrpmtools-96c7624418b7b11ef42c95abb9059086de357c3b.tar
rpmtools-96c7624418b7b11ef42c95abb9059086de357c3b.tar.gz
rpmtools-96c7624418b7b11ef42c95abb9059086de357c3b.tar.bz2
rpmtools-96c7624418b7b11ef42c95abb9059086de357c3b.tar.xz
rpmtools-96c7624418b7b11ef42c95abb9059086de357c3b.zip
added --dir and -d flag for packdrake*.
management of specific directory for building archive.
Diffstat (limited to 'packdrake')
-rwxr-xr-xpackdrake5
1 files changed, 4 insertions, 1 deletions
diff --git a/packdrake b/packdrake
index d7b3b91..31841e2 100755
--- a/packdrake
+++ b/packdrake
@@ -17,6 +17,7 @@ usage:
--build <file> - build archive <file> with filenames given on
standard input.
-[1..9] - select appropriate compression ratio, $default_ratio by default.
+ --dir <srcdir> - set source directory where to search files, \".\" by default.
--size <cmd> - set maximun chunk size, $default_size by default.
--method <cmd> - select standard compression command method, default
is set according to archive filename, example is
@@ -45,6 +46,7 @@ sub main {
/^--extract$/ and do { $mode and die $error_mode; $mode = "extract"; @nextargv = (\$file, \$dir); next };
/^--list$/ and do { $mode and die $error_mode; $mode = "list"; @nextargv = (\$file); next };
/^--cat$/ and do { $mode and die $error_mode; $mode = "cat"; @nextargv = (\$file); next };
+ /^--dir$/ and do { push @nextargv, \$dir; next };
/^--size$/ and do { push @nextargv, \$size; next };
/^--method$/ and do { push @nextargv, \$method; next };
/^--compress$/ and do { push @nextargv, \$compress; next };
@@ -55,6 +57,7 @@ sub main {
/x/ and do { $mode and die $error_mode; $mode = "extract"; @nextargv = (\$file, \$dir); next };
/l/ and do { $mode and die $error_mode; $mode = "list"; @nextargv = (\$file); next };
/c/ and do { $mode and die $error_mode; $mode = "cat"; @nextargv = (\$file); next };
+ /d/ and do { push @nextargv, \$dir; next };
/s/ and do { push @nextargv, \$size; next };
/m/ and do { push @nextargv, \$method; next };
die "packdrake: unknown option \"-$1\", check usage with --help\n"; } next };
@@ -78,7 +81,7 @@ sub main {
$mode =~ /extract/ && !$dir && !@list and ($mode, @list) = ('list', $file);
for ($mode) {
- /build/ and do { packdrake::build_archive(\*STDIN, $file, $size, $compress, $uncompress); last };
+ /build/ and do { packdrake::build_archive(\*STDIN, $dir, $file, $size, $compress, $uncompress); last };
/extract/ and do { my $packer = new packdrake($file); $packer->extract_archive($dir, @list); last };
/list/ and do { packdrake::list_archive($file, @list); last };
/cat/ and do { packdrake::cat_archive($file, @list); last };