Description of problem: When using mock with command line option --scm-option write_tar=False it is ignored, the tar is written anyway Version-Release number of selected component (if applicable): mock-1.1.21-1.el6 How reproducible: run mock and add --scm-option write_tar=False Steps to Reproduce: 1. 2. 3. Actual results: writes tar from SCM checkout Expected results: don't write tar and use tar file provided in SCM instead Additional info: In /usr/bin/mock, all --scm-option options are converted into strings: parser.add_option("--scm-option", action="append", dest="scm_opts", default=[], type="string", help="define an SCM option (may be used more than once)") but /usr/lib/python2.6/site-packages/mockbuild/scm.py expects a boolean in line 128: if self.write_tar: For debugging, I added some lines around that: self.log.debug("in scmWorker.prepare_sources(): self.write_tar value is %s" % self.write_tar) self.log.debug("in scmWorker.prepare_sources(): type of self.write_tar is %s" % type(self.write_tar)) if self.write_tar: self.log.debug("self.write_tar should be True here, but value is %s" % self.write_tar) self.log.debug("type of self.write_tar is %s" % type(self.write_tar)) The output when using --scm-option write_tar=False then looks like this: DEBUG: in scmWorker.prepare_sources(): self.write_tar value is False DEBUG: in scmWorker.prepare_sources(): type of self.write_tar is <type 'str'> DEBUG: self.write_tar should be True here, but value is False DEBUG: type of self.write_tar is <type 'str'> DEBUG: Writing /tmp/tmp_je5wI.mock-scm.hallo/hallo/hallo-1.0.tar.gz... because any non-empty string is True in boolean evaluation. It works correctly when used in config file: config_opts['scm_opts']['write_tar'] = False In that case the output is DEBUG: in scmWorker.prepare_sources(): self.write_tar value is False DEBUG: in scmWorker.prepare_sources(): type of self.write_tar is <type 'bool'> DEBUG: Prepared sources for building src.rpm
Created attachment 590391 [details] [PATCH] Fix write_tar check in scm.py Good catch - the attached patch should fix this.
Applied for 1.1.23 build
Thanks, Clark. Stephan, FWIW, it could be noted that using the repo/.write_tar "magic" file to initiate tar ball creation for selected packages might often be more feasible method than passing lenghty command line options around.