From b6898a91bf508a10db8682c1e07666893a069c06 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 15 Sep 2000 10:55:17 +0000 Subject: use TMPDIR if available --- packdrake | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'packdrake') diff --git a/packdrake b/packdrake index 57b4acf..f801ad4 100755 --- a/packdrake +++ b/packdrake @@ -52,7 +52,6 @@ #- general information. my $VERSION = "0.1"; my $default_size = 400000; -my $default_tmpdir = "/tmp"; my $default_ratio = 6; #- used for uncompressing archive and listing. @@ -459,8 +458,6 @@ usage: /bin/gzip or /usr/bin/bzip2. --compress - select compression command. --uncompress - select uncompression command. - --tmpdir - select a specific tempory directory for operation, - default to $default_tmpdir. --extract - extract archive contents to directory , specific file to extract are given on command line. --uncompress - override uncompression method in archive . @@ -471,7 +468,7 @@ usage: } sub main { - my ($file, $mode, $dir, $size, $method, $compress, $uncompress, $tmpdir, $ratio); + my ($file, $mode, $dir, $size, $method, $compress, $uncompress, $ratio); my @nextargv = (\$file); my @list = (); @@ -487,7 +484,6 @@ sub main { /^--method$/ and do { push @nextargv, \$method; next }; /^--compress$/ and do { push @nextargv, \$compress; next }; /^--uncompress$/ and do { push @nextargv, \$uncompress; next }; - /^--tmpdir$/ and do { push @nextargv, \$tmpdir; next }; /^-(.*)$/ and do { foreach (split //, $1) { /[1-9]/ and do { $ratio = $_; next }; /b/ and do { $mode and die $error_mode; $mode = "build"; @nextargv = (\$file); next }; @@ -505,9 +501,9 @@ sub main { #- examine and lauch. $mode =~ /cat/ or $file or die "packdrake: no archive filename given, check usage with --help\n"; $size ||= 400000; - $tmpdir ||= "/tmp"; $ratio ||= 6; + $tmpdir = $ENV{TMPDIR} || "/tmp"; $tmpz = "$tmpdir/packdrake-tmp.$$"; unless ($method) { $file =~ /\.cz$/ and $method = "gzip"; -- cgit v1.2.1