]> granicus.if.org Git - handbrake/commitdiff
Build: add configure --df-exhaust-url
authorKonaBlend <kona8lend@gmail.com>
Thu, 29 Oct 2015 23:08:32 +0000 (19:08 -0400)
committerBradley Sepos <bradley@bradleysepos.com>
Wed, 25 May 2016 19:45:04 +0000 (15:45 -0400)
Specifying this option will cause fetching to run through all
active URLs. Decent way to test all URLs.

make/configure.py
make/df-fetch.py
make/df-verify.py

index e27b477fa7af9628f542619ae3bb3e9a0627dbf6..cf1894fb0049c96ac3d532e0d6e54896787a5f01 100644 (file)
@@ -1192,6 +1192,7 @@ def encodeDistfileConfig():
         'verbosity':      options.df_verbosity,
         'accept-url':     options.df_accept_url,
         'deny-url':       options.df_deny_url,
+        'exhaust-url':    options.df_exhaust_url,
     }
     try:
         try:
@@ -1265,6 +1266,7 @@ def createCLI():
     grp.add_option( '--df-verbose', default=1, action='count', dest='df_verbosity', help='increase distfile tools verbosity' )
     grp.add_option( '--df-accept-url', default=[], action='append', metavar='SPEC', help='accept URLs matching regex pattern' )
     grp.add_option( '--df-deny-url', default=[], action='append', metavar='SPEC', help='deny URLs matching regex pattern' )
+    grp.add_option( '--df-exhaust-url', default=False, action='store_true', help='try all active distfiles' )
     cli.add_option_group( grp )
 
     ## add install options
index eeb520c7a12be38dca12df0131a4f5e8520fdd85..914426bb09ef30fd4c97dbbe5dee9f39caa69414 100644 (file)
@@ -64,17 +64,19 @@ class Tool(hb_distfile.Tool):
         self.parser.add_option('--md5', default=None, action='store', metavar='HASH', help='verify MD5 HASH against data')
         self.parser.add_option('--accept-url', default=[], action='append', metavar='SPEC', help='accept URL regex pattern')
         self.parser.add_option('--deny-url', default=[], action='append', metavar='SPEC', help='deny URL regex pattern')
+        self.parser.add_option('--exhaust-url', default=None, action='store_true', help='try all active distfiles')
         self.parser.add_option('--output', default=None, action='store', metavar='FILE', help='write to FILE')
         self._parse()
 
     def _load_config2(self, parser, data):
-        parser.values.disable    = data['disable-fetch']
-        parser.values.accept_url = data['accept-url']
-        parser.values.deny_url   = data['deny-url']
+        parser.values.disable     = data['disable-fetch']
+        parser.values.accept_url  = data['accept-url']
+        parser.values.deny_url    = data['deny-url']
+        parser.values.exhaust_url = data['exhaust-url']
 
     def _run(self, error):
         if self.options.disable:
-            self.infof('%s disabled; stop.\n' % self.name)
+            self.infof('%s disabled; nothing to do.\n' % self.name)
             sys.exit(0)
         if len(self.args) < 1:
             self.parser.print_usage()
@@ -93,7 +95,8 @@ class Tool(hb_distfile.Tool):
             url = urls.pop(0)
             try:
                 url.download(error)
-                break
+                if not self.options.exhaust_url:
+                    break
             except Exception, x:
                 ## propagate exception if no remaining urls
                 if not urls:
index 2d56afaa538d0f94423543f5beeceb8235b891c7..adeb9af787ed55b38e75c7ce14a72f752298425a 100644 (file)
@@ -62,7 +62,7 @@ class Tool(hb_distfile.Tool):
 
     def _run(self, error):
         if self.options.disable:
-            self.infof('%s disabled; stop.\n' % self.name)
+            self.infof('%s disabled; nothing to do.\n' % self.name)
             sys.exit(0)
         if len(self.args) != 1:
             self.parser.print_usage()