summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMichael Büsch <mb@bu3sch.de>2010-01-09 18:31:29 +0000
committerMichael Büsch <mb@bu3sch.de>2010-01-09 18:31:29 +0000
commit9c54343555214417eaac39e61951ff5a039c82d2 (patch)
tree4a45ea6ae34e170caeb20ad9e355f89a7c360c08 /scripts
parent274e372e4c29bfe8f80041cc3e3f29aa2b48b2cf (diff)
downloadopenwrt-9c54343555214417eaac39e61951ff5a039c82d2.tar.gz
openwrt-9c54343555214417eaac39e61951ff5a039c82d2.tar.bz2
openwrt-9c54343555214417eaac39e61951ff5a039c82d2.zip
dl_cleanup: Allow removing items from blacklist
SVN-Revision: 19083
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dl_cleanup.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/scripts/dl_cleanup.py b/scripts/dl_cleanup.py
index 53cf4db051..ff38a158f0 100755
--- a/scripts/dl_cleanup.py
+++ b/scripts/dl_cleanup.py
@@ -80,7 +80,7 @@ versionRegex = (
(re.compile(r"(.+)[-_]r?(\d+)"), parseVer_r), # xxx-r1111
)
-blacklist = (
+blacklist = [
("linux", re.compile(r"linux-.*")),
("gcc", re.compile(r"gcc-.*")),
("boost", re.compile(r"boost.*")),
@@ -89,7 +89,7 @@ blacklist = (
(".arm", re.compile(r".*\.arm")),
(".bin", re.compile(r".*\.bin")),
("rt-firmware", re.compile(r"RT\d+_Firmware.*")),
-)
+]
class EntryParseError(Exception): pass
@@ -135,14 +135,15 @@ def usage():
print ""
print " -d|--dry-run Do a dry-run. Don't delete any files"
print " -B|--show-blacklist Show the blacklist and exit"
+ print " -w|--whitelist ITEM Remove ITEM from blacklist"
def main(argv):
global opt_dryrun
try:
(opts, args) = getopt.getopt(argv[1:],
- "hdB",
- [ "help", "dry-run", "show-blacklist", ])
+ "hdBw:",
+ [ "help", "dry-run", "show-blacklist", "whitelist=", ])
if len(args) != 1:
raise getopt.GetoptError()
except getopt.GetoptError:
@@ -155,6 +156,16 @@ def main(argv):
return 0
if o in ("-d", "--dry-run"):
opt_dryrun = True
+ if o in ("-w", "--whitelist"):
+ for i in range(0, len(blacklist)):
+ (name, regex) = blacklist[i]
+ if name == v:
+ del blacklist[i]
+ break
+ else:
+ print "Whitelist error: Item", v,\
+ "is not in blacklist"
+ return 1
if o in ("-B", "--show-blacklist"):
for (name, regex) in blacklist:
print name