[Salix-main] slkbuild update

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Salix-main] slkbuild update

George Vlahavas
Hi,

here's another update for slkbuild. Rich asked for being able to use
the $pkgver variable in the doinst() function for a package, which until
now was not possible. This update makes it possible to use the $pkgname,
$pkgver, $arch (or $ARCH) and $LIBDIRSUFFIX variables in the doinst().

http://people.salixos.org/gapan/slkbuild/

I'm sure I needed to use at least $LIBDIRSUFFIX in the doinst at some
point and had to revert to separate SLKBUILD files for i486 and x86_64, so
this is probably going to be useful.

Please test if you can. Thanks!

George

------------------------------------------------------------------------------
_______________________________________________
Salix-main mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/salix-main
Reply | Threaded
Open this post in threaded view
|

Re: [Salix-main] slkbuild update

Cyrille Pontvieux-2

Thanks a lot !

That is indeed a great update and I remember wanting to use one of these variables in doinst in the past.

Is there any point we must take care or is this completely transparent ?

JRD/Cyrille

Le 2015-11-17 20:58, George Vlahavas a écrit :

Hi,

here's another update for slkbuild. Rich asked for being able to use 
the $pkgver variable in the doinst() function for a package, which until 
now was not possible. This update makes it possible to use the $pkgname, 
$pkgver, $arch (or $ARCH) and $LIBDIRSUFFIX variables in the doinst().

http://people.salixos.org/gapan/slkbuild/

I'm sure I needed to use at least $LIBDIRSUFFIX in the doinst at some 
point and had to revert to separate SLKBUILD files for i486 and x86_64, so 
this is probably going to be useful.

Please test if you can. Thanks!

George

------------------------------------------------------------------------------
_______________________________________________
Salix-main mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/salix-main

 

 

------------------------------------------------------------------------------

_______________________________________________
Salix-main mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/salix-main
Reply | Threaded
Open this post in threaded view
|

Re: [Salix-main] slkbuild update

George Vlahavas
Hi Cyrille,

On Wed, 18 Nov 2015, Cyrille Pontvieux wrote:

>
>
> Thanks a lot !
>
> That is indeed a great update and I remember wanting to use one of these variables in doinst in the past.
>
> Is there any point we must take care or is this completely transparent ?

Yes, actually, there is a small catch. Since I cannot find a proper way to
do variable substitution when requesting a function definition, the
variables are substituted with their values using sed. So, if for some
reason one tries to use something like this:

------------------
pkgver=1.0

doinst() {
   echo $pkgversion
}
------------------

the actual doinst that will be created is this:

------------------
doinst() {
   echo 1.0sion
}
------------------

because it will substitute "$pkgver" with "1.0". But, you can also use
braces with function names if you want, like

------------------
doinst() {
   echo ${pkgver}
}
------------------

and that will work just fine, so it becomes less of a problem, but maybe
something to keep in mind.

------------------------------------------------------------------------------
_______________________________________________
Salix-main mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/salix-main