summaryrefslogtreecommitdiff
path: root/git-import-orig
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2006-12-05 19:34:22 +0100
committerGuido Guenther <agx@bogon.sigxcpu.org>2006-12-05 19:34:22 +0100
commiteab964d1fe31b91a9beca6014e61cdf36c96d11e (patch)
treea2050d58caf2d2ec4652b3d8bea1cc6dc0f53806 /git-import-orig
parent64acc5b038f9011dfa8afd74b633c12689a06945 (diff)
downloadgit-buildpackage-eab964d1fe31b91a9beca6014e61cdf36c96d11e.tar.gz
git-buildpackage-eab964d1fe31b91a9beca6014e61cdf36c96d11e.tar.bz2
git-buildpackage-eab964d1fe31b91a9beca6014e61cdf36c96d11e.zip
config file parsing to set default branches and build commands
Diffstat (limited to 'git-import-orig')
-rwxr-xr-xgit-import-orig19
1 files changed, 10 insertions, 9 deletions
diff --git a/git-import-orig b/git-import-orig
index c7f6a8d2..e28d17d9 100755
--- a/git-import-orig
+++ b/git-import-orig
@@ -23,9 +23,9 @@ import os
import tempfile
import re
import glob
-from optparse import OptionParser
from git_buildpackage import *
from git_buildpackage.git_utils import *
+from git_buildpackage.config import GBPOptionParser
def cleanupTmpTree(tree):
@@ -49,20 +49,21 @@ def get_version(tgz):
if m:
return m.group('version')
-def main():
- parser = OptionParser('%prog [-u version] /path/to/upstream-version.tar.gz')
+def main(argv):
+ parser=GBPOptionParser(command=os.path.basename(argv[0]), prefix='',
+ usage='%prog [-u version] /path/to/upstream-version.tar.gz')
parser.add_option("-u", "--upstreamversion", dest="version",
help="Upstream Version")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
- parser.add_option("--upstream-branch", dest="upstream", default='upstream',
- help="name of the upstream branch, default is 'upstream'")
- parser.add_option("--debian-branch", dest='debian', default='master',
- help="name of the branch the debian package is being developed on, default is 'master'")
parser.add_option("--no-merge", dest='merge', action="store_false", default=True,
help="after import dont do any merging to another branch")
- (options, args) = parser.parse_args()
+ parser.add_config_file_option(option_name="debian-branch", dest='debian',
+ help="branch the debian patch is being developed on, default is '%(debian-branch)s'")
+ parser.add_config_file_option(option_name="upstream-branch", dest="upstream",
+ help="upstream branch, default is '%(upstream-branch)s'")
+ (options, args) = parser.parse_args(argv[1:])
gitCheckoutUpstream=GitCheckoutBranch(options.upstream)
gitCheckoutMaster=GitCheckoutBranch(options.debian)
@@ -129,6 +130,6 @@ def main():
return 0
if __name__ == "__main__":
- sys.exit(main())
+ sys.exit(main(sys.argv))
# vim:et:ts=4:sw=4: