diff options
-rwxr-xr-x | Master/tlpkg/libexec/place | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Master/tlpkg/libexec/place b/Master/tlpkg/libexec/place index 9f2232e9abd..2bf8f014274 100755 --- a/Master/tlpkg/libexec/place +++ b/Master/tlpkg/libexec/place @@ -176,7 +176,8 @@ foreach $file (sort keys %Old) { if ($opt_mode eq "svn") { &xsystem ("svn remove \"$M/$file\""); } else { - &xsystem ("git rm \"$M/$file\""); + # we cannot use the full path since git does not allow this + &xsystem ("cd \"$M\" && git rm \"$file\""); } (my $old_dir = "$M/$file") =~ s,/[^/]*$,,; $dirs_with_removals{$old_dir}++; @@ -476,11 +477,17 @@ sub empty_dirs { my @ret = (); for my $d (@dirs) { - opendir (DIR, $d) || die "opendir($d) failed: $!"; - my @dirents = readdir (DIR); - closedir (DIR) || warn "closedir($d) failed: $!"; - my @remainder = grep { $_ !~ /^\.(|\.|svn)$/ } @dirents; - push (@ret, $d) if @remainder == 0; + if (opendir (DIR, $d)) { + my @dirents = readdir (DIR); + closedir (DIR) || warn "closedir($d) failed: $!"; + my @remainder = grep { $_ !~ /^\.(|\.|svn)$/ } @dirents; + push (@ret, $d) if @remainder == 0; + } else { + if ($opt_mode eq "svn") { + die "opendir($d) failed: $!"; + } + # in git mode we don't die, git removes the empty dirs anywayi + } } return @ret; } |