[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)
@@ -101,6 +101,8 @@
                              'any reversible information.')
     @cmdln.option('-f', '--file-mask', metavar='REGEX',
                         help='regular expression to select files to create hashes for')
+    @cmdln.option('-i', '--ignore-mask', metavar='REGEX',
+                        help='regular expression to ignore certain files, and don\'t create hashes for them')
     @cmdln.option('-b', '--base-dir', metavar='PATH',
                         help='set the base directory (so that you can work on a subdirectory)')
     @cmdln.option('-t', '--target-dir', metavar='PATH',
@@ -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 2009-03-01Z20:43:28

This archive was generated by hypermail 2.2.0 : 2009-07-10Z19:18:11 GMT