Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#12829 - [firefox-i18n] PKGBUILD should not use eval
Attached to Project:
Arch Linux
Opened by Gergely (imrehg) - Saturday, 17 January 2009, 16:07 GMT
Last edited by Jan de Groot (JGC) - Saturday, 13 June 2009, 15:25 GMT
Opened by Gergely (imrehg) - Saturday, 17 January 2009, 16:07 GMT
Last edited by Jan de Groot (JGC) - Saturday, 13 June 2009, 15:25 GMT
|
DetailsDescription:
Extra/Firefox-i18n uses eval to fill out the different sources makepkg should download. This relies on the _current_ internal working of makepkg (that the PKGBUILD is basically a part of a bash script) and does not conform to the Arch Packaging Standards. I understand that there are a large number of packages to keep track of, but e.g. with appropriate formatted lines (one after the other, aligned with each other) the checking for correctness shouldn't be a problem. And of course the version control keeps track of things, so not that easy to miss a package from one version to another. Okay, no makepkg parsing change (that would render the current form of the package useless) is imminent so one could say that whatever, let's keep it this way. But I think it sends the wrong message to the AUR users, sets the wrong example how to write a good PKGBUILD. Just my 0.02 units of currency... Attaching PKGBUILD that should (as much as I know) conform to the packaging standards. Additional info: Version 3.0.5 |
This task depends upon
Closed by Jan de Groot (JGC)
Saturday, 13 June 2009, 15:25 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in 3.0.11-1.
Saturday, 13 June 2009, 15:25 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in 3.0.11-1.
PKGBUILD
That's one thing that there are no plans to move away from the current "source PKGBUILD" way of doing things in makepkg, but the standard was made for a reason - that there can be and there are code other than makepkg that can understand (correctly) PKGBUILDs. For example while the AUR implementation of the parser understand the standard version, "eval" obviously brakes it.
I cannot (and shouldn't) comment on how much extra effort is to update the PKGBUILD every releasse. My rewrite was about 15 minutes (with some reading to refresh by bash scripting knowledge:)
I know there are many things that can make a PKGBUILD easier to maintain, relying on these "undocumented" solutions using the fact that makepkg itself is a bash script. Like commenting in the variable fields, that wouldn't be allowed according to the docs, and is still used so many times.
Just felt, that these tricks are most of the time unnecessary (useful but unnecessary) - if there's a situation that absolutely cannot be handled without "eval"-ing the control variables, then the PKGBUILD specs are not adequate. I haven't come across such situation yet, though.... If you think e.g. "evaling" is important, let's get it included in the standard.
Still, this is all an observation, nothing more.
This is not the case here though, sourcing the PKGBUILD will always result in the same variables, no matter where it is run.
So AUR could just do that and display everything correctly for firefox-i18n.
I noticed namcap invoked bash in as special way : http://projects.archlinux.org/?p=namcap.git;a=blob;f=parsepkgbuild;hb=HEAD
8 export PATH=/tmp/parsepkgbuild; exec /bin/bash --noprofile --norc -r << EOF
And -r is apparently a restricted shell mode.
If there is a movement to secure makepkg more, this backdoor is most likely to be closed, but the standardized behaviour will of course will continue to work.
If you say that it is not a problem for official packages but it's a problem for AUR : the people uploading to AUR learn/copy from the official packages! Check out for example the AUR bug report
FS#12645Can we honestly say, that there is a different standard for official packages then for AUR ones? As much as I know, AUR packages can be included into the community repo (that's kinda "official", isn't it?) but also can be relegated back to AUR - so could use "eval" when I'm in "community" but once I back in AUR I have to replace it back to manual listing? That does not make much sense to me.
The only real definition of PKGBUILD is whatever can be fed to makepkg and results in a working package. Using eval does not break the PKGBUILD format at all, that is non-sense. It only breaks AUR.
Of course in practice, packagers try to write sane PKGBUILDs, resulting in sane packages, and a number of conventions and usages have been made for practical reasons. But that's it.
The "Arch Packaging Standards" would be better named "Packaging guidelines". And this document does not look official at all, and can be edited by anyone. Also, see the difference :
man makepkg
If you need to create any custom variables for use in your build process, it is recommended to name your custom variables with an _ (underscore) prefix. This will prevent any possible name clashes with internal makepkg variables. For example, to store the base kernel version in a variable, use something similar to $_basekernver.
vs
# Do not introduce new variables into your PKGBUILD build scripts, unless the package cannot be built without doing so, as these could possibly conflict with variables used in makepkg itself. If a new variable is absolutely required, prefix the variable name with an underscore (_) e.g
_customvariable=
The AUR cannot detect the use of custom variables and so cannot use them in substitutions. This can most often be seen in the source array e.g.
http://downloads.sourceforge.net/directxwine/$patchname.$patchver.diff.bz2
Such a situation defeats the effective functionality of the AUR.
What about stopping this stupid discussion here, and instead discussing the real technical problems we have?
I was wondering if a restricted bash shell would make sourcing PKGBUILDs safer for AUR.
If there is really no way to make it safer, another question would be whether AUR interpreter can be improved/extended, and to which extents.
If you have nothing to add to these concerns, please just stop here, you already repeated your points 10 times in two different bug reports, we all got it.
Okay, now I understand that the PKGBUILD definition should only read "whatever does not break makepkg", good, that's already more than it was said before. Tell me which part of the PKGBUILD man page said this before?
All I could see there (if you pointed out one other part already)
###
The following is a list of standard options and directives available for use in a PKGBUILD. These are all understood and interpreted by makepkg, and most will be directly transferred to the built package.
###
For me this said, that these and only these functions should be used. So you say that this is not true - then let people know! No, I never thought AUR is right, otherwise I wouldn't try to improve it.... But tell me, how can a code conform to something, that is not defined???
I want to talk about real technical issues - that's what I'm trying to figure out. AUR does not need bash shell to source PKGBUILDS - it only has to UNDERSTAND the package format. If that's stupid, I don't know how do you imagine any code to be improved.
Best wishes....