Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 677246 - sys-apps/portage: prefixify etc-update and simplify Prefix logic.
Summary: sys-apps/portage: prefixify etc-update and simplify Prefix logic.
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Deadline: 2019-02-11
Assignee: Portage team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-02-04 08:26 UTC by Benda Xu
Modified: 2019-05-29 19:41 UTC (History)
0 users

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


Attachments
portage-prefix.patch (portage-prefix.patch,2.50 KB, patch)
2019-02-04 08:26 UTC, Benda Xu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benda Xu gentoo-dev 2019-02-04 08:26:10 UTC
Created attachment 563708 [details, diff]
portage-prefix.patch

Hi, I would like to commit the attached patch to prefixify etc-update.  At present etc-update reads the host /etc/os-release and thus fails identify Gentoo.

In addition, with the help of hprefixify() from prefix.eclass, other related Prefix `sed` clauses are simplified.

Please review. If there is no objections in 1 week, I will commit it to the tree.

Thank you!

Yours,
Benda
Comment 1 Zac Medico gentoo-dev 2019-02-04 17:23:08 UTC
(In reply to Benda Xu from comment #0)
> Created attachment 563708 [details, diff] [details, diff]
> portage-prefix.patch

I've tested this patch, and it doesn't apply the necessary changes. I checked EPREFIX in const.py, and 'location = /usr/portage' in conf/repos.conf, and neither one was patched.
Comment 2 Benda Xu gentoo-dev 2019-02-05 05:26:35 UTC
(In reply to Zac Medico from comment #1)
> (In reply to Benda Xu from comment #0)
> > Created attachment 563708 [details, diff] [details, diff] [details, diff]
> > portage-prefix.patch
> 
> I've tested this patch, and it doesn't apply the necessary changes. I
> checked EPREFIX in const.py, and 'location = /usr/portage' in
> conf/repos.conf, and neither one was patched.

Thank Zac.  I find it otherwise.  

For cnf.repos.conf, I see 'location = /usr/portage' is prepended with EPREFIX.

For const.py:

1. The revision has 1-1 feature correspondence to the previous one, the previous one only patched the "*_BINARY", no other PATHs.

2. DEPCACHE_PATH and GLOBAL_CONFIG_PATH should be the without-prefix version, as the comments says:

# these variables get EPREFIX prepended automagically when they are
# translated into their lowercase variants
DEPCACHE_PATH            = "/var/cache/edb/dep"
GLOBAL_CONFIG_PATH       = "/usr/share/portage/config"

Therefore I think my patch is correct.

Yours,
Benda
Comment 3 Benda Xu gentoo-dev 2019-03-19 15:27:31 UTC
Ping Portage Team.
Comment 4 Zac Medico gentoo-dev 2019-03-20 00:45:27 UTC
Hi Benda,

If it works for you then please go ahead and commit it. I probably just didn't test it correctly.

Thanks!
Comment 5 Larry the Git Cow gentoo-dev 2019-03-20 02:04:53 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4a709ce51b8ab874c355c7edae8a56ba34cb985

commit b4a709ce51b8ab874c355c7edae8a56ba34cb985
Author:     Benda Xu <heroxbd@gentoo.org>
AuthorDate: 2019-03-20 01:56:19 +0000
Commit:     Benda Xu <heroxbd@gentoo.org>
CommitDate: 2019-03-20 02:02:46 +0000

    sys-apps/portage: prefixify etc-update and simplify Prefix logic.
    
    Closes: https://bugs.gentoo.org/677246
    Package-Manager: Portage-2.3.52, Repoman-2.3.12
    Signed-off-by: Benda Xu <heroxbd@gentoo.org>

 sys-apps/portage/portage-2.3.62-r1.ebuild | 259 ++++++++++++++++++++++++++++++
 1 file changed, 259 insertions(+)
Comment 6 Zac Medico gentoo-dev 2019-05-29 19:41:55 UTC
(In reply to Zac Medico from comment #1)
> (In reply to Benda Xu from comment #0)
> > Created attachment 563708 [details, diff] [details, diff] [details, diff]
> > portage-prefix.patch
> 
> I've tested this patch, and it doesn't apply the necessary changes. I
> checked EPREFIX in const.py, and 'location = /usr/portage' in
> conf/repos.conf, and neither one was patched.

I probably just had the prefix USE flag masked, and that causes hprefixify to return early.