[arch-general] PKGBUILD question

Corrado Primier ilbardo at gmail.com
Sat Jan 7 07:30:11 EST 2012


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? :)


bardo


More information about the arch-general mailing list