From b310ffd1387e2fe4a1b87da95b9004fa670e686f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Guido=20G=C3=BCnther?= Date: Tue, 1 Nov 2011 18:24:25 +0100 Subject: [PATCH] Use import_dsc as a module No need to spawn an external command here. --- gbp/scripts/import_dscs.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/gbp/scripts/import_dscs.py b/gbp/scripts/import_dscs.py index fc39ce4..aecab29 100644 --- a/gbp/scripts/import_dscs.py +++ b/gbp/scripts/import_dscs.py @@ -24,6 +24,7 @@ import gbp.command_wrappers as gbpc from gbp.deb import parse_dsc, DscFile, DpkgCompareVersions from gbp.errors import GbpError from gbp.git import GitRepository, GitRepositoryError +from gbp.scripts import import_dsc import gbp.log class DscCompareVersions(DpkgCompareVersions): @@ -34,17 +35,12 @@ class DscCompareVersions(DpkgCompareVersions): return DpkgCompareVersions.__call__(self, dsc1.version, dsc2.version) -class GitImportDsc(gbpc.Command): - # git-import-dsc should reside in the same directory as git-import-dscs - # so we can reuse the full path from the later - cmd = os.path.abspath(__file__[:-1]) +class GitImportDsc(object): def __init__(self, args): - if not os.access(self.cmd, os.X_OK): - raise GbpError, "%s not found - can't import packages" % self.cmd - gbpc.Command.__init__(self, self.cmd, args) + self.args = args def importdsc(self, dsc): - gbpc.Command.__call__(self, [dsc.dscfile]) + import_dsc.main(['git-import-dsc'] + self.args + [dsc.dscfile]) def fetch_snapshots(pkg, downloaddir): -- 2.7.4