summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2006-09-27 12:01:00 +0200
committerGuido Guenther <agx@bogon.sigxcpu.org>2006-09-27 12:01:00 +0200
commitaadce8574d2be33ea48570a16f3b44600c4a4c49 (patch)
treef3f946baa05cdfa55a95d67e5d958f44332c452c
parentbd9dc5d64f2eeb38bacd11d4fc35d841ae9a51e5 (diff)
git-import-orig: don't try import new upstream versions when there are uncommitted changes
-rw-r--r--debian/changelog8
-rw-r--r--debian/control6
-rwxr-xr-xgit-buildpackage12
-rwxr-xr-xgit-import-orig8
-rw-r--r--setup.py2
5 files changed, 25 insertions, 11 deletions
diff --git a/debian/changelog b/debian/changelog
index 5149bcb4..dde4c5f9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+git-buildpackage (0.2.1) git-buildpackage; urgency=low
+
+ * UNRELEASED
+ * git-import-orig: don't try import new upstream versions when there
+ are uncommitted changes
+
+ -- Guido Guenther <agx@sigxcpu.org> Wed, 27 Sep 2006 12:00:03 +0200
+
git-buildpackage (0.2) git-buildpackage; urgency=low
* git-import-dsc: import of debian native packages
diff --git a/debian/control b/debian/control
index 3f292e01..8acedec9 100644
--- a/debian/control
+++ b/debian/control
@@ -8,10 +8,10 @@ Standards-Version: 3.7.2
Package: git-buildpackage
Architecture: all
Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, devscripts, git-load-dirs
-Description: bunch of scripts to ease the development of Debian packages with git
+Description: Suite to help with Debian packages in Git repositories
This package contains the following tools:
* git-import-dsc: import an existing Debian source package into a git
- repository
+ repository
* git-import-orig: import a new upstream version into the git repository
- * git-debuild: build a package out of a git repository, check for local
+ * git-buildpackage: build a package out of a git repository, check for local
modifications and tag appropriately
diff --git a/git-buildpackage b/git-buildpackage
index ba1daaea..c6abe999 100755
--- a/git-buildpackage
+++ b/git-buildpackage
@@ -19,6 +19,7 @@
import sys,os,commands,re
import optparse
+from git_buildpackage.utils import is_repository_clean
build_cmd='debuild'
@@ -55,12 +56,11 @@ def main(argv):
clean_cmd='%s clean' % options.build_cmd
if not options.ignore_new:
if not exec_command(clean_cmd)[0]: return 1
- (status, out) = commands.getstatusoutput('git status')
- msgs=out.split('\n')
- if msgs[0] != 'nothing to commit':
- print "You have uncommitted changes in your source tree:"
- print out
- print "Use --git-ignore_new to override"
+ (ret, out) = is_repository_clean('.')
+ if not ret:
+ print >>sys.stderr, "You have uncommitted changes in your source tree:"
+ print >>sys.stderr, out
+ print >>sys.stderr, "Use --git-ignore_new to ignore."
return 1
cmd=options.build_cmd+' -i.git '+" ".join(dpkg_args)
if not exec_command(cmd)[0]: return 1
diff --git a/git-import-orig b/git-import-orig
index 44319c5e..642f9b72 100755
--- a/git-import-orig
+++ b/git-import-orig
@@ -24,7 +24,7 @@ import re
import glob
from optparse import OptionParser
from git_buildpackage import *
-
+from git_buildpackage.utils import is_repository_clean
# Used GIT Commands
gitCheckoutUpstream=GitCheckoutBranch('upstream')
@@ -88,6 +88,12 @@ def main():
parser.print_help()
return 1
+ (ret, out) = is_repository_clean('.')
+ if not ret:
+ print >>sys.stderr, "Repository has uncommitted changes, commit them first: "
+ print >>sys.stderr, out
+ return 1
+
tmpdir=unpackOrig(tgz)
if not tmpdir:
return 1
diff --git a/setup.py b/setup.py
index b4987ae8..f40115ca 100644
--- a/setup.py
+++ b/setup.py
@@ -22,6 +22,6 @@ setup(name = "git_build_package",
author = 'Guido Guenther',
author_email = 'agx@sigxcpu.org',
scripts = [ 'git-buildpackage', 'git-import-dsc', 'git-import-orig'],
- py_modules = [ 'git_buildpackage' ]
+ packages = [ 'git_buildpackage' ]
)