diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2012-06-15 09:00:35 +0300 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2014-11-14 14:22:07 +0200 |
commit | a5707c5c48379b5575091148eb7fde3f8c5d18bc (patch) | |
tree | 6a159427a75ab8c0719706de4a469594bf03d69a /gbp/scripts/import_orig.py | |
parent | ce9ac918549b5aa26cde5f0ed10056b1ae34c976 (diff) | |
download | git-buildpackage-a5707c5c48379b5575091148eb7fde3f8c5d18bc.tar.gz git-buildpackage-a5707c5c48379b5575091148eb7fde3f8c5d18bc.tar.bz2 git-buildpackage-a5707c5c48379b5575091148eb7fde3f8c5d18bc.zip |
import-orig: move repacked_tarball_name() out from common
Moves repacked_tarball_name() from scripts/common back to the
Debian-specific script. The logic is too Debian-specific for RPM, after
all.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/scripts/import_orig.py')
-rw-r--r-- | gbp/scripts/import_orig.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py index 888cebba..37071868 100644 --- a/gbp/scripts/import_orig.py +++ b/gbp/scripts/import_orig.py @@ -173,6 +173,21 @@ def find_source(use_uscan, args): 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: @@ -312,7 +327,8 @@ def main(argv): 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, |