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 05-18-2008, 11:17 AM
Geoffroy Carrier
 
Default Refreshed PKGBUILDs

Excerpts from shiningxc's message of Sun May 18 11:42:33 +0200 2008:
> For some reasons, zsh doesn't seem to need any quoting.. Weird stuff.

No, this shell just has a great expansion.

--
Geoffroy Carrier
http://gcarrier.koon.fr/

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-18-2008, 02:20 PM
Miklos Vajna
 
Default Refreshed PKGBUILDs

On Sat, May 17, 2008 at 09:54:14PM +0200, Xavier <shiningxc@gmail.com> wrote:
> So maybe instead of :
> cd "$srcdir/$pkgname-$pkgver"
> we could use :
> cd ${srcdir}/$pkgname-$pkgver
> ?

that would be totally illogical. the point of using ${foo} instead of
$foo is that in some cases you really need ${foo}:

source=($pkgname_$pkgver) won't work, but source=(${pkgname}_$pkgver)
will. (just an example but probably you got the point). because of this,
some projects (like gentoo) force the usage of ${foo} everywhere.

this is not related to spaces, to deal with them, you always need
quotes.
_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-18-2008, 09:43 PM
"Aaron Griffin"
 
Default Refreshed PKGBUILDs

On Sun, May 18, 2008 at 9:20 AM, Miklos Vajna <vmiklos@frugalware.org> wrote:
> On Sat, May 17, 2008 at 09:54:14PM +0200, Xavier <shiningxc@gmail.com> wrote:
>> So maybe instead of :
>> cd "$srcdir/$pkgname-$pkgver"
>> we could use :
>> cd ${srcdir}/$pkgname-$pkgver
>> ?
>
> that would be totally illogical. the point of using ${foo} instead of
> $foo is that in some cases you really need ${foo}:
>
> source=($pkgname_$pkgver) won't work, but source=(${pkgname}_$pkgver)
> will. (just an example but probably you got the point). because of this,
> some projects (like gentoo) force the usage of ${foo} everywhere.

OT: I also enforce it in mkinitcpio scripts. It's not a bad idea, just
more typing.

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-18-2008, 11:33 PM
Geoffroy Carrier
 
Default Refreshed PKGBUILDs

Excerpts from Aaron Griffin's message of Sun May 18 23:43:42 +0200 2008:
> > that would be totally illogical. the point of using ${foo} instead of
> > $foo is that in some cases you really need ${foo}:
> >
> > source=($pkgname_$pkgver) won't work, but source=(${pkgname}_$pkgver)
> > will. (just an example but probably you got the point). because of this,
> > some projects (like gentoo) force the usage of ${foo} everywhere.
>
> OT: I also enforce it in mkinitcpio scripts. It's not a bad idea, just
> more typing.

I think it's useless. We could also forget about PATH and always use
/usr/bin/find... We could also ALWAYS use quotes.
Now, should we replace:
find . -type f
by:
"/usr/bin/find" "." "-type" "f"
or make light and readable scripts, using the ${} form when necessary?

I think those questions are about do fair things and not make any extreme
choice. That's what I think pragmatism is, and what I love in Archlinux.

Anyway, it's not my call.

--
Geoffroy Carrier
http://gcarrier.koon.fr/_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-19-2008, 12:08 AM
"Aaron Griffin"
 
Default Refreshed PKGBUILDs

On Sun, May 18, 2008 at 6:33 PM, Geoffroy Carrier
<geoffroy.carrier@koon.fr> wrote:
> Excerpts from Aaron Griffin's message of Sun May 18 23:43:42 +0200 2008:
>> > that would be totally illogical. the point of using ${foo} instead of
>> > $foo is that in some cases you really need ${foo}:
>> >
>> > source=($pkgname_$pkgver) won't work, but source=(${pkgname}_$pkgver)
>> > will. (just an example but probably you got the point). because of this,
>> > some projects (like gentoo) force the usage of ${foo} everywhere.
>>
>> OT: I also enforce it in mkinitcpio scripts. It's not a bad idea, just
>> more typing.
>
> I think it's useless. We could also forget about PATH and always use
> /usr/bin/find... We could also ALWAYS use quotes.
> Now, should we replace:
> find . -type f
> by:
> "/usr/bin/find" "." "-type" "f"
> or make light and readable scripts, using the ${} form when necessary?

Um, first off, you *should* use full paths. The rationale has nothing
to do with PATHs, but more to do with PATH ordering and things like
that.

