You are not logged in.

#1 2004-07-04 05:23:06

wdemoss
Member
From: WV - USA
Registered: 2004-01-18
Posts: 222

custom variables in PKGBUILDs

I've read alot that the devs advise against defining your own custom variables in a PKGBUILD file incase the devs add a new variable to the internals of makepkg. But, what if there was an arch dev community supported convention about custom variable definition that was documentated? For example, the docs could say "All custom variables defined in a PKGBUILD should be prefixed with two underscores, e.g. __mycustomvar. This way, there could be custom vars and arch devs wouldn't use any __vars for new features of makepkg.

Just an idea,
-wd


Hobbes : Shouldn't we read the instructions?
Calvin : Do I look like a sissy?

Offline

#2 2004-07-05 14:06:58

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: custom variables in PKGBUILDs

$origver or $__origver ?

i dont think, it is needed to use non-human_readable__ for PKGBUILD, as it is really elementar (it's not OO for building a whole architecture on it)

my suggestion would be to reserve some variables for some cases

e.g. if pkgver is different than the original version of the tarball, then let's use origver to refer to the original version (the case, when tarball version is 1.0-beta3 and pkgver should be 1.0beta3)

one other is origname where the original name of the pkg is meant (the one the tarball is called after it)


The impossible missions are the only ones which succeed.

Offline

#3 2004-07-05 16:52:10

wdemoss
Member
From: WV - USA
Registered: 2004-01-18
Posts: 222

Re: custom variables in PKGBUILDs

dp wrote:

$origver or $__origver ?

i dont think, it is needed to use non-human_readable__ for PKGBUILD, as it is really elementar (it's not OO for building a whole architecture on it)

my suggestion would be to reserve some variables for some cases

e.g. if pkgver is different than the original version of the tarball, then let's use origver to refer to the original version (the case, when tarball version is 1.0-beta3 and pkgver should be 1.0beta3)

one other is origname where the original name of the pkg is meant (the one the tarball is called after it)

I think that is a great idea, since those are the exact instances I run into regularly when creating my own packages, and spawned me to post.


Hobbes : Shouldn't we read the instructions?
Calvin : Do I look like a sissy?

Offline

#4 2004-07-05 21:01:09

apeiro
Daddy
From: Victoria, BC, Canada
Registered: 2002-08-12
Posts: 771
Website

Re: custom variables in PKGBUILDs

If you prefix an underscore, you can use any variable you want.  I won't introduce any _* variables into makepkg.

Offline

#5 2004-07-06 00:09:55

wdemoss
Member
From: WV - USA
Registered: 2004-01-18
Posts: 222

Re: custom variables in PKGBUILDs

apeiro wrote:

If you prefix an underscore, you can use any variable you want.  I won't introduce any _* variables into makepkg.

very cool, thanks apeiro. Is it worth noting this in the official documentation?
-wd


Hobbes : Shouldn't we read the instructions?
Calvin : Do I look like a sissy?

Offline

Board footer

Powered by FluxBB