[mirrorbrain-commits] [opensuse-svn] r6616 - trunk/tools/download-redirector-v2/tools

From: Novell Forge SVN <noreply_at_novell.com>
Date: Sun, 1 Mar 2009 13:42:45 -0700 (MST)
Author: poeml
Date: 2009-03-01 13:42:43 -0700 (Sun, 01 Mar 2009)
New Revision: 6616

Modified:
   trunk/tools/download-redirector-v2/tools/metalink-hasher.py
Log:
metalink-hasher: 
- add --ignoremask option that specifies a regexp for files that the hashes
  should not be done for0


Modified: trunk/tools/download-redirector-v2/tools/metalink-hasher.py
===================================================================
--- trunk/tools/download-redirector-v2/tools/metalink-hasher.py	2009-03-01 19:02:59 UTC (rev 6615)
+++ trunk/tools/download-redirector-v2/tools/metalink-hasher.py	2009-03-01 20:42:43 UTC (rev 6616)
_at_@ -101,6 +101,8 @@
                              'any reversible information.')
     _at_cmdln.option('-f', '--file-mask', metavar='REGEX',
                         help='regular expression to select files to create hashes for')
+    _at_cmdln.option('-i', '--ignore-mask', metavar='REGEX',
+                        help='regular expression to ignore certain files, and don\'t create hashes for them')
     _at_cmdln.option('-b', '--base-dir', metavar='PATH',
                         help='set the base directory (so that you can work on a subdirectory)')
     _at_cmdln.option('-t', '--target-dir', metavar='PATH',
_at_@ -152,15 +154,16 @@
 
                 if os.path.isfile(fullpath):
                     if not opts.file_mask or re.match(opts.file_mask, name):
-                        #print fullpath
-                        if opts.base_dir:
-                            target = fullpath[len(opts.base_dir):]
-                        else:
-                            target = fullpath
-                        target = os.path.join(opts.target_dir, target.lstrip('/'))
-                        if opts.verbose:
-                            print 'target:', target
-                        make_hashes(fullpath, target, opts=opts)
+                        if not opts.ignore_mask or not re.match(opts.ignore_mask, name):
+                            #print fullpath
+                            if opts.base_dir:
+                                target = fullpath[len(opts.base_dir):]
+                            else:
+                                target = fullpath
+                            target = os.path.join(opts.target_dir, target.lstrip('/'))
+                            if opts.verbose:
+                                print 'target:', target
+                            make_hashes(fullpath, target, opts=opts)
 
                 elif os.path.isdir(fullpath):
                     directories.append(fullpath)  # It's a directory, store it.

_______________________________________________
Opensuse-svn mailing list
Opensuse-svn_at_forge.novell.com
http://forge.novell.com/mailman/listinfo/opensuse-svn


_______________________________________________
mirrorbrain-commits mailing list

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Sun Mar 01 2009 - 20:43:28 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT