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-17-2008, 01:45 PM
Geoffroy Carrier
 
Default Refreshed PKGBUILDs

Hi!

See patches as attachments. Globally cosmetic changes.

Assumptions:
- $startdir should be used as $srcdir and $pkgdir parent, as it could
be useful, for example, to have $pkgdir in a
tmpfs
=> Removed any reference to "$startdir/pkg" or "$startdir/src"
=> Relative paths to switch between $srcdir and $pkgdir should be
avoided. E.g.:
cd $srcdir/A
patch [...] < ../../pkg/
is non-sense
- $pkgdir and $srcdir could contain namespaces, etc. and we shouldn't
try to guess about $IFS
=> "$srcdir/A" instead of $srcdir/A (use of "")
- Still, lightweight means smater
=> Don't use
"$_svntrunk" ${something}
instead of
$_svntrunk $something
- "folder" is prefered to "folder/" in our scripts, but we should not
suppose a makefile doesn't use something like
"${DESTDIR}usr/bin"
=> DESTDIR="$pkgdir/", "$pkgdir" otherwise

Have a nice day

--
Geoffroy Carrier
http://gcarrier.koon.fr/
_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-17-2008, 02:40 PM
Allan McRae
 
Default Refreshed PKGBUILDs

Geoffroy Carrier wrote:
> Hi!
>
> See patches as attachments. Globally cosmetic changes.
>
>

It is much better to put patches inline so we can comment on them directly.


> Assumptions:
> - $startdir should be used as $srcdir and $pkgdir parent, as it could
> be useful, for example, to have $pkgdir in a
> tmpfs
> => Removed any reference to "$startdir/pkg" or "$startdir/src"
> => Relative paths to switch between $srcdir and $pkgdir should be
> avoided. E.g.:
> cd $srcdir/A
> patch [...] < ../../pkg/
> is non-sense
>

