diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-11-01 18:24:25 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-11-01 18:25:00 +0100 |
commit | b310ffd1387e2fe4a1b87da95b9004fa670e686f (patch) | |
tree | c56cb63b610e9daea73d2bed6f4950a31bd9882c | |
parent | e28ea0740a7b4eb2ef4c1bd3079d77a40c6072b8 (diff) |
Use import_dsc as a module
No need to spawn an external command here.
-rw-r--r-- | gbp/scripts/import_dscs.py | 12 |
1 files 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): |