FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 08-13-2012, 07:27 AM
Gary van der Merwe
 
Default makepkg: Improvements to get_filename:

* For any vcs other that git, the fall through resulted in being handled by the
code for std url, hence fragments were being left on.
* Handle vcs urls than end in a slash correctly, eg http://example.com/project/
---
scripts/makepkg.sh.in | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 3460824..7284c12 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -236,12 +236,14 @@ get_filename() {
local proto=$(get_protocol "$netfile")

case $proto in
- git*|hg*|svn*|bzr*)
- filename=${netfile##*/}
- filename=${filename%%#*}
- # fall-through
- ;;&
+ hg*|svn*|bzr*)
+ filename=${netfile%%#*}
+ filename=${filename%/}
+ filename=${filename##*/}
+ ;;
git*)
+ filename=${netfile%%#*}
+ filename=${filename##*/}
filename=${filename%%.git*}
;;
*)
--
1.7.11.4
 
Old 08-13-2012, 07:57 AM
Allan McRae
 
Default makepkg: Improvements to get_filename:

On 13/08/12 17:27, Gary van der Merwe wrote:
> * For any vcs other that git, the fall through resulted in being handled by the
> code for std url, hence fragments were being left on.

I have tried... but I can not parse that sentence. Can you give an
example of what was wrong? The svn and hg urls I tried both removed the
fragment.

> * Handle vcs urls than end in a slash correctly, eg http://example.com/project/
> ---
> scripts/makepkg.sh.in | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 3460824..7284c12 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -236,12 +236,14 @@ get_filename() {
> local proto=$(get_protocol "$netfile")
>
> case $proto in
> - git*|hg*|svn*|bzr*)
> - filename=${netfile##*/}
> - filename=${filename%%#*}
> - # fall-through
> - ;;&
> + hg*|svn*|bzr*)
> + filename=${netfile%%#*}
> + filename=${filename%/}
> + filename=${filename##*/}
> + ;;
> git*)
> + filename=${netfile%%#*}
> + filename=${filename##*/}
> filename=${filename%%.git*}
> ;;
> *)
>
 
Old 08-13-2012, 08:42 PM
Gary van der Merwe
 
Default makepkg: Improvements to get_filename:

On 13/08/2012 09:57, Allan McRae wrote:

On 13/08/12 17:27, Gary van der Merwe wrote:

* For any vcs other that git, the fall through resulted in being handled by the
code for std url, hence fragments were being left on.


I have tried... but I can not parse that sentence. Can you give an
example of what was wrong?


I think you understood me correctly. Let me try again:


code for vcs url:

git*|hg*|svn*)
filename=${netfile##*/}
filename=${filename%%#*}
# fall-through
;;&

code for std url:

*)
# if it is just an URL, we only keep the last component
filename="${netfile##*/}"
;;

If proto is hg*|svn*|bzr*, then the code for vcs url runs, but so does
code for std url.


Hence the fragment is striped in the code for vcs url, but the code for
std url overwrites the value filename value, and the end result is the
fragment is left on.



The svn and hg urls I tried both removed the fragment.


My experience was different. To double check myself, I have since
created a minimal test case to check this. This is my test case and
results: http://dpaste.com/hold/785819/


Thanks,

Gary
 
Old 08-16-2012, 03:12 AM
Allan McRae
 
Default makepkg: Improvements to get_filename:

On 14/08/12 06:42, Gary van der Merwe wrote:
> On 13/08/2012 09:57, Allan McRae wrote:
>> On 13/08/12 17:27, Gary van der Merwe wrote:
>>> * For any vcs other that git, the fall through resulted in being
>>> handled by the
>>> code for std url, hence fragments were being left on.
>>
>> I have tried... but I can not parse that sentence. Can you give an
>> example of what was wrong?
>
> I think you understood me correctly. Let me try again:
>
>
> code for vcs url:
>
> git*|hg*|svn*)
> filename=${netfile##*/}
> filename=${filename%%#*}
> # fall-through
> ;;&
>
> code for std url:
>
> *)
> # if it is just an URL, we only keep the last component
> filename="${netfile##*/}"
> ;;
>
> If proto is hg*|svn*|bzr*, then the code for vcs url runs, but so does
> code for std url.
>
> Hence the fragment is striped in the code for vcs url, but the code for
> std url overwrites the value filename value, and the end result is the
> fragment is left on.
>
>> The svn and hg urls I tried both removed the fragment.
>
> My experience was different. To double check myself, I have since
> created a minimal test case to check this. This is my test case and
> results: http://dpaste.com/hold/785819/
>

Ah... crap!

My testcases all had the folder name specified before the url so I
completely missed that.

From here it appears that git URLs can end in a "/" too, so that will
need to be modified.

Can you resend the patch with that fixed based on current master (i.e.
before your bzr patch)?

Thanks,
Allan
 
Old 08-16-2012, 09:30 AM
Gary van der Merwe
 
Default makepkg: Improvements to get_filename:

* For any vcs other that git, the fall through resulted in being handled by the
code for std url, hence fragments were being left on.
* Handle vcs urls than end in a slash correctly, eg http://example.com/project/

Signed-off-by: Gary van der Merwe <garyvdm@gmail.com>
---
scripts/makepkg.sh.in | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index dd4066b..31dbef6 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -237,12 +237,12 @@ get_filename() {

case $proto in
git*|hg*|svn*)
- filename=${netfile##*/}
- filename=${filename%%#*}
- # fall-through
- ;;&
- git*)
- filename=${filename%%.git*}
+ filename=${netfile%%#*}
+ filename=${filename%/}
+ filename=${filename##*/}
+ if [[ $proto = git* ]]; then
+ filename=${filename%%.git*}
+ fi
;;
*)
# if it is just an URL, we only keep the last component
--
1.7.11.5
 

Thread Tools




All times are GMT. The time now is 07:58 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org