projects
/
10.03
/
openwrt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6315832
)
dl_cleanup: Add linux and gcc to blacklist
author
mb
<mb@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 9 Jan 2010 18:19:29 +0000
(18:19 +0000)
committer
mb
<mb@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 9 Jan 2010 18:19:29 +0000
(18:19 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19082
3c298f89
-4303-0410-b956-
a3cf2f4a3e73
scripts/dl_cleanup.py
patch
|
blob
|
history
diff --git
a/scripts/dl_cleanup.py
b/scripts/dl_cleanup.py
index
41f172d
..
53cf4db
100755
(executable)
--- a/
scripts/dl_cleanup.py
+++ b/
scripts/dl_cleanup.py
@@
-81,12
+81,14
@@
versionRegex = (
)
blacklist = (
)
blacklist = (
- re.compile(r"wl_apsta.*"),
- re.compile(r"boost.*"),
- re.compile(r".*\.fw"),
- re.compile(r".*\.arm"),
- re.compile(r".*\.bin"),
- re.compile(r"RT\d+_Firmware.*"),
+ ("linux", re.compile(r"linux-.*")),
+ ("gcc", re.compile(r"gcc-.*")),
+ ("boost", re.compile(r"boost.*")),
+ ("wl_apsta", re.compile(r"wl_apsta.*")),
+ (".fw", re.compile(r".*\.fw")),
+ (".arm", re.compile(r".*\.arm")),
+ (".bin", re.compile(r".*\.bin")),
+ ("rt-firmware", re.compile(r"RT\d+_Firmware.*")),
)
class EntryParseError(Exception): pass
)
class EntryParseError(Exception): pass
@@
-132,14
+134,15
@@
def usage():
print "Usage: " + sys.argv[0] + " [OPTIONS] <path/to/dl>"
print ""
print " -d|--dry-run Do a dry-run. Don't delete any files"
print "Usage: " + sys.argv[0] + " [OPTIONS] <path/to/dl>"
print ""
print " -d|--dry-run Do a dry-run. Don't delete any files"
+ print " -B|--show-blacklist Show the blacklist and exit"
def main(argv):
global opt_dryrun
try:
(opts, args) = getopt.getopt(argv[1:],
def main(argv):
global opt_dryrun
try:
(opts, args) = getopt.getopt(argv[1:],
- "hd",
- [ "help", "dry-run", ])
+ "hd
B
",
+ [ "help", "dry-run",
"show-blacklist",
])
if len(args) != 1:
raise getopt.GetoptError()
except getopt.GetoptError:
if len(args) != 1:
raise getopt.GetoptError()
except getopt.GetoptError:
@@
-152,14
+155,18
@@
def main(argv):
return 0
if o in ("-d", "--dry-run"):
opt_dryrun = True
return 0
if o in ("-d", "--dry-run"):
opt_dryrun = True
+ if o in ("-B", "--show-blacklist"):
+ for (name, regex) in blacklist:
+ print name
+ return 0
# Create a directory listing and parse the file names.
entries = []
for filename in os.listdir(directory):
if filename == "." or filename == "..":
continue
# Create a directory listing and parse the file names.
entries = []
for filename in os.listdir(directory):
if filename == "." or filename == "..":
continue
- for
black
in blacklist:
- if
black
.match(filename):
+ for
(name, regex)
in blacklist:
+ if
regex
.match(filename):
if opt_dryrun:
print filename, "is blacklisted"
break
if opt_dryrun:
print filename, "is blacklisted"
break