summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzzyray <fuzzyray@gentoo.org>2005-12-19 18:25:04 +0000
committerfuzzyray <fuzzyray@gentoo.org>2005-12-19 18:25:04 +0000
commit351cd75a09c06182b3b1c6c1c654feb54f8053e8 (patch)
tree3b5af05fb052ad85bb53e55f4185e5b189f26646
parenta999d0d6f28395d5f7f0cf1dcbc6626f385e761c (diff)
downloadgentoolkit-351cd75a09c06182b3b1c6c1c654feb54f8053e8.tar.gz
Add reqular expression matching for eclean. Bug 114365
svn path=/; revision=268
-rw-r--r--trunk/ChangeLog10
-rw-r--r--trunk/src/eclean/ChangeLog4
-rw-r--r--trunk/src/eclean/eclean24
3 files changed, 33 insertions, 5 deletions
diff --git a/trunk/ChangeLog b/trunk/ChangeLog
index ede1f64..ea45431 100644
--- a/trunk/ChangeLog
+++ b/trunk/ChangeLog
@@ -1,3 +1,9 @@
+2005-12-19 Paul Varner <fuzzyray@gentoo.org>
+ * eclean: Add regular expression matching for exclude files (Bug 114365)
+
+2005-12-13 Paul Varner <fuzzyray@gentoo.org>
+ * equery: Fix USE flag parsing. (Bug 115294)
+
2005-12-07 Paul Varner <fuzzyray@gentoo.org>
* revdep-rebuild: Fix revdep-rebuild to work with findutils-4.2.27.
(bug 111203)
@@ -77,8 +83,8 @@
be missed. (bug 97171)
2005-06-07 Paul Varner <fuzzyray@gentoo.org>
- * revdep-rebuild: Delete temporary files if the environment does not match the previous
- environment (bug 95274)
+ * revdep-rebuild: Delete temporary files if the environment does not
+ match the previous environment (bug 95274)
2005-06-05 Paul Varner <fuzzyray@gentoo.org>
* revdep-rebuild: Imported revdep-rebuild release from bug 62644
diff --git a/trunk/src/eclean/ChangeLog b/trunk/src/eclean/ChangeLog
index ad8a0ef..36d9a28 100644
--- a/trunk/src/eclean/ChangeLog
+++ b/trunk/src/eclean/ChangeLog
@@ -1,3 +1,7 @@
+2005-12-19 Paul Varner <fuzzyray@gentoo.org>
+ * Add support for reqular expression matching for file names in the
+ exclude files.
+
2005-08-28 Thomas de Grenier de Latour (tgl) <degrenier@easyconnect.fr>
* Version 0.4.1
* added support for some "eclean-dist" and "eclean-pkg" symlinks on eclean
diff --git a/trunk/src/eclean/eclean b/trunk/src/eclean/eclean
index 0b0b6ce..c631cea 100644
--- a/trunk/src/eclean/eclean
+++ b/trunk/src/eclean/eclean
@@ -450,7 +450,13 @@ def parseExcludeFile(filepath):
else: raise ParseExcludeFileException("Invalid cat/pkg: "+mycp)
except: pass
#raise ParseExcludeFileException("Invalid line: "+line)
- excl_dict['garbage'][line] = None
+ try:
+ excl_dict['garbage'][line] = re.compile(line)
+ except:
+ try:
+ excl_dict['garbage'][line] = re.compile(re.escape(line))
+ except:
+ raise ParseExcludeFileException("Invalid file name/regular expression: "+line)
return excl_dict
@@ -551,8 +557,20 @@ def findDistfiles( \
continue
if time_limit and (file_stat[stat.ST_MTIME] >= time_limit):
continue
- if 'garbage' in exclude_dict and file in exclude_dict['garbage']:
- continue
+ if 'garbage' in exclude_dict:
+ # Try to match file name directly
+ if file in exclude_dict['garbage']:
+ file_match = True
+ # See if file matches via regular expression matching
+ else:
+ file_match = False
+ for file_entry in exclude_dict['garbage']:
+ if exclude_dict['garbage'][file_entry].match(file):
+ file_match = True
+ break
+
+ if file_match:
+ continue
# this is a candidate for cleaning
clean_dict[file]=[filepath]
# remove files owned by some protected packages