diff options
Diffstat (limited to 'gbp/scripts/import_orig.py')
-rw-r--r-- | gbp/scripts/import_orig.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py index 542896ef..6256431c 100644 --- a/gbp/scripts/import_orig.py +++ b/gbp/scripts/import_orig.py @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -"""Import a new upstream version into a git repository""" +"""Import a new upstream version into a GIT repository""" import ConfigParser import os @@ -23,13 +23,15 @@ import sys import tempfile import gbp.command_wrappers as gbpc from gbp.deb import (DebianPkgPolicy, parse_changelog_repo) +from gbp.deb.upstreamsource import DebianUpstreamSource from gbp.deb.uscan import (Uscan, UscanError) from gbp.deb.changelog import ChangeLog, NoChangeLogError from gbp.deb.git import (GitRepositoryError, DebianGitRepository) from gbp.config import GbpOptionParserDebian, GbpOptionGroup, no_upstream_branch_msg from gbp.errors import GbpError +from gbp.format import format_msg import gbp.log -from gbp.scripts.common.import_orig import (OrigUpstreamSource, cleanup_tmp_tree, +from gbp.scripts.common.import_orig import (orig_needs_repack, cleanup_tmp_tree, ask_package_name, ask_package_version, repack_source, is_link_target) @@ -80,7 +82,7 @@ def upstream_import_commit_msg(options, version): def detect_name_and_version(repo, source, options): # Guess defaults for the package name and version from the # original tarball. - (guessed_package, guessed_version) = source.guess_version() or ('', '') + guessed_package, guessed_version = source.guess_version() # Try to find the source package name try: @@ -167,7 +169,7 @@ def find_source(use_uscan, args): elif len(args) == 0: raise GbpError("No archive to import specified. Try --help.") else: - archive = OrigUpstreamSource(args[0]) + archive = DebianUpstreamSource(args[0]) return archive @@ -300,7 +302,7 @@ def main(argv): source.unpack(tmpdir, options.filters) gbp.log.debug("Unpacked '%s' to '%s'" % (source.path, source.unpacked)) - if source.needs_repack(options): + if orig_needs_repack(source, options): gbp.log.debug("Filter pristine-tar: repacking '%s' from '%s'" % (source.path, source.unpacked)) (source, tmpdir) = repack_source(source, sourcepackage, version, tmpdir, options.filters) @@ -372,7 +374,7 @@ def main(argv): epoch = '%s:' % cp.epoch info = { 'version': "%s%s-1" % (epoch, version) } env = { 'GBP_BRANCH': options.debian_branch } - gbpc.Command(options.postimport % info, extra_env=env, shell=True)() + gbpc.Command(format_msg(options.postimport, info), extra_env=env, shell=True)() # Update working copy and index if we've possibly updated the # checked out branch current_branch = repo.get_branch() |