[pacman-dev] [PATCH v2] Make VCS messages show the clone location

Neer Sighted neersighted at myopera.com
Fri Mar 8 15:31:04 EST 2013


This makes the location that VCS repositories are cloned too more obvious, and
helps make it more clear what is being cloned, as the last fragment of the URL
is not always the most accurate name of a repository.

Signed-off-by: Neer Sighted <neersighted at myopera.com>
---
 scripts/makepkg.sh.in | 46 ++++++++++++++++++++++++++--------------------
 1 file changed, 26 insertions(+), 20 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index bd29d73..5430d5f 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -464,10 +464,12 @@ download_git() {
 	url=${url##*git+}
 	url=${url%%#*}
 
+	local file=$(get_filename "$netfile")
+
 	if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then
-		msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "git"
+		msg2 "$(gettext "Cloning %s %s repo to %s...")" "${repo}" "git" "${file}"
 		if ! git clone --mirror "$url" "$dir"; then
-			error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git"
+			error "$(gettext "Failure while cloning %s %s repo (to %s")" "${repo}" "git" "${file}"
 			plain "$(gettext "Aborting...")"
 			exit 1
 		fi
@@ -475,23 +477,23 @@ download_git() {
 		cd_safe "$dir"
 		# Make sure we are fetching the right repo
 		if [[ "$url" != "$(git config --get remote.origin.url)"  ]] ; then
-			error "$(gettext "%s is not a clone of %s")" "$dir" "$url"
+			error "$(gettext "%s is not a clone of %s")" "${file}" "${url}"
 			plain "$(gettext "Aborting...")"
 			exit 1
 		fi
-		msg2 "$(gettext "Updating %s %s repo...")" "${repo}" "git"
+		msg2 "$(gettext "Updating %s %s repo at %s...")" "${repo}" "git" "${file}"
 		if ! git fetch --all -p; then
 			# only warn on failure to allow offline builds
-			warning "$(gettext "Failure while updating %s %s repo")" "${repo}" "git"
+			warning "$(gettext "Failure while updating %s %s repo (at %s")" "${repo}" "git" "${file}"
 		fi
 	fi
 
-	msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "git"
+	msg2 "$(gettext "Creating working copy of %s %s repo from %s...")" "${repo}" "git" "${file}"
 	pushd "$srcdir" &>/dev/null
 	rm -rf "${dir##*/}"
 
 	if ! git clone "$dir"; then
-		error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "git"
+		error "$(gettext "Failure while creating working copy of %s %s repo (from %s")" "${repo}" "git" "${file}"
 		plain "$(gettext "Aborting...")"
 		exit 1
 	fi
@@ -516,7 +518,7 @@ download_git() {
 
 	if [[ -n $ref ]]; then
 		if ! git checkout -b makepkg $ref; then
-			error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "git"
+			error "$(gettext "Failure while creating working copy of %s %s repo (from %s)")" "${repo}" "git" "${file}"
 			plain "$(gettext "Aborting...")"
 			exit 1
 		fi
@@ -543,23 +545,25 @@ download_hg() {
 	url=${url##*hg+}
 	url=${url%%#*}
 
+	local file=$(get_filename "$netfile")
+
 	if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then
-		msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "hg"
+		msg2 "$(gettext "Cloning %s %s repo to %s...")" "${repo}" "hg" "${file}"
 		if ! hg clone -U "$url" "$dir"; then
-			error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "hg"
+			error "$(gettext "Failure while downloading %s %s repo (to %s")" "${repo}" "hg" "${file}"
 			plain "$(gettext "Aborting...")"
 			exit 1
 		fi
 	elif (( ! HOLDVER )); then
-		msg2 "$(gettext "Updating %s %s repo...")" "${repo}" "hg"
+		msg2 "$(gettext "Updating %s %s repo at %s...")" "${repo}" "hg" "${file}"
 		cd_safe "$dir"
 		if ! hg pull; then
 			# only warn on failure to allow offline builds
-			warning "$(gettext "Failure while updating %s %s repo")" "${repo}" "hg"
+			warning "$(gettext "Failure while updating %s %s repo (at %s")" "${repo}" "hg" "${file}"
 		fi
 	fi
 
-	msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "hg"
+	msg2 "$(gettext "Creating working copy of %s %s repo from %s...")" "${repo}" "hg" "${file}"
 	pushd "$srcdir" &>/dev/null
 	rm -rf "${dir##*/}"
 
@@ -577,7 +581,7 @@ download_hg() {
 	fi
 
 	if ! hg clone "${ref[@]}" "$dir" "${dir##*/}"; then
-		error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "hg"
+		error "$(gettext "Failure while creating working copy of %s %s repo (from %s")" "${repo}" "hg" "${file}"
 		plain "$(gettext "Aborting...")"
 		exit 1
 	fi
@@ -605,23 +609,25 @@ download_svn() {
 	fi
 	url=${url%%#*}
 
+	local file=$(get_filename "$netfile")
+
 	if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then
-		msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "svn"
+		msg2 "$(gettext "Cloning %s %s repo to %s...")" "${repo}" "svn" "${file}"
 		if ! svn checkout --config-dir "$dir" "$url" "$dir"; then
-			error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "svn"
+			error "$(gettext "Failure while cloning %s %s repo (to %s")" "${repo}" "svn" "${file}"
 			plain "$(gettext "Aborting...")"
 			exit 1
 		fi
 	elif (( ! HOLDVER )); then
-		msg2 "$(gettext "Updating %s %s repo...")" "${repo}" "svn"
+		msg2 "$(gettext "Updating %s %s repo at %s...")" "${repo}" "svn" "${file}"
 		cd_safe "$dir"
 		if ! svn update; then
 			# only warn on failure to allow offline builds
-			warning "$(gettext "Failure while updating %s %s repo")" "${repo}" "svn"
+			warning "$(gettext "Failure while updating %s %s repo (at %s")" "${repo}" "svn" "${file}"
 		fi
 	fi
 
-	msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "svn"
+	msg2 "$(gettext "Creating working copy of %s %s repo from %s...")" "${repo}" "svn" "${file}"
 	pushd "$srcdir" &>/dev/null
 	rm -rf "${dir##*/}"
 
@@ -639,7 +645,7 @@ download_svn() {
 	fi
 
 	if ! svn export ${ref[@]} "$dir"; then
-		error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "svn"
+		error "$(gettext "Failure while creating working copy of %s %s repo (from %s")" "${repo}" "svn" "${file}"
 		plain "$(gettext "Aborting...")"
 	fi
 
-- 
1.8.1.5



More information about the pacman-dev mailing list