[121225] branches/gsoc14-cleanup/src/macports1.0/reclaim.tcl

ksammons at macports.org ksammons at macports.org
Fri Jun 20 16:14:06 PDT 2014


Revision: 121225
          https://trac.macports.org/changeset/121225
Author:   ksammons at macports.org
Date:     2014-06-20 16:14:06 -0700 (Fri, 20 Jun 2014)
Log Message:
-----------
Added the ability to remove all empty directories.

Modified Paths:
--------------
    branches/gsoc14-cleanup/src/macports1.0/reclaim.tcl

Modified: branches/gsoc14-cleanup/src/macports1.0/reclaim.tcl
===================================================================
--- branches/gsoc14-cleanup/src/macports1.0/reclaim.tcl	2014-06-20 23:14:05 UTC (rev 121224)
+++ branches/gsoc14-cleanup/src/macports1.0/reclaim.tcl	2014-06-20 23:14:06 UTC (rev 121225)
@@ -30,6 +30,11 @@
         remove_distfiles
     }
 
+    proc is_emtpy_dir {dir} {
+        set filenames [glob -nocomplain -tails -directory $dir * .*]
+        expr {![llength [lsearch -all -not -regexp $filenames {^\.\.?$}]]}
+    }
+
     proc walk_files {dir delete dist_paths} {
 
         # Recursively walk through each directory that isn't an installed port and if delete each file that isn't a directory if requested.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140620/e6323f95/attachment.html>


More information about the macports-changes mailing list