summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2018-06-14 02:38:49 +0000
committerNorbert Preining <preining@logic.at>2018-06-14 02:38:49 +0000
commita83124cac963f5d52c6890bf280460d750507703 (patch)
tree30e9636000290f3839c5408bfac1467e8aee1da0
parent09e135b0244fcd2db0ce5066db4a88c96e820af9 (diff)
more adjustment for place in git mode
git-svn-id: svn://tug.org/texlive/trunk@48011 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/tlpkg/libexec/place19
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;
}