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


 
 
LinkBack Thread Tools
 
Old 06-12-2008, 03:30 PM
"Aaron Griffin"
 
Default repo-add error in BSD

On Thu, Jun 12, 2008 at 10:13 AM, Dan McGee <dpmcgee@gmail.com> wrote:
> On Thu, Jun 12, 2008 at 10:03 AM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
>> On Thu, Jun 12, 2008 at 3:58 AM, Xavier <shiningxc@gmail.com> wrote:
>>> On Thu, Jun 12, 2008 at 10:47 AM, Antonio Huete Jimenez
>>> <ahuete.devel@gmail.com> wrote:
>>>> In repo-add/repo-remove, readlink is used to calculate the full path of
>>>> a file (canonicalize with option -f). But in BSD there's no such option
>>>> in readlink, so you have to use realpath instead
>>>>
>>>
>>> Sorry, I didn't realize my question was that obscure, let me rephrase it :
>>> Why the hell do we need to calculate the full path of these files?
>>>
>>> If I ask that question, it is because I am personally not able to
>>> answer it myself after looking at this repo-add script.
>>> If someone can explain why this is necessary, then we will have to use
>>> your readlink/realpath patch.
>>> If no one can, then it is probably useless so we can remove readlink
>>> usage altogether and solve this portability problem in a much simpler
>>> way.
>>
>> Without looking at the script, I imagine it has to do with calculating
>> the path used in %FILENAME% in the db entries. it *does* support full
>> paths:
>> %FILENAME%
>> foo/bar/somepkg-1.0.pkg.tar.gz
>
> That doesn't even use the result of readlink, haha:
> local pkgfile=$(readlink -f "$1")
> .....
> echo -e "%FILENAME%
$(basename "$1")
" >>desc
>
> So FILENAME doesn't support any full paths- this has come up on the
> list before. I really see little need for this readlink usage, but
> Aaron, you did include it originally. If you get a chance to look
> closer, let us know what you think it may have been for.

Well if it's not done that way then it's possible I intended to do it
that way and just forgot. The only time I used readlink in scripts is
when I need to create a relative path from a to b (or, when I need an
absolute path).

So, the options are either:
a) keep readlink there and allow full paths
b) remove it entirely

I kinda like the idea of using full paths, but it's not a huge deal

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 06-15-2008, 11:34 AM
Xavier
 
Default repo-add error in BSD

Aaron Griffin wrote:
>
> Well if it's not done that way then it's possible I intended to do it
> that way and just forgot. The only time I used readlink in scripts is
> when I need to create a relative path from a to b (or, when I need an
> absolute path).
>

Finally, it looks like we need absolute path because we change the
directory. So after changing directory, the eventual relative paths
would no longer be valid.
I still don't know if it is possible to handle this situation without
using readlink -f.

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 06-17-2008, 08:47 AM
Xavier
 
Default repo-add error in BSD

On Sun, Jun 15, 2008 at 1:34 PM, Xavier <shiningxc@gmail.com> wrote:
>
> Finally, it looks like we need absolute path because we change the
> directory. So after changing directory, the eventual relative paths would no
> longer be valid.
> I still don't know if it is possible to handle this situation without using
> readlink -f.
>

Every alternatives I could think of would be much uglier, so forget it.
That patch using both realpath and readlink seems to be the cleanest way.

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 07-01-2008, 08:15 AM
Antonio Huete Jimenez
 
Default repo-add error in BSD

>
> Every alternatives I could think of would be much uglier, so forget it.
> That patch using both realpath and readlink seems to be the cleanest way.
>
> _______________________________________________
> pacman-dev mailing list
> pacman-dev@archlinux.org
> http://archlinux.org/mailman/listinfo/pacman-dev
>

Sorry, I've been out for a while. It's nice to see that the patch is
already commited :-)

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 01:43 PM.

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