If I'm calling /usr/bin/foobar and happen to have a totally unrelated
'foobar' in a path before /usr/bin, you're going to get stupid
results.

Additionally, the following will completely cripple non-full path binaries:
function grep () {
echo "lolfaild"
return 1
}

Whoops, now all those calls to "grep" are wrong. /bin/grep still works fine.

Secondly, quoting everything is just plain stupid. Quoting only needs
to be used on variable expansion (or, obviously, hardcoded paths with
spaces).

So the way your above line SHOULD be used:
/usr/bin/find . -type f

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-19-2008, 12:48 AM
Geoffroy Carrier
 
Default Refreshed PKGBUILDs

Excerpts from Aaron Griffin's message of Mon May 19 02:08:49 +0200 2008:
> Um, first off, you *should* use full paths. The rationale has nothing
> to do with PATHs, but more to do with PATH ordering and things like
> that.

Are you suggesting we replace every instance of make to use
/usr/bin/make?

In that case, I bet 99% of PKGBUILDs are just WRONG.
asust % grep -r make /var/abs|wc -l
10835
asust % grep -r /usr/bin/make /var/abs|wc -l
135

Of course, this is completely inaccurate. But I think I've proven my
point, even for ABS (let's forget about AUR).

> Secondly, quoting everything is just plain stupid. Quoting only needs
> to be used on variable expansion (or, obviously, hardcoded paths with
> spaces).
I totally agree. I would just exclude cases like $_cvsroot, as spaces are
pretty rare in this variable (and the PKGBUILD writer should notice a
strange case).

--
Geoffroy Carrier
http://gcarrier.koon.fr/

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-19-2008, 12:53 AM
"Aaron Griffin"
 
Default Refreshed PKGBUILDs

On Sun, May 18, 2008 at 7:48 PM, Geoffroy Carrier
<geoffroy.carrier@koon.fr> wrote:
> Excerpts from Aaron Griffin's message of Mon May 19 02:08:49 +0200 2008:
>> Um, first off, you *should* use full paths. The rationale has nothing
>> to do with PATHs, but more to do with PATH ordering and things like
>> that.
>
> Are you suggesting we replace every instance of make to use
> /usr/bin/make?
>
> In that case, I bet 99% of PKGBUILDs are just WRONG.
> asust % grep -r make /var/abs|wc -l
> 10835
> asust % grep -r /usr/bin/make /var/abs|wc -l
> 135
>
> Of course, this is completely inaccurate. But I think I've proven my
> point, even for ABS (let's forget about AUR).

No, I'm not talking about *doing* anything - I am talking about _the
right way_ to do something

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-19-2008, 01:06 AM
Geoffroy Carrier
 
Default Refreshed PKGBUILDs

Excerpts from Aaron Griffin's message of Mon May 19 02:53:39 +0200 2008:
> No, I'm not talking about *doing* anything - I am talking about _the
> right way_ to do something
So, maybe if everybody does this wrong and nobody complains about, we
should keep this aspect wrong in the PKGBUILD protoypes.

Do we agree on using $srcdir and $pkgdir instead of $startdir in all the
protos, as already done on the reference PKGBUILD.proto?
Quotes whenever those variables are involded as their absolute path is
likely to include spaces?

My ¢2.

--
Geoffroy Carrier
http://gcarrier.koon.fr/

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-19-2008, 01:11 AM
"Aaron Griffin"
 
Default Refreshed PKGBUILDs

On Sun, May 18, 2008 at 8:06 PM, Geoffroy Carrier
<geoffroy.carrier@koon.fr> wrote:
> Excerpts from Aaron Griffin's message of Mon May 19 02:53:39 +0200 2008:
>> No, I'm not talking about *doing* anything - I am talking about _the
>> right way_ to do something
> So, maybe if everybody does this wrong and nobody complains about, we
> should keep this aspect wrong in the PKGBUILD protoypes.

Um, I really think you took this the wrong way, If you look at my
original comment, it begins with "OT:". In typical inernet jargon,
this means "off topic". My point was an aside. I was not talking about
PKGBUILDs at all.

I was suggesting nothing - just discussing proper scripting practices.

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-19-2008, 04:25 AM
Geoffroy Carrier
 
Default Refreshed PKGBUILDs

Excerpts from louipc.ist's message of Mon May 19 07:39:45 +0200 2008:
> It would be nice if all three were referenced. I wouldn't feel right if
> $startdir disappeared.
In the .proto files?

--
Geoffroy Carrier
http://gcarrier.koon.fr/

_______________________________________________
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 05:02 AM.

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