Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 150370 - $ROOT and $PORTAGE_CONFIGROOT support for etc-update
Summary: $ROOT and $PORTAGE_CONFIGROOT support for etc-update
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 147007
  Show dependency tree
 
Reported: 2006-10-07 04:02 UTC by gent_bz
Modified: 2007-04-29 10:56 UTC (History)
4 users (show)

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


Attachments
Add support to etc-update for ROOT and PORTAGE_CONFIGROOT (etc-update-root-configroot-support.diff,1.94 KB, patch)
2006-10-07 04:04 UTC, gent_bz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description gent_bz 2006-10-07 04:02:41 UTC
A quick effort to add support to etc-update for when $ROOT and $PORTAGE_CONFIGROOT are set.
Comment 1 gent_bz 2006-10-07 04:04:13 UTC
Created attachment 99036 [details, diff]
Add support to etc-update for ROOT and PORTAGE_CONFIGROOT
Comment 2 gent_bz 2006-10-08 17:09:34 UTC
The patch should have ""s around the added ${...}s.  Otherwise there will be problems if $ROOT or $PORTAGE_CONFIGROOT contain spaces.
Comment 3 Zac Medico gentoo-dev 2006-10-09 20:08:20 UTC
Thanks, your patch is in svn r4645.  I didn't bother to quote them because there's other path handling that's already unsafe for spaces.  We can fix that in a separate patch I guess.
Comment 4 Zac Medico gentoo-dev 2006-10-10 14:41:35 UTC
This has been release in 2.1.2_pre2-r8.
Comment 5 Alex V. Koval 2007-04-29 05:05:19 UTC
This update causes double slash being inserted in this place:
+		path="${ROOT}/${path}"

So CONFIG_PROTECT_MASK is being ignored after that since it does not compare //<path> to /<path>
Comment 6 Zac Medico gentoo-dev 2007-04-29 05:26:48 UTC
(In reply to comment #5)
> This update causes double slash being inserted in this place:
> +               path="${ROOT}/${path}"

I think that's been fixed since bug 166837.
Comment 7 Alex V. Koval 2007-04-29 10:12:31 UTC
Zac, you are correct, it is fixed in 166837. But do you agree that fix provided is a correct fix to the problem?

But in my opinion, this bug fixes consequences, and does not fix the real (software design) problem. Much better to use a correct variable from beginning, vs. patching it every time you need to compare.

Something like this would work much better:

*** etc-update.orig     2007-04-29 13:00:27.000000000 +0300
--- etc-update  2007-04-29 13:01:10.000000000 +0300
***************
*** 44,49 ****
--- 44,50 ----
  
        for path in ${CONFIG_PROTECT} ; do
                path="${ROOT}${path}"
+               path=$(echo $path|sed -e "s://:/:g")
                find_opts="-iname ._cfg????_*"
                if [ ! -d "${path}" ]; then
                        [ ! -f "${path}" ] && continue


So, this removes problem, and makes $path variable availave for comparision
and any other action not only in CONFIG_PROTECT_MASK block, but anywhere in the code.

So, we actually had 1 problem before, now we have a problem & a half-fix for the problem.