mock unique buildroot extension test
Dan Williams
dcbw at redhat.com
Sat Jun 25 16:30:16 UTC 2005
Hi,
This patch provides the ability to specify a unique extension to the buildroot
directory. This provides the ability for more than one mock process building
the same .cfg file, but isolated from each other. Useful for build systems :)
Dan
-------------- next part --------------
? mock-0.3.tar.gz
? mock-uniqueext.patch
? src/mock-helper
Index: mock.py
===================================================================
RCS file: /cvs/fedora/mock/mock.py,v
retrieving revision 1.17
diff -u -r1.17 mock.py
--- mock.py 24 Jun 2005 01:35:28 -0000 1.17
+++ mock.py 25 Jun 2005 16:09:38 -0000
@@ -46,7 +46,10 @@
self._state = 'unstarted'
self.tmplog = []
self.config = config
- self.basedir = '%s/%s' % (config['basedir'], config['root'])
+ basedir = config['basedir']
+ if config.has_key('unique-ext'):
+ basedir = "%s-%s" % (config['basedir'], config['unique-ext'])
+ self.basedir = os.path.join(basedir, config['root'])
self.target_arch = config['target_arch']
self.rootdir = os.path.join(self.basedir, 'root')
self.homedir = self.config['chroothome']
@@ -585,6 +588,8 @@
default=None, help="path for resulting files to be put")
parser.add_option("--statedir", action="store", type="string", default=None,
help="path for state dirresulting files to be put")
+ parser.add_option("--uniqueext", action="store", type="string", default=None,
+ help="Arbitrary, unique extension to append to buildroot directory name")
return parser.parse_args()
@@ -677,6 +682,8 @@
if options.statedir:
config_opts['statedir'] = options.statedir
+ if options.uniqueext:
+ config_opts['unique-ext'] = options.uniqueext
# do whatever we're here to do
if args[0] == 'clean':
More information about the Fedora-buildsys-list
mailing list