Assume dl/ the default dl dir and make it configurable if someone have that in
a different place.
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
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")
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")
+ print(
+ " -D|--download-dir Provide path to dl dir to clean also the build directory"
+ )
try:
(opts, args) = getopt.getopt(
argv[1:],
try:
(opts, args) = getopt.getopt(
argv[1:],
[
"help",
"dry-run",
"show-blacklist",
"whitelist=",
[
"help",
"dry-run",
"show-blacklist",
"whitelist=",
- if len(args) != 1:
- usage()
- return 1
except getopt.GetoptError as e:
usage()
return 1
except getopt.GetoptError as e:
usage()
return 1
- if not os.path.exists(directory):
- print("Can't find dl path", directory)
- return 1
for (o, v) in opts:
if o in ("-h", "--help"):
for (o, v) in opts:
if o in ("-h", "--help"):
sep = "\t"
print("%s%s(%s)" % (name, sep, regex.pattern))
return 0
sep = "\t"
print("%s%s(%s)" % (name, sep, regex.pattern))
return 0
+ if o in ("-D", "--download-dir"):
+ directory = v
+
+ if not os.path.exists(directory):
+ print("Can't find dl path", directory)
+ return 1
# Create a directory listing and parse the file names.
entries = []
# Create a directory listing and parse the file names.
entries = []