diff options
author | Karl Berry <karl@freefriends.org> | 2019-08-07 15:53:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-08-07 15:53:39 +0000 |
commit | 9c4f387bd3829bc52f5e8dd40a06f07bb362ffeb (patch) | |
tree | 60a9c7fd95b516832ab2bb267f6eadce80ffa24e /Master/tlpkg | |
parent | e85977909585adefd40b7857ed3e4454fe6b7684 (diff) |
only remove an empty dir's parent if it too is empty
git-svn-id: svn://tug.org/texlive/trunk@51835 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rwxr-xr-x | Master/tlpkg/libexec/place | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Master/tlpkg/libexec/place b/Master/tlpkg/libexec/place index 6b58a52ccee..48ec1fd3fab 100755 --- a/Master/tlpkg/libexec/place +++ b/Master/tlpkg/libexec/place @@ -223,11 +223,10 @@ if (! $chicken) { # 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 @@ sub empty_dirs { 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; |