[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Implementation of a wild card usage for the uniqueext option

Hash: SHA1

nodata schrieb:
> Am Dienstag, den 10.07.2007, 17:09 +0200 schrieb Jochen Schmitt:

> 1. avoid wildcards and special characters 2. for hacks like this
> ("*" is a valid value), have a new option for that, e.g.
> config_opts['auto-unique-ext']=1

Thank you for your hints. I have attached a improved version of my patch.

Best Regards:

Jochen Schmitt
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org


--- mock-0.7.2/mock.py.uid	2007-06-19 22:56:28.000000000 +0200
+++ mock-0.7.2/mock.py	2007-07-10 19:03:14.000000000 +0200
@@ -30,6 +30,7 @@ import popen2
 import shutil
 import types
 import grp
+import pwd
 import signal
 import stat
 import time
@@ -120,6 +121,9 @@ class Root:
         root = config['root']
         if config.has_key('unique-ext'):
             root = "%s-%s" % (root, config['unique-ext'])
+        elif config.has_key('auto-unique-ext'):
+            if config['auto-unique-ext'] == 1:
+                root = "%s-%s" % (root, pwd.getpwuid(os.getuid())[0])
         self.basedir = os.path.join(config['basedir'], root)
         if self.basedir.find("/var/lib/mock") != 0:
             raise RootError, "Cannot change basedir location!"
@@ -849,6 +853,8 @@ def command_parse():
                       help="Path to directory where state information is written")
     parser.add_option("--uniqueext", action="store", type="string", default=None,
                       help="Arbitrary, unique extension to append to buildroot directory name")
+    parser.add_option("--autouniqueext", action="store", type="int", default=None,
+                      help="Append the userid as an unique extension to buidroot directory name")
     parser.add_option("--configdir", action="store", dest="configdir", default=None,
                       help="Change where config files are found")
     parser.add_option("--verbose", action ="store_true", dest="verbose", 
@@ -930,6 +936,8 @@ def set_config_opts_per_cmdline(config_o
         config_opts['unique-ext'] = options.uniqueext
     if options.rpmbuild_timeout is not None:
         config_opts['rpmbuild_timeout'] = options.rpmbuild_timeout
+    if options.autouniqueext is not None:
+        config_opts['auto-unique-ext'] = options.autouniqueext
 def do_clean(config_opts, init=0):
         my = None

Attachment: mock-0.7.2-uid.patch.sig
Description: Binary data

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]