texlive[48011] Master/tlpkg/libexec/place: more adjustment for place

commits+preining at tug.org commits+preining at tug.org
Thu Jun 14 04:38:49 CEST 2018


Revision: 48011
          http://tug.org/svn/texlive?view=revision&revision=48011
Author:   preining
Date:     2018-06-14 04:38:49 +0200 (Thu, 14 Jun 2018)
Log Message:
-----------
more adjustment for place in git mode

Modified Paths:
--------------
    trunk/Master/tlpkg/libexec/place

Modified: trunk/Master/tlpkg/libexec/place
===================================================================
--- trunk/Master/tlpkg/libexec/place	2018-06-14 00:23:49 UTC (rev 48010)
+++ trunk/Master/tlpkg/libexec/place	2018-06-14 02:38:49 UTC (rev 48011)
@@ -176,7 +176,8 @@
     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 @@
   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;
 }



More information about the tex-live-commits mailing list