texlive[51835] Master/tlpkg/libexec/place: only remove an empty dir's

commits+karl at tug.org commits+karl at tug.org
Wed Aug 7 17:53:40 CEST 2019


Revision: 51835
          http://tug.org/svn/texlive?view=revision&revision=51835
Author:   karl
Date:     2019-08-07 17:53:39 +0200 (Wed, 07 Aug 2019)
Log Message:
-----------
only remove an empty dir's parent if it too is empty

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

Modified: trunk/Master/tlpkg/libexec/place
===================================================================
--- trunk/Master/tlpkg/libexec/place	2019-08-07 03:54:14 UTC (rev 51834)
+++ trunk/Master/tlpkg/libexec/place	2019-08-07 15:53:39 UTC (rev 51835)
@@ -223,11 +223,10 @@
     # dirs. This will catch some of those; not worth trying to do full
     # recursive search to get everything, cron.tl will report on leftovers.
     chomp (my $empty_dir_parent = `cd $empty_dir/.. && pwd`);
-    if ($opt_mode eq "svn") {
-      &xsystem ("cd $M && svn remove $empty_dir $empty_dir_parent # emptydir");
-    } else {
-      &xsystem ("cd $M && rmdir $empty_dir $empty_dir_parent")
-    }
+    my ($parent_if_empty) = &empty_dirs ($empty_dir_parent);
+    my $cmd = $opt_mode eq "svn" ? "svn remove" : "rmdir";
+    &xsystem ("cd $M && $cmd $empty_dir $parent_if_empty # emptydir");
+    #
     # already in %dirs, so don't need to add.
   }
 }
@@ -490,7 +489,7 @@
       if ($opt_mode eq "svn") {
         die "opendir($d) failed: $!";
       }
-      # in git mode we don't die, git removes the empty dirs anywayi
+      # in git mode we don't die, git removes the empty dirs anyway
     }
   }
   return @ret;



More information about the tex-live-commits mailing list