Summary: | Hyphens (or dashes) in environment variables causes Portage to fail | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Beetle B. <usefuljunk> |
Component: | Unclassified | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | progserega |
Priority: | High | Keywords: | InVCS |
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
URL: | http://forums.gentoo.org/viewtopic-t-625637.html | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 216231 | ||
Attachments: |
Portage environment file
remove any variable with name containing a hyphen exclude variable names that begin with a digit or contain non-alphanumeric characters exclude variable names that begin with a digit or contain non-alphanumeric characters exclude variable names that begin with a digit or contain non-alphanumeric characters |
Description
Beetle B.
2008-03-01 05:37:08 UTC
solution is to rebuild the package in question environment variables cannot have dashes in them ... it is simply invalid ... fix whatever is broken and pulling that crap, dont try and "fix" it in portage post the environment file in question "solution is to rebuild the package in question" *Which* package? This occurs for ALL packages. Should I have to rebuild world? If this is something FVWM-Crystal messes up, perhaps it should be masked? That particular file is gone, as I used the hack on the link to get it to be merged. Here's one environment file sitting at: /var/tmp/binpkgs/sys-apps/portage-2.1.4.4/temp (big file - sent as attachment) Created attachment 144988 [details]
Portage environment file
This is the same thing as bug 210580 but I'm thinking maybe we should add a filter to portage for this. Yes. It's exactly that. I'll mark this as a duplicate and keep watching that. Thank you. *** This bug has been marked as a duplicate of bug 210580 *** *** Bug 211882 has been marked as a duplicate of this bug. *** Created attachment 144990 [details, diff]
remove any variable with name containing a hyphen
If this patch is saved as /tmp/filter_hyphens.patch then it can be applied as follows:
patch /usr/lib/portage/bin/ebuild.sh /tmp/filter_hyphens.patch
Reopening since portage is going to handle it. filtering hyphens is a special case. either filter the variables completely and properly, or dont filter at all. http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html Environment variable names [...] consist solely of uppercase letters, digits, and the '_' (underscore) from the characters defined in Portable Character Set and do not begin with a digit. Well, in addition to the specification, we need to be pragmatic and consider the variable names that current ebuilds and eclasses rely on. For example, is it really safe for us to filter variable names containing lower case letters? sorry, i did not mean to indicate we should do that. what i was after was the fact we'll hit this issue again as soon as some other application uses an @ symbol or a ^ or a % or something else. you can easily write C code that calls putenv("M@FOO=asdf") and it'll go into the environment. try this definition instead: In the shell command language, a word consisting solely of underscores, digits, and alphabetics from the portable character set. The first character of a name is not a digit. Created attachment 145147 [details, diff]
exclude variable names that begin with a digit or contain non-alphanumeric characters
Created attachment 145185 [details, diff]
exclude variable names that begin with a digit or contain non-alphanumeric characters
This fixes an issue with the previous patch that prevented it from filtering variable names containing multiple non-alphanumeric characters.
If this patch is saved as /tmp/filter_unsupported.patch then it can be applied as follows:
cd /usr/lib/portage
patch -p0 -i /tmp/filter_unsupported.patch
Created attachment 145244 [details, diff]
exclude variable names that begin with a digit or contain non-alphanumeric characters
This fixes an issue with the previous patch that caused the = character to trigger false positives.
Comment on attachment 145244 [details, diff]
exclude variable names that begin with a digit or contain non-alphanumeric characters
There are still some remaining issues with the last "filter_unsupported.patch" so for now I recommend the "filter_hyphens.patch" that was first posted.
Unfortunately, tightening the filter to include all non-alphanumeric characters exposed some false positives that need to be handled. As of current svn, the only remaining issue is to handle multi-line variable definitions that are generated by the 'export' builtin.
This is supposed to be fixed in portage-2.2_pre5 or earlier. This is supposed to be fixed in portage-2.2_pre5 or earlier. |