elif options.export in repo.get_local_branches():
branch = options.export
if branch:
- if is_pq_branch(branch, options):
- packaging_branch = pq_branch_base(branch, options)
+ if is_pq_branch(branch, options.pq_branch):
+ packaging_branch = pq_branch_base(branch, options.pq_branch)
if repo.has_branch(packaging_branch):
gbp.log.info("It seems you're building a development/patch-"
"queue branch. Export target changed to '%s' and "
elif options.patch_export and not options.patch_export_rev:
tree = get_tree(repo, options.export)
spec = parse_spec(options, repo, treeish=tree)
- pq_branch = pq_branch_name(branch, options, spec.version)
+ pq_branch = pq_branch_name(branch, options.pq_branch, spec.version)
if repo.has_branch(pq_branch):
gbp.log.info("Exporting patches from development/patch-queue "
"branch '%s'" % pq_branch)
'--define', "_sourcedir %%_topdir/%s" % options.export_sourcedir])
elif options.builder.startswith('osc'):
builder_args.insert(0, 'build')
- options.source_dir = ''
- options.spec_dir = ''
+ options.export_sourcedir = ''
+ options.export_specdir = ''
def packaging_tag_data(repo, commit, name, version, options):
parser.add_option("--git-verbose", action="store_true", dest="verbose",
default=False, help="verbose command execution")
parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
+ parser.add_config_file_option(option_name="abbrev", dest="abbrev",
+ type="int")
parser.add_config_file_option(option_name="color", dest="color",
type='tristate')
parser.add_config_file_option(option_name="color-scheme",
if not parser:
return None, None, None
options, args = parser.parse_args(args)
+ options.patch_export_compress = rpm.string_to_int(options.patch_export_compress)
gbp.log.setup(options.color, options.verbose, options.color_scheme)
if not options.hooks:
# Move packaging files to final export dir
gbp.log.debug("Exporting packaging files from '%s' to '%s'" %
- (dump_dir, export_dir))
- for fname in os.listdir(dump_dir):
- src = os.path.join(dump_dir, fname)
+ (spec.specdir, export_dir))
+ for fname in os.listdir(spec.specdir):
+ src = os.path.join(spec.specdir, fname)
if fname == spec.specfile:
dst = os.path.join(spec_dir, fname)
else:
dst = os.path.join(source_dir, fname)
- try:
- shutil.copy2(src, dst)
- except IOError as err:
- raise GbpError("Error exporting files: %s" % err)
+ if not os.path.isdir(src):
+ try:
+ shutil.copy2(src, dst)
+ except IOError as err:
+ raise GbpError("Error exporting files: %s" % err)
spec.specdir = os.path.abspath(spec_dir)
# Get/build the orig tarball