Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 166837 - etc-update in portage-2.1.2-r9 does not correctly handle CONFIG_PROTECT_MASK
Summary: etc-update in portage-2.1.2-r9 does not correctly handle CONFIG_PROTECT_MASK
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on:
Blocks: 167107
  Show dependency tree
 
Reported: 2007-02-14 14:04 UTC by piavlo
Modified: 2007-04-29 10:13 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
fixes the bug (etc-update.patch,499 bytes, patch)
2007-02-14 14:07 UTC, piavlo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description piavlo 2007-02-14 14:04:04 UTC
The etc-update in portage-2.1.2-r9 ignores CONFIG_PROTECT_MASK
the following patch fixes the problem
--- /usr/lib/portage/bin/etc-update     2007-02-13 15:19:05.000000000 +0200
+++ cs-etc-update       2007-02-14 15:32:44.000000000 +0200
@@ -60,7 +60,8 @@
                        rpath=$(echo "${file/\/\///}" | sed -e "s:/[^/]*$::")
                        rfile=$(echo "${file/\/\///}" | sed -e "s:^.*/::")
                        for mpath in ${CONFIG_PROTECT_MASK}; do
-                               mpath="${ROOT}${path}"
+                               mpath="${ROOT}${mpath}"
+                               mpath=$(echo ${mpath/\/\///})
                                if [[ "${rpath}" == "${mpath}"* ]]; then
                                        mv ${rpath}/${rfile} ${rpath}/${rfile:10}
                                        break


Reproducible: Always
Comment 1 piavlo 2007-02-14 14:07:13 UTC
Created attachment 110171 [details, diff]
fixes the bug
Comment 2 Zac Medico gentoo-dev 2007-02-15 20:32:35 UTC
Thanks, this is in svn r5969.  Note that quotes are needed in mpath=$(echo "${mpath/\/\///}") for proper support of whitespace in paths (though etc-update doesn't currently have support whitespace in paths anyway).
Comment 3 piavlo 2007-02-15 22:49:38 UTC
Regarding support of white spaces in path, it looks like portage does not handle
correctly whitespaces in general. I could not find a way how to specify
white space for any of variables in /etc/make.conf or from command line, for example:
----------(1)----------
# portageq envvar CONFIG_PROTECT_MASK
/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo
-----------------------
but
-----------(2)---------
# env CONFIG_PROTECT_MASK="/zopa\ kaka" portageq envvar CONFIG_PROTECT_MASK
/etc/env.d /etc/gconf /zopa\ kaka
-----------------------
Why are the /etc/env.d/java/  /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo paths missing in (2) ?
Now if i add CONFIG_PROTECT_MASK="/zopa\ kaka" to make.conf
-----------(3)---------
# portageq envvar CONFIG_PROTECT_MASK
/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /zopa kaka
-----------------------
In (3) there is no backslash for "/zopa\ kaka" path?

 The same behaviour for any variable in make.conf.
Comment 4 Marius Mauch (RETIRED) gentoo-dev 2007-02-15 23:14:56 UTC
This likely is a result of the different parsers used for env variables (shell) and make.* files (python shlex module). I'd guess the latter interprets the backslash as escape character, so portage never gets to see it.
And anyway, portage itself doesn't handle the backslash specially anyway, so an entry "/foo\ bar" would be treated as two separate entries "/foo\" and "bar".
IOW: variables that use spaces as delimiters can't contain entries with spaces.
Comment 5 piavlo 2007-02-15 23:33:49 UTC
Well don't you think that for variables containing paths the ':' delimeter is much more appropriate rather than whitespace?
Comment 6 piavlo 2007-02-15 23:35:10 UTC
Well don't you think that for variables containing paths the ':' delimeter is much more appropriate rather than whitespace?
Comment 7 Marius Mauch (RETIRED) gentoo-dev 2007-02-16 03:02:01 UTC
Probably, but implementing that change isn't trivial (usual compat issues).
Comment 8 Zac Medico gentoo-dev 2007-02-19 21:48:23 UTC
This has been released in 2.1.2-r10.
Comment 9 Alex V. Koval 2007-04-29 10:13:04 UTC
related bug 150370 (this was the commit which caused this bug)