[arch-general] PKGBUILD question
I am trying to update a AUR pkgbuild I found and the source file when I download it has a - in the file name name_2.0.1-beta1 I figure out using ${pkgver//_/-} converts it properly when listing it as name_2.0.1_beta1. 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. I have it as so in my PKGBUILD package() { cd ${srcdir}/${pkgname}_${pkgver//_/-} also as cd ${srcdir}/${pkgname}_${pkgver} the tarball being downloaded converts properly and dl's fine, it just seems to be in the next step for package, unless I just really am not grasping this yet. If so feel free to say I need to read more. But I think its something easy I am just looking over. Thank you for any time and help understanding this.
On Fri, Jan 6, 2012 at 9:41 PM, Don Juan <donjuansjiz@gmail.com> wrote:
the tarball being downloaded converts properly and dl's fine, it just seems to be in the next step for package, unless I just really am not grasping this yet. If so feel free to say I need to read more. But I think its something easy I am just looking over.
paste the PKGBUILD in it's entirely somewhere for review. -- C Anthony
On Fri, Jan 06, 2012 at 07:41:32PM -0800, Don Juan wrote:
I am trying to update a AUR pkgbuild I found and the source file when I download it has a - in the file name
name_2.0.1-beta1
I figure out using ${pkgver//_/-} converts it properly when listing it as name_2.0.1_beta1.
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.
I have it as so in my PKGBUILD package() { cd ${srcdir}/${pkgname}_${pkgver//_/-}
also as cd ${srcdir}/${pkgname}_${pkgver}
the tarball being downloaded converts properly and dl's fine, it just seems to be in the next step for package, unless I just really am not grasping this yet. If so feel free to say I need to read more. But I think its something easy I am just looking over.
You do realise there is no *requirement* to use $pkgname and $pkgver, right? You can just hard code the correct names into the PKGBUILD and be done with it. The only drawback is that you need to modify a few more places when updating the package in the future. That is a *very* minor drawback in the vast majority of cases. Also, in the future consider uploading the PKGBUILD you are working on to a pastebin. It will likely make it much easier to ask you question. :-) /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus Perl is another example of filling a tiny, short-term need, and then being a real problem in the longer term. -- Alan Kay
On Fri, Jan 06, 2012 at 07:41:32PM -0800, Don Juan wrote:
I am trying to update a AUR pkgbuild I found and the source file when I download it has a - in the file name
name_2.0.1-beta1
I figure out using ${pkgver//_/-} converts it properly when listing it as name_2.0.1_beta1.
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.
I have it as so in my PKGBUILD package() { cd ${srcdir}/${pkgname}_${pkgver//_/-}
also as cd ${srcdir}/${pkgname}_${pkgver}
the tarball being downloaded converts properly and dl's fine, it just seems to be in the next step for package, unless I just really am not grasping this yet. If so feel free to say I need to read more. But I think its something easy I am just looking over.
You do realise there is no *requirement* to use $pkgname and $pkgver, right? You can just hard code the correct names into the PKGBUILD and be done with it. The only drawback is that you need to modify a few more places when updating the package in the future. That is a *very* minor drawback in the vast majority of cases. ahh, sorry I did not think of that, was trying hard to stick with what I was reading that it slipped my mind. Working through updating the
On 01/06/2012 10:57 PM, Magnus Therning wrote: patches on it now, just about finished building. I just picked a package that was marked out of date to practice building with abs and using a PKGBUILD. I will worry about the use of the variables in another package I pick. I don't even need what I am trying to build :P Just wanted to try and updated the build if I could.
Also, in the future consider uploading the PKGBUILD you are working on to a pastebin. It will likely make it much easier to ask you question. :-)
/M
@ Anthony & @Magnus Noted about pasting to a board on-line will do next time. Thanks for the help :)
2012/1/7 Don Juan <donjuansjiz@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@antani ~]$ pkgver=2.0.1-beta1 [bardo@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
On Sat, Jan 07, 2012 at 01:30:11PM +0100, Corrado Primier wrote:
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? :)
Double brace expansion works like this: _pkgdir=${pkgver^^} _pkgdir=${_pkgdir//-/_} cd "$srcdir/$pkgname-$_pkgdir" -- Mantas M.
On 07/01/12 22:30, Corrado Primier wrote:
2012/1/7 Don Juan <donjuansjiz@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@antani ~]$ pkgver=2.0.1-beta1 [bardo@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
2012/1/7 Allan McRae <allan@archlinux.org>:
I'd just go for something like this:
_pkgver=2.0.1-BETA1 pkgver=2.0.1beta1
No need for all that fancy stuff...
I'd go for that too. But I find these little challenges very funny, and I wondered if it was possible without adding another variable :) bardo
On 01/07/2012 04:42 AM, Corrado Primier wrote:
2012/1/7 Allan McRae<allan@archlinux.org>:
I'd just go for something like this:
_pkgver=2.0.1-BETA1 pkgver=2.0.1beta1
No need for all that fancy stuff... I'd go for that too. But I find these little challenges very funny, and I wondered if it was possible without adding another variable :)
bardo Thanks for more input on this, went scuba diving yesterday and came home to more nice tips for to use and learn about.
Thanks everyone for taking the time to post more about this. I stuck with Corrado's way. Now the PKGBUILD is fine and works like I expect. Just need to try installing it here shortly and see if all my changes and patches worked. DJ
On Jan 7, 2012 7:37 AM, "Allan McRae" <allan@archlinux.org> wrote:
On 07/01/12 22:30, Corrado Primier wrote:
2012/1/7 Don Juan <donjuansjiz@gmail.com>:
The problem I have run into and can not seem to find info about or
I have ever run into is that it seems bsdtar when extracting is making
something 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@antani ~]$ pkgver=2.0.1-beta1 [bardo@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
Lol Allan. I'm also learning how to make my PKGBUILDs better and learningfmore Bash scripting. So I'm reading the posts and its like I completely forgot to go the simple route and declare two variables.
participants (8)
-
Allan McRae
-
C Anthony Risinger
-
Corrado Primier
-
Don deJuan
-
Don Juan
-
Jonathan Vasquez
-
Magnus Therning
-
Mantas M.