I must be missing something here... where exactly are you changing
$srcdir or $pkgdir not to point at $startdir/src and $startdir/pkg? You
can have these directories as tmpfs if you really want but how does that
need this change? I also like the use of $startdir/* because it is
quite obvious what the startdir is.


> - $pkgdir and $srcdir could contain namespaces, etc. and we shouldn't
> try to guess about $IFS
> => "$srcdir/A" instead of $srcdir/A (use of "")
>

Quoting paths with variable names seems a good idea.

> - Still, lightweight means smater
> => Don't use
> "$_svntrunk" ${something}
> instead of
> $_svntrunk $something
>

Where exactly is this change?

> - "folder" is prefered to "folder/" in our scripts, but we should not
> suppose a makefile doesn't use something like
> "${DESTDIR}usr/bin"
> => DESTDIR="$pkgdir/", "$pkgdir" otherwise
>
>

It would be a poorly formed makefile if it did this, but I have struck
this once problem before. It is also readily noticeable when building
the package so I'm not sure if this is really needed.

Allan



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

Excerpts from Allan McRae's message of Sat May 17 16:40:41 +0200 2008:
> It is much better to put patches inline so we can comment on them directly.
Noticed.
I'll have to read my mailer's doc deeper.

> I must be missing something here... where exactly are you changing
> $srcdir or $pkgdir not to point at $startdir/src and $startdir/pkg? You
> can have these directories as tmpfs if you really want but how does that
> need this change? I also like the use of $startdir/* because it is
> quite obvious what the startdir is.
I don't. The whole list I wrote in this mail are rules I think should be
followed. Not using $srcdir anymore would permit such changes in the
future.

> Quoting paths with variable names seems a good idea.
Thank you. Except for variables like cvs/svn/etc. paths which are not
likely to include any spaces or horrible chars. URLs in general are.

> > - Still, lightweight means smater
> > => Don't use
> > "$_svntrunk" ${something}
> > instead of
> > $_svntrunk $something
> >
> Where exactly is this change?
This was an example of the rule I wanted to follow... ie. i did not
introduced quotes of $_svntrunk which obviously won't include spaces.
(or it's REAAALLY dumb).

> It would be a poorly formed makefile if it did this, but I have struck
> this once problem before. It is also readily noticeable when building
> the package so I'm not sure if this is really needed.
So did I. I think new packagers which are discovering makepkg are more
likely to think it's a makepkg problem instead of a wrong Makefile, and
might not even think about adding the trailing slash.
Anyway, It's not something important IMHO. IMHO getting rid of $startdir is.

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

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-17-2008, 06:43 PM
Xavier
 
Default Refreshed PKGBUILDs

Geoffroy Carrier wrote:
> Excerpts from Allan McRae's message of Sat May 17 16:40:41 +0200 2008:
>> It is much better to put patches inline so we can comment on them directly.
> Noticed.
> I'll have to read my mailer's doc deeper.
>
>> I must be missing something here... where exactly are you changing
>> $srcdir or $pkgdir not to point at $startdir/src and $startdir/pkg? You
>> can have these directories as tmpfs if you really want but how does that
>> need this change? I also like the use of $startdir/* because it is
>> quite obvious what the startdir is.
> I don't. The whole list I wrote in this mail are rules I think should be
> followed. Not using $srcdir anymore would permit such changes in the
> future.
>

You meant $startdir here right?

I personally like using $srcdir and $pkgdir, mostly because it is
shorter and I find it nicer too. And it indeed seems to allow more
flexibility. Also the names are quite explicit so it shouldn't be too
confusing.
But well, just using these in the prototypes won't convert all existing
PKGBUILDs. Maybe 1% of the new ones who will be based on these proto..

In any cases, this change was already made in PKGBUILD.proto so it makes
sense to do it in the other protos in abs package.

>> Quoting paths with variable names seems a good idea.
> Thank you. Except for variables like cvs/svn/etc. paths which are not
> likely to include any spaces or horrible chars. URLs in general are.
>
>>> - Still, lightweight means smater
>>> => Don't use
>>> "$_svntrunk" ${something}
>>> instead of
>>> $_svntrunk $something
>>>
>> Where exactly is this change?
> This was an example of the rule I wanted to follow... ie. i did not
> introduced quotes of $_svntrunk which obviously won't include spaces.
> (or it's REAAALLY dumb).
>
>> It would be a poorly formed makefile if it did this, but I have struck
>> this once problem before. It is also readily noticeable when building
>> the package so I'm not sure if this is really needed.
> So did I. I think new packagers which are discovering makepkg are more
> likely to think it's a makepkg problem instead of a wrong Makefile, and
> might not even think about adding the trailing slash.

Well as I said above, I am not so sure how strong the influence of the
protos is, so what we are discussing here doesn't really matter.
That said, breaking a poorly made makefile is a pretty good feature imo
There are more chances the makefile will be really fixed that way, if
the packager bothered to report it upstream (which he totally should
do). And the workaround is easy to make in the few PKGBUILDs who have
this problem by adding the trailing /
But I would prefer keeping DESTDIR="$pkgdir" in the protos.

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-17-2008, 07:34 PM
"Aaron Griffin"
 
Default Refreshed PKGBUILDs

On Sat, May 17, 2008 at 10:28 AM, Geoffroy Carrier
<geoffroy.carrier@koon.fr> wrote:
>> > - Still, lightweight means smater
>> > => Don't use
>> > "$_svntrunk" ${something}
>> > instead of
>> > $_svntrunk $something
>> >
>> Where exactly is this change?
> This was an example of the rule I wanted to follow... ie. i did not
> introduced quotes of $_svntrunk which obviously won't include spaces.
> (or it's REAAALLY dumb).

Just to be a tad more technical. I always try to use the ${} syntax
when I can. It IS more to type, but prevents errors much more and is a
good habit to follow. It's a minor thing, but I prefer that syntax. I
don't think we should really enforce it either way

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-17-2008, 07:42 PM
"Roman Kyrylych"
 
Default Refreshed PKGBUILDs

2008/5/17 Xavier <shiningxc@gmail.com>:
> I personally like using $srcdir and $pkgdir, mostly because it is
> shorter and I find it nicer too. And it indeed seems to allow more
> flexibility. Also the names are quite explicit so it shouldn't be too
> confusing.
> But well, just using these in the prototypes won't convert all existing
> PKGBUILDs. Maybe 1% of the new ones who will be based on these proto..
>
> In any cases, this change was already made in PKGBUILD.proto so it makes
> sense to do it in the other protos in abs package.

I agree.
$srcdir/$startdir look more nice to me.

--
Roman Kyrylych (*оман Кирилич)
_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-17-2008, 07:43 PM
"Roman Kyrylych"
 
Default Refreshed PKGBUILDs

2008/5/17 Roman Kyrylych <roman.kyrylych@gmail.com>:
> 2008/5/17 Xavier <shiningxc@gmail.com>:
>> I personally like using $srcdir and $pkgdir, mostly because it is
>> shorter and I find it nicer too. And it indeed seems to allow more
>> flexibility. Also the names are quite explicit so it shouldn't be too
>> confusing.
>> But well, just using these in the prototypes won't convert all existing
>> PKGBUILDs. Maybe 1% of the new ones who will be based on these proto..
>>
>> In any cases, this change was already made in PKGBUILD.proto so it makes
>> sense to do it in the other protos in abs package.
>
> I agree.
> $srcdir/$startdir look more nice to me.

damn, I meant $srcdir/$pkgdir of course.

--
Roman Kyrylych (*оман Кирилич)
_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-17-2008, 07:54 PM
Xavier
 
Default Refreshed PKGBUILDs

Aaron Griffin wrote:
> On Sat, May 17, 2008 at 10:28 AM, Geoffroy Carrier
> <geoffroy.carrier@koon.fr> wrote:
>>>> - Still, lightweight means smater
>>>> => Don't use
>>>> "$_svntrunk" ${something}
>>>> instead of
>>>> $_svntrunk $something
>>>>
>>> Where exactly is this change?
>> This was an example of the rule I wanted to follow... ie. i did not
>> introduced quotes of $_svntrunk which obviously won't include spaces.
>> (or it's REAAALLY dumb).
>
> Just to be a tad more technical. I always try to use the ${} syntax
> when I can. It IS more to type, but prevents errors much more and is a
> good habit to follow. It's a minor thing, but I prefer that syntax. I
> don't think we should really enforce it either way
>

That's interesting. We don't really enforce anything with the prototypes
but it's good to show the preferred syntax with them.

I think $pkgname and $pkgver should be safe though, right? They
shouldn't contain spaces or other weird things so don't require
additional quotings. But pkgdir, srcdir and startdir do.

So maybe instead of :
cd "$srcdir/$pkgname-$pkgver"
we could use :
cd ${srcdir}/$pkgname-$pkgver
?

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-17-2008, 08:22 PM
"Travis Willard"
 
Default Refreshed PKGBUILDs

On Sat, May 17, 2008 at 3:54 PM, Xavier <shiningxc@gmail.com> wrote:
> Aaron Griffin wrote:
>> On Sat, May 17, 2008 at 10:28 AM, Geoffroy Carrier
>> <geoffroy.carrier@koon.fr> wrote:
>>>>> - Still, lightweight means smater
>>>>> => Don't use
>>>>> "$_svntrunk" ${something}
>>>>> instead of
>>>>> $_svntrunk $something
>>>>>
>>>> Where exactly is this change?
>>> This was an example of the rule I wanted to follow... ie. i did not
>>> introduced quotes of $_svntrunk which obviously won't include spaces.
>>> (or it's REAAALLY dumb).
>>
>> Just to be a tad more technical. I always try to use the ${} syntax
>> when I can. It IS more to type, but prevents errors much more and is a
>> good habit to follow. It's a minor thing, but I prefer that syntax. I
>> don't think we should really enforce it either way
>>
>
> That's interesting. We don't really enforce anything with the prototypes
> but it's good to show the preferred syntax with them.
>
> I think $pkgname and $pkgver should be safe though, right? They
> shouldn't contain spaces or other weird things so don't require
> additional quotings. But pkgdir, srcdir and startdir do.
>
> So maybe instead of :
> cd "$srcdir/$pkgname-$pkgver"
> we could use :
> cd ${srcdir}/$pkgname-$pkgver

Well, ${srcdir} still needs the quotes.

"${srcdir}/$pkgname-$pkgver"

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-18-2008, 09:42 AM
Xavier
 
Default Refreshed PKGBUILDs

Travis Willard wrote:
> On Sat, May 17, 2008 at 3:54 PM, Xavier<shiningxc@gmail.com> wrote:
>> That's interesting. We don't really enforce anything with the prototypes
>> but it's good to show the preferred syntax with them.
>>
>> I think $pkgname and $pkgver should be safe though, right? They
>> shouldn't contain spaces or other weird things so don't require
>> additional quotings. But pkgdir, srcdir and startdir do.
>>
>> So maybe instead of :
>> cd "$srcdir/$pkgname-$pkgver"
>> we could use :
>> cd ${srcdir}/$pkgname-$pkgver
>
> Well, ${srcdir} still needs the quotes.
>
> "${srcdir}/$pkgname-$pkgver"
>

Ok what I said was stupid, forget it

Another thing I just found out, suppose you are in a directory with a
space, the following doesn't work in bash but it does work with zsh:
startdir=$(pwd); cd $startdir

For some reasons, zsh doesn't seem to need any quoting.. Weird stuff.

_______________________________________________
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 10:37 AM.

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