aboutsummaryrefslogtreecommitdiff
path: root/gbp/scripts/import_dsc.py
diff options
context:
space:
mode:
authorGuido G√ľnther <agx@sigxcpu.org>2016-07-04 20:03:26 +0200
committerGuido G√ľnther <agx@sigxcpu.org>2016-07-04 21:02:54 +0200
commitf545010462b9a313fe3bf160bca9e44c3ea77b55 (patch)
tree31c7f3a7d469b113c60b71d0f4d15bc459ea7c4c /gbp/scripts/import_dsc.py
parentf2ad919cb98b3e1b1a537e2a43ece88961006b29 (diff)
Give more instructions when config is unparseable
and make return codes and messages consistent. This allows us to move some test code from the component tests to the unit tests which is always nice. Closes: #733640
Diffstat (limited to 'gbp/scripts/import_dsc.py')
-rw-r--r--gbp/scripts/import_dsc.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/gbp/scripts/import_dsc.py b/gbp/scripts/import_dsc.py
index f7c8a97..78a30ee 100644
--- a/gbp/scripts/import_dsc.py
+++ b/gbp/scripts/import_dsc.py
@@ -16,7 +16,6 @@
# <http://www.gnu.org/licenses/>
"""Import a Debian source package into a Git repository"""
-from six.moves import configparser
import sys
import re
import os
@@ -35,8 +34,10 @@ from gbp.git.modifier import GitModifier
from gbp.config import (GbpOptionParserDebian, GbpOptionGroup,
no_upstream_branch_msg)
from gbp.errors import GbpError
+from gbp.scripts.common import ExitCodes
import gbp.log
+
class SkipImport(Exception):
pass
@@ -210,7 +211,7 @@ def build_parser(name):
try:
parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='',
usage='%prog [options] /path/to/package.dsc')
- except configparser.ParsingError as err:
+ except GbpError as err:
gbp.log.err(err)
return None
@@ -285,7 +286,7 @@ def main(argv):
options, args = parse_args(argv)
if not options:
- return 1
+ return ExitCodes.parse_error
try:
if len(args) != 1: