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

William Giokas 1007380 at gmail.com
Fri Mar 8 16:02:53 EST 2013


On Fri, Mar 08, 2013 at 12:31:04PM -0800, Neer Sighted wrote:
> 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}"

I think this should be kept as $dir. I'd like to know the full directory
path, not just the filename.

>  			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}"

While $dir may be a bit long, I think if you're going to do "at <blah>"
it should be a full path, not just the directory name. You may have to
put some '\n's in or us 'plain' to make sure things aren't /too/ long.

>  		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}"

Get rid of the () here. They're just unneeded, same for the other three
failure messages. Also, use $dir for these. TBH, I now don't think that
$file is going to be very useful for this...

>  		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

-- 
William Giokas | KaiSforza
GnuPG Key: 0x73CD09CF
Fingerprint: F73F 50EF BBE2 9846 8306  E6B8 6902 06D8 73CD 09CF
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/pacman-dev/attachments/20130308/030f9946/attachment.asc>


More information about the pacman-dev mailing list