automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[automake-commit] branch master updated: tests: use find+rm, not perl, t


From: Karl Berry
Subject: [automake-commit] branch master updated: tests: use find+rm, not perl, to remove temporary directories.
Date: Sun, 19 Jan 2020 21:20:11 -0500

This is an automated email from the git hooks/post-receive script.

karl pushed a commit to branch master
in repository automake.

View the commit online:
https://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=40415b21c1ab1c4036e153e4e43d8a373134b228

The following commit(s) were added to refs/heads/master by this push:
     new 40415b2  tests: use find+rm, not perl, to remove temporary directories.
40415b2 is described below

commit 40415b21c1ab1c4036e153e4e43d8a373134b228
Author: Karl Berry <address@hidden>
AuthorDate: Sat Jan 18 18:06:23 2020 -0800

    tests: use find+rm, not perl, to remove temporary directories.
    
    This change fixes automake bug#39078:
    https://debbugs.gnu.org/39078
    
    * t/ax/test-lib.sh (rm_rf_): run chmod -R u+rwx and rm -rf,
    instead of calling our t/ax/deltree.pl script.  This reverses the
    change of 2013-05-16.  It made sense to write and use deltree
    at that point, but unfortunately as of perl-5.28.0
    (File::Path.pm version 2.15), rmtree no longer removes a tree with
    unreadable subdirectories, such as we (intentionally) have.  So we
    might as well go back to rm -rf.  The unconditional recursive chmod
    instead of the previously-used more complex find command will
    hopefully prove portable.  See the bug report for more details.
    
    Our deltree.pl is not used for anything else, but nevertheless
    leaving it in our source tree for now, for ease of reversion
    and comparison.
---
 t/ax/test-lib.sh | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/t/ax/test-lib.sh b/t/ax/test-lib.sh
index 57afc07..69e98fb 100644
--- a/t/ax/test-lib.sh
+++ b/t/ax/test-lib.sh
@@ -197,7 +197,27 @@ seq_ ()
 rm_rf_ ()
 {
   test $# -gt 0 || return 0
-  $PERL "$am_testaux_srcdir"/deltree.pl "$@"
+  chmod -R u+rwx "$@" || :
+  rm -rf "$@" # if it fails, ok, we fail
+  _am_rmrf_status=$?
+  #
+  # In the past, we ran this Perl script instead of the above
+  # chmod && rm.  See the ChangeLog for details.
+  #$PERL "$am_testaux_srcdir"/deltree.pl "$@"
+  #
+  # Let's fail up front if anything remains after the supposed removal.
+  for _am_rmrf_v
+  do
+    if test -e "$_am_rmrf_v"; then
+      echo "$me (test-lib.sh:rm_rf_): tree not removed: $_am_rmrf_v" >&2
+      echo "$me (test-lib.sh:rm_rf_): ls -alR follows:" >&2
+      ls -alR $_am_rmrf_v >&2 # should always be there
+      echo "$me (test-lib.sh:rm_rf_): " \
+           "end ls of tree not removed ($_am_rmrf_v)." >&2
+      _am_rmrf_status=2
+    fi
+  done
+  return $_am_rmrf_status
 }
 
 commented_sed_unindent_prog='



reply via email to

[Prev in Thread] Current Thread [Next in Thread]