You are not logged in.
Greetings. Since Paul seems to be committed to getting this into AUR 1.5, I thought I'd post on the forums to get more people to test my script. You can read about it on this ML thread.
Here are some features:
- Complete PKGBUILD parsing using lexical grammar (regex and php, using lemon parser generator)
- Checks all variables for sanity
- Uses a decent OOP structure so variables are readily available after running parse()
- Helps to somewhat enforce Arch Packaging Standards
- Custom variables are properly substituted into other variables (provided they are declared beforehand)
Here are some things it won't do:
- build() function is not checked for sanity
- won't check if deps are correct, or if they exist
- won't do advanced bash substitution (yet?), e.g. ${pkgname/test/newtest}
At the moment, if the PKGBUILD fails, it spits out a nearly meaningless error, but I'm working to have that changed. I've had a handful of people test the script for me with mixed reports, and have been able to fix several bugs. But I'd still like to have it thoroughly tested which is why I'm now posting here. If you think you have standards compliant PKGBUILDs, take the test
All you have to do is click browse, locate a PKGBUILD, click submit. On success, some variables are displayed. If it fails, post your PKGBUILD here, or email it to me for review.
Thanks.
Offline
Fatal error: Uncaught exception 'Exception' with message 'Unexpected input at line10: i' in
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php:251 Stack trace: #0
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php(90): Pkgbuild->yylex1() #1
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php(80): Pkgbuild->yylex() #2
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/parser.php(12): Pkgbuild->parse() #3 {main} thrown in
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php on line 251
Error in your code?
Tested PKGBUILD.
Last edited by [vEX] (2007-10-10 14:38:29)
PC: Antec P182B | Asus P8Z77-V PRO | Intel i5 3570k | 16GB DDR3 | GeForce 450GTS | 4TB HDD | Pioneer BDR-207D | Asus Xonar DX | Altec Lansing CS21 | Eizo EV2736W-BK | Arch Linux x86_64
HTPC: Antec NSK2480 | ASUS M3A78-EM (AMD 780G) | AMD Athlon X3 425 | 8GB DDR2 | GeForce G210 | 2TB HDD | Arch Linux x86_64
Server: Raspberry Pi (model B) | 512MB RAM | 750GB HDD | Arch Linux ARM
Offline
Fixed. Here's what failed:
license=('custom: "bsnes (TM) Open Source Reference License"')
[ "$CARCH" = "x86_64" ] && makedepends=('yasm')
Didn't know " and () were allowed in license.
And completely forgot about conditionals.
Offline
I like to use ' whereever possible and that includes pkgdesc (instead of "). I couldn't think of anything else where it could have failed.
Last edited by byte (2007-10-11 03:53:40)
1000
Offline
easy fix. done.
Offline
Here's another (looks like a similar error):
Fatal error: Uncaught exception 'Exception' with message 'Unexpected input at line11: l' in
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php:253 Stack trace: #0
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php(90): Pkgbuild->yylex1() #1
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php(80): Pkgbuild->yylex() #2
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/parser.php(12): Pkgbuild->parse() #3 {main} thrown in
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php on line 253
Offline
license should be an array. take a look at the arch packaging standards in the wiki.
Offline
Ack, thanks. After that fix, works as advertised.
Last edited by sinecure (2007-10-11 08:51:03)
Offline
Fixed. Here's what failed:
license=('custom: "bsnes (TM) Open Source Reference License"') [ "$CARCH" = "x86_64" ] && makedepends=('yasm')
Didn't know " and () were allowed in license.
And completely forgot about conditionals.
The license field is an array, just check the PKGBUILD prototype, as well as the following quote.
Quote from http://wiki.archlinux.org/index.php/Arc … s#Licenses:
3. Add 'custom' to the licenses array. Optionally, you can replace 'custom' with 'custom:"name of license"'.
This is also where it shows how to describe the custom license, but the " could also just be to indicate that 'name of license' should be replaced with the license name. Actually, since there is a colon after 'Custom' it actually doesn't make any sense having the quotation mark.
EDIT: Aye, a bit below the quoted text above one can read this:
Some packages may not be covered by a single license. In these cases multiple entries may be made in the license array e.g. license=("GPL" "custom:some commercial license").
Which means my PKGBUILD is invalid since I use the quotation marks in my license array, I guess that's what you get for just copying the example and not read the rest of the text.
Last edited by [vEX] (2007-10-11 13:10:54)
PC: Antec P182B | Asus P8Z77-V PRO | Intel i5 3570k | 16GB DDR3 | GeForce 450GTS | 4TB HDD | Pioneer BDR-207D | Asus Xonar DX | Altec Lansing CS21 | Eizo EV2736W-BK | Arch Linux x86_64
HTPC: Antec NSK2480 | ASUS M3A78-EM (AMD 780G) | AMD Athlon X3 425 | 8GB DDR2 | GeForce G210 | 2TB HDD | Arch Linux x86_64
Server: Raspberry Pi (model B) | 512MB RAM | 750GB HDD | Arch Linux ARM
Offline
Fatal error: Uncaught exception 'Exception' with message 'Unexpected input at line10: g' in
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php:253 Stack trace: #0
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php(90): Pkgbuild->yylex1() #1
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php(80): Pkgbuild->yylex() #2
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/parser.php(12): Pkgbuild->parse() #3 {main} thrown in
/home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php on line 253
Last edited by Lone_Wolf (2007-10-11 20:05:30)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Probably because of this (I'm just guessing though):
install=oolite.install
install=
That is, you have 'install' twice! And you really should remove those unused arrays to make the PKGBUILD look nicer.
PC: Antec P182B | Asus P8Z77-V PRO | Intel i5 3570k | 16GB DDR3 | GeForce 450GTS | 4TB HDD | Pioneer BDR-207D | Asus Xonar DX | Altec Lansing CS21 | Eizo EV2736W-BK | Arch Linux x86_64
HTPC: Antec NSK2480 | ASUS M3A78-EM (AMD 780G) | AMD Athlon X3 425 | 8GB DDR2 | GeForce G210 | 2TB HDD | Arch Linux x86_64
Server: Raspberry Pi (model B) | 512MB RAM | 750GB HDD | Arch Linux ARM
Offline
actually you can have a variable listed twice. you just cant have empty variables.
Offline
actually you can have a variable listed twice. you just cant have empty variables.
Sometimes it's useful to have empty variables, to explicitly say "Hey, this PKGBUILD has no source" for example.
Offline
source and md5sum are allowed to be empty (i think this is a svn/cvs/etc rule). just not anything else.
edit: and by not including the source array as well, i would think you're explicitly saying there is no source
Last edited by tardo (2007-10-11 21:03:14)
Offline
Nope, removing the empty install= line still gives the same error.
When i start making a new pkgbuild i usually copy PKGBUILD.proto and adjust it.
I believe the PKGBUILD should give a clear picture what is being done, and imo listing all variables helps with that.
Edit :
After removing all empty var lines, the error is gone.
Last edited by Lone_Wolf (2007-10-11 21:09:24)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Also craps out on stuff like source=("http://fooo.../$pkgname-$_realver.tar.gz")
1000
Offline
Also craps out on stuff like source=("http://fooo.../$pkgname-$_realver.tar.gz")
what exactly?
Offline
Fatal error: Uncaught exception 'Exception' with message 'Unexpected input at line15: h' in /home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php:253
Stack trace: #0 /home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php(90):
Pkgbuild->yylex1() #1 /home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php(80):
Pkgbuild->yylex() #2 /home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/parser.php(12):
Pkgbuild->parse() #3 {main} thrown in /home/.anika/tardo/nagi-fanboi.net/arch/pkgbuild/pkgbuild.php on line 253
http://aur.archlinux.org/packages/pctel/pctel/PKGBUILD
Last edited by byte (2007-10-12 09:06:08)
1000
Offline
source and md5sum are allowed to be empty (i think this is a svn/cvs/etc rule). just not anything else.
edit: and by not including the source array as well, i would think you're explicitly saying there is no source
By not including something, it becomes implicit, as you're allowing the default to take over. There's nothing explicit about omission.
Offline
tardo wrote:source and md5sum are allowed to be empty (i think this is a svn/cvs/etc rule). just not anything else.
edit: and by not including the source array as well, i would think you're explicitly saying there is no source
By not including something, it becomes implicit, as you're allowing the default to take over. There's nothing explicit about omission.
Haha, but the default is an empty set anyway
@byte: I'll look at it later this evening. I have an idea what the problem is.
Offline
OK fixed. Problem was with pkgdesc. Not exactly sure what but I rewrote that regex to be a little more and less generic. Please try it again.
Offline