[arch-general] PKGBUILD question
Allan McRae
allan at archlinux.org
Sat Jan 7 07:47:20 EST 2012
On 07/01/12 22:30, Corrado Primier wrote:
> 2012/1/7 Don Juan <donjuansjiz at gmail.com>:
>> The problem I have run into and can not seem to find info about or something
>> I have ever run into is that it seems bsdtar when extracting is making the
>> name as name_2.0.1-BETA1 and not making it name_2.0.1-beta1 and makepkg
>> fails saying it can not find the proper file of name_2.0.1-beta1.
>
> There is a nice construct in bash (beware: version 4 only) which
> allows you to make something uppercase with brace expansion.
> Look at this:
>
> [bardo at antani ~]$ pkgver=2.0.1-beta1
> [bardo at antani ~]$ echo ${pkgver^^}
> 2.0.1-BETA1
>
> The only problem in your specific situation is the need to also change
> '-' in '_'. That would require a double brace expansion, but I'm not
> sure it is possible. If it is, it seems to be undocumented. The
> cleanest way I could come up with is:
>
> $(sed 's/-/_/' <<<${pkgver^^})
>
> Not very nice, huh? :)
>
I'd just go for something like this:
_pkgver=2.0.1-BETA1
pkgver=2.0.1beta1
No need for all that fancy stuff...
Allan
More information about the arch-general
mailing list