[pkg-perl-tools] 03/04: scripts/upstream-repo: refactor REPO to REPOURL

gregor herrmann gregoa at debian.org
Thu Jun 30 12:52:33 UTC 2016


This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to branch master
in repository pkg-perl-tools.

commit d129bbb5dfd0ed6a7daa437bbe5672bbe85a0746
Author: gregor herrmann <gregoa at debian.org>
Date:   Thu Jun 30 14:39:21 2016 +0200

    scripts/upstream-repo: refactor REPO to REPOURL
    
    Gbp-Dch: Ignore
---
 scripts/upstream-repo | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/scripts/upstream-repo b/scripts/upstream-repo
index 15ade8d..e5fb56a 100755
--- a/scripts/upstream-repo
+++ b/scripts/upstream-repo
@@ -15,23 +15,23 @@ warn() {
 }
 
 repofromcopyright() {
-	REPO=$(perl -MDebian::Copyright -E '$c = Debian::Copyright->new(); $c->read("debian/copyright"); say $c->header()->Source' | grep -oE "git(?:+ssh)?:.+$" || true)
+	REPOURL=$(perl -MDebian::Copyright -E '$c = Debian::Copyright->new(); $c->read("debian/copyright"); say $c->header()->Source' | grep -oE "git(?:+ssh)?:.+$" || true)
 }
 
 repofrommetadata() {
 	# XXX use something better than awk to parse this YAML file?
-	REPO=$(awk '/^Repository:\s*.+/ {print $2;}' debian/upstream/metadata || true)
+	REPOURL=$(awk '/^Repository:\s*.+/ {print $2;}' debian/upstream/metadata || true)
 }
 
 checkrepourl() {
-	if ! GIT_ASKPASS=/bin/true git ls-remote "$REPO" >/dev/null 2>&1; then
-		REPO=
+	if ! GIT_ASKPASS=/bin/true git ls-remote "$REPOURL" >/dev/null 2>&1; then
+		REPOURL=
 	fi
 }
 
 CREATE=1
 UPDATE=0
-REPO=
+REPOURL=
 
 # command line arguments
 # -g don't create debian/upstream/metadata
@@ -65,7 +65,7 @@ if ! git remote show | grep -qx upstream-repo ; then
 	repofromcopyright
 
 	# case 2: Repository in d/upstream/metadata
-	if [ -z "$REPO" -a ! -e debian/upstream/metadata -a "$CREATE" -eq "1" ] ; then
+	if [ -z "$REPOURL" -a ! -e debian/upstream/metadata -a "$CREATE" -eq "1" ] ; then
 		warn "No 'debian/upstream/metadata' file found, trying to create it ..."
 		dpt debian-upstream || true
 		git add debian/upstream/metadata
@@ -74,15 +74,15 @@ if ! git remote show | grep -qx upstream-repo ; then
 		git add debian/changelog
 		git commit -m "Update debian/changelog" -m "Gbp-Dch: Ignore"
 	fi
-	if [ -z "$REPO" -a -e debian/upstream/metadata ] ; then
+	if [ -z "$REPOURL" -a -e debian/upstream/metadata ] ; then
 		repofrommetadata
 	fi
 
-	if [ -n "$REPO" ] ; then
+	if [ -n "$REPOURL" ] ; then
 		checkrepourl
-		if [ -n "$REPO" ] ; then
-			warn "Adding Git remote 'upstream-repo' with URL '$REPO' ..."
-			git remote add upstream-repo "$REPO"
+		if [ -n "$REPOURL" ] ; then
+			warn "Adding Git remote 'upstream-repo' with URL '$REPOURL' ..."
+			git remote add upstream-repo "$REPOURL"
 			git fetch upstream-repo
 		fi
 	else
@@ -92,14 +92,14 @@ else
 	warn "Found Git remote 'upstream-repo':"
 	git remote --verbose show upstream-repo || true
 	if [ "$UPDATE" -eq "1" ] ; then
-		OLDREPO=$(git remote get-url upstream-repo)
+		OLDREPOURL=$(git remote get-url upstream-repo)
 		repofromcopyright
-		[ -n "$REPO" ] || repofrommetadata
-		if [ -n "$REPO" -a "$OLDREPO" != "$REPO" ] ; then
+		[ -n "$REPOURL" ] || repofrommetadata
+		if [ -n "$REPOURL" -a "$OLDREPOURL" != "$REPOURL" ] ; then
 			checkrepourl
-			if [ -n "$REPO" ] ; then
-				git remote set-url upstream-repo "$REPO"
-				warn "Updating Git remote 'upstream-repo' to use URL '$REPO' ..."
+			if [ -n "$REPOURL" ] ; then
+				git remote set-url upstream-repo "$REPOURL"
+				warn "Updating Git remote 'upstream-repo' to use URL '$REPOURL' ..."
 				git remote --verbose show upstream-repo
 			fi
 		fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/pkg-perl-tools.git



More information about the Pkg-perl-cvs-commits mailing list