You are not logged in.
I'm writing a neat script that's helping me compile packages with different compile flags on the fly. I'm running into a wall though: the package versions and releases sometimes contain variables. So it's not as easy as just running sed against the PKGBUILD ... I can end up with a variable name as a version! Is there some way I can export all the variables from a PKGBUILD during a script so I can simply call $pkgver and get the version, for example?
When I'm done with this thing and it is polished, I'll share it with you guys. It should make cross compiling very, very easy, and will keep a mirror updated with a simple cron job! But of course, this is just theoretical
Last edited by synthead (2010-06-28 14:04:54)
Offline
Just source the PKGBUILD to access the evaluated vars:
. PKGBUILD
echo $pkgname-$pkgver
Note: this does not work if those are overridden by split packages. (and there is no sane solution to this problem)
Offline
This worked great! I completely forgot about the . command. I mean, it's so small! Anyone could lose it.
My script is working great and is now stripped of sloppy sed commands. Thanks for your help!
Offline