[pacman-dev] [PATCH] Make VCS download functions print correct filename

Neer Sighted neersighted at myopera.com
Fri Mar 8 14:50:39 EST 2013



On Fri, Mar 8, 2013, at 10:37 AM, William Giokas wrote:
> On Mon, Mar 04, 2013 at 10:33:57PM +1000, Allan McRae wrote:
> > On 28/02/13 13:37, Neer Sighted wrote:
> > > I've made the VCS download functions print the correct
> > > filename for their clone, as opposed to the last fragment
> > > in the url.
> > > ---
> > >  scripts/makepkg.sh.in | 10 +++-------
> > >  1 file changed, 3 insertions(+), 7 deletions(-)
> > > 
> > > diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> > > index bd29d73..0facb5e 100644
> > > --- a/scripts/makepkg.sh.in
> > > +++ b/scripts/makepkg.sh.in
> > > @@ -456,9 +456,7 @@ download_git() {
> > >  	local dir=$(get_filepath "$netfile")
> > >  	[[ -z "$dir" ]] && dir="$SRCDEST/$(get_filename "$netfile")"
> > >  
> > > -	local repo=${netfile##*/}
> > > -	repo=${repo%%#*}
> > > -	repo=${repo%%.git*}
> > > +	local repo=$(get_filename "$netfile")
> > 
> > 
> > source=("foobar::git+http://url.com/pacman.git")
> > 
> > Am I downloading the "pacman" repo or the "foobar" repo?
> > 
> > Comments?
> 
> I agree that this should be kept as the actual repo, but why not put
> something like 
> 
>     local file=$(get_filename "$netfile")
> 
> and then when it prints repo, instead print something like
> 
>     msg2 "$(gettext "Cloning %s %s repo to %s...")" "${repo}" "git"
>     "${file}"
> 
> I think that would solve both issues nicely. Only problem is that in the
> error messages, it could get a bit long. You could use $dir, and that
> may be a better solution, as that's already a variable, but that name
> would be significantly longer for most people.
> 
> It could be put onto two lines, though:
> 
>     error "$(gettext "Failure while creating working copy of %s %s
>     repo")" "${repo}" "git"
>     plain "$(gettext "at %s")" "${dir}"
>     plain "$(gettext "Aborting...")"
> 
> -- 
> William Giokas | KaiSforza
> GnuPG Key: 0x73CD09CF
> Fingerprint: F73F 50EF BBE2 9846 8306  E6B8 6902 06D8 73CD 09CF
> 
> Email had 1 attachment:
> + Attachment1.2
>   1k (application/pgp-signature)

I think that's a great idea!  I'll send an updated patch soon.


-- 
Neer Sighted
http://neersighted.com | neersighted at myopera.com {01DC2056}


More information about the pacman-dev mailing list