aboutsummaryrefslogtreecommitdiff
path: root/git-import-dsc
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2006-09-29 19:09:33 +0200
committerGuido Guenther <agx@bogon.sigxcpu.org>2006-09-29 19:09:33 +0200
commit8b155f5eade2ee4cdfd01f786ddb95b5db2ba70d (patch)
treee0457e2d8815fbca9224c3c565fe00a487b110bc /git-import-dsc
parentc6074bbc5c47d87d249f5cedfce4a623a1e43157 (diff)
git-import-dsc: don't fail if the dsc is a plain filename without a directory componentdebian/0.2.2
git-import-{orig,dsc}: allow to set the name of the upstream branch
Diffstat (limited to 'git-import-dsc')
-rwxr-xr-xgit-import-dsc15
1 files changed, 10 insertions, 5 deletions
diff --git a/git-import-dsc b/git-import-dsc
index abc10cc8..b32420e0 100755
--- a/git-import-dsc
+++ b/git-import-dsc
@@ -51,16 +51,19 @@ class DscPackage(object):
continue
m=self.pkgre.match(line)
if m:
- self.pkg= m.group('pkg')
+ self.pkg = m.group('pkg')
continue
m=self.tarre.match(line)
if m:
- self.tgz= os.path.dirname(dscfile)+'/'+m.group('tar')
+ dir=os.path.dirname(dscfile)
+ if len(dir):
+ dir+='/'
+ self.tgz = dir+m.group('tar')
continue
f.close()
-def import_upstream(src, dirs):
+def import_upstream(src, dirs, upstream_branch):
try:
unpackTGZ=UnpackTGZ(src.tgz, dirs['tmp'])
unpackTGZ()
@@ -77,7 +80,7 @@ def import_upstream(src, dirs):
gitCommitAll(msg="Imported upstream version %s" % (src.upstream_version,))
gitTag(src.upstream_version)
if not src.native:
- GitBranch()('upstream')
+ GitBranch()(upstream_branch)
except CommandExecFailed:
print >>sys.stderr,"Creation of git repository failed"
RemoveTree(unpackTGZ.dir)()
@@ -114,6 +117,8 @@ def main(argv):
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
+ parser.add_option("--upstream-branch", dest="upstream_branch", default='upstream',
+ help="name of the upstream branch, default is 'upstream'")
(options, args) = parser.parse_args()
if options.verbose:
@@ -125,7 +130,7 @@ def main(argv):
src=DscPackage(args[0])
dirs['tmp']=os.path.abspath(tempfile.mkdtemp(dir='.'))
- if import_upstream(src, dirs):
+ if import_upstream(src, dirs, options.upstream_branch):
return 1
os.chdir(dirs['top'])
if not src.native: