fixed bug when Target was relative

This commit is contained in:
Guillaume Morin 2001-12-30 21:10:46 +00:00
parent 4930757c76
commit 8cb41d1088
2 changed files with 9 additions and 0 deletions

View file

@ -1,3 +1,9 @@
Sun Dec 30 21:58:25 2001 Guillaume Morin <gmorin@gnu.org>
* stow.in: fixed a bug introduced by previous changes when
Target argument was relative. (thanks to Luca Filipozzi
<lfilipoz@debian.org> for pointing this out)
Sun Dec 30 18:23:25 2001 Guillaume Morin <gmorin@gnu.org> Sun Dec 30 18:23:25 2001 Guillaume Morin <gmorin@gnu.org>
* stow.in: now requires Perl 5. Use POSIX getcwd instead of broken * stow.in: now requires Perl 5. Use POSIX getcwd instead of broken

View file

@ -109,11 +109,14 @@ while (@ARGV && ($_ = $ARGV[0]) && /^-/) {
&usage("No packages named") unless @ARGV; &usage("No packages named") unless @ARGV;
$current_dir = &getcwd;
if ($Stow) { if ($Stow) {
chdir($Stow) || die "Cannot chdir to target tree $Stow ($!)\n"; chdir($Stow) || die "Cannot chdir to target tree $Stow ($!)\n";
} }
$Stow = &getcwd; $Stow = &getcwd;
chdir($current_dir) || die "Your directory does not seem to exist anymore ($!)\n";
$Target = &parent($Stow) unless $Target; $Target = &parent($Stow) unless $Target;
chdir($Target) || die "Cannot chdir to target tree $Target ($!)\n"; chdir($Target) || die "Cannot chdir to target tree $Target ($!)\n";