gbp.log.warn("\nNot a valid upstream version: '%s'.\n%s" % (version, err_msg))
-def repacked_tarball_name(source, name, version):
- if source.is_orig():
- # Repacked orig tarball needs a different name since there's already
- # one with that name
- name = os.path.join(
- os.path.dirname(source.path),
- os.path.basename(source.path).replace(".tar", ".gbp.tar"))
- else:
- # Repacked sources or other archives get canonical name
- name = os.path.join(
- os.path.dirname(source.path),
- "%s_%s.orig.tar.bz2" % (name, version))
- return name
-
-
-def repack_source(source, name, version, unpack_dir, filters):
+def repack_source(source, new_name, unpack_dir, filters):
"""Repack the source tree"""
- name = repacked_tarball_name(source, name, version)
- repacked = source.pack(name, filters)
+ repacked = source.pack(new_name, filters)
if source.is_orig(): # the tarball was filtered on unpack
repacked.unpacked = source.unpacked
else: # otherwise unpack the generated tarball get a filtered tree
return archive
+def repacked_tarball_name(source, name, version):
+ if source.is_orig():
+ # Repacked orig tarball needs a different name since there's already
+ # one with that name
+ name = os.path.join(
+ os.path.dirname(source.path),
+ os.path.basename(source.path).replace(".tar", ".gbp.tar"))
+ else:
+ # Repacked sources or other archives get canonical name
+ name = os.path.join(
+ os.path.dirname(source.path),
+ "%s_%s.orig.tar.bz2" % (name, version))
+ return name
+
+
def set_bare_repo_options(options):
"""Modify options for import into a bare repository"""
if options.pristine_tar or options.merge:
if orig_needs_repack(source, options):
gbp.log.debug("Filter pristine-tar: repacking '%s' from '%s'" % (source.path, source.unpacked))
repack_dir = tempfile.mkdtemp(prefix='repack', dir=tmpdir)
- source = repack_source(source, sourcepackage, version, repack_dir, options.filters)
+ repack_name = repacked_tarball_name(source, sourcepackage, version)
+ source = repack_source(source, repack_name, repack_dir, options.filters)
(pristine_orig, linked) = prepare_pristine_tar(source.path,
sourcepackage,