diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2012-01-12 15:24:19 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2012-01-15 19:55:40 +0100 |
commit | d47358201156967114dbb232a0438e6a3cb8842c (patch) | |
tree | ab8d5d8a822b61e73c39c35dc10297469c91e0cc /gbp | |
parent | 2aa428256885b9d2429a83c51065a42de6d0c242 (diff) |
deb: minor refactor of parameters of has_orig()
Diffstat (limited to 'gbp')
-rw-r--r--[-rwxr-xr-x] | gbp/deb/__init__.py | 6 | ||||
-rwxr-xr-x | gbp/scripts/buildpackage.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/gbp/deb/__init__.py b/gbp/deb/__init__.py index 1f52b17f..92d893ab 100755..100644 --- a/gbp/deb/__init__.py +++ b/gbp/deb/__init__.py @@ -429,10 +429,10 @@ def get_compression(orig_file): return None -def has_orig(cp, compression, dir): - "Check if orig.tar.gz exists in dir" +def has_orig(orig_file, dir): + "Check if orig tarball exists in dir" try: - os.stat( os.path.join(dir, orig_file(cp, compression)) ) + os.stat( os.path.join(dir, orig_file) ) except OSError: return False return True diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py index 1c166a84..89ef414b 100755 --- a/gbp/scripts/buildpackage.py +++ b/gbp/scripts/buildpackage.py @@ -146,7 +146,7 @@ def prepare_upstream_tarball(repo, cp, options, tarball_dir, output_dir): else: gbp.log.info("Orig tarball '%s' found at '%s'" % (orig_file, tarball_dir)) # build an orig unless the user forbids it, always build (and overwrite pre-existing) if user forces it - if options.force_create or (not options.no_create_orig and not du.has_orig(cp, options.comp_type, output_dir)): + if options.force_create or (not options.no_create_orig and not du.has_orig(orig_file, output_dir)): if not pristine_tar_build_orig(repo, cp, output_dir, options): git_archive_build_orig(repo, cp, output_dir, options) @@ -381,7 +381,7 @@ def guess_comp_type(repo, comp_type, cp, tarball_dir): tarball_dir = '..' detected = None for comp in du.compressor_opts.keys(): - if du.has_orig(cp, comp, tarball_dir): + if du.has_orig(du.orig_file(cp, comp), tarball_dir): if detected is not None: raise GbpError, "Multiple orig tarballs found." detected = comp |