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

Implementation of a wild card usage for the uniqueext option



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I hope, I'm using the right mailing list. If not, I will be happy for
any hint to discover the right one for this
topic.

During the work on the ppc machine, on which I have access via a ssh
connection, I have learned knowing about
the benefits of the --uniqueext option of mock.

- From my point of view this option has the disadvantage, that you have
to educate the users to used it.
So I have try to develop a patch, which allow you to get the expected
result without the need of
specified a special option on the command line.

My idea is that if you set uniqueext to '*' (Star), the userid of the
logon user should be append on the
root directory. This behavior allows you, that you can add a
"config_opts['unique-ext']='*'" line in the
config files of mock.

Best Regards:

Jochen Schmitt

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

iD8DBQFGk6EiT2AHK6txfgwRAkqNAKD/HzWzjmifdG+9GdN0yxvkLezv9ACcCKlP
qbB3t+eSPErwnQ8X1VxGRDU=
=yjw4
-----END PGP SIGNATURE-----

--- mock-0.7.2/mock.py.uid	2007-06-28 22:39:40.000000000 +0200
+++ mock-0.7.2/mock.py	2007-06-28 22:47:39.000000000 +0200
@@ -30,6 +30,7 @@ import popen2
 import shutil
 import types
 import grp
+import pwd
 import signal
 import stat
 import time
@@ -119,7 +120,10 @@ class Root:
         self.mounts = {}
         root = config['root']
         if config.has_key('unique-ext'):
-            root = "%s-%s" % (root, config['unique-ext'])
+            if config['unique-ext'] == '*':
+                root = "%s-%s" % (root, pwd.getpwuid(os.getuid())[0])
+            else:
+                root = "%s-%s" % (root, config['unique-ext'])
         self.basedir = os.path.join(config['basedir'], root)
         if self.basedir.find("/var/lib/mock") != 0:
             raise RootError, "Cannot change basedir location!"

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]