Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 828606

Summary: app-eselect/eselect-repository: multiple issues
Product: Gentoo Linux Reporter: Charlie Gehlin <charlie>
Component: Current packagesAssignee: Michał Górny <mgorny>
Status: UNCONFIRMED ---    
Severity: normal CC: 1i5t5.duncan, monsieurp, sam, shawnbon206
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=776934
https://bugs.gentoo.org/show_bug.cgi?id=562626
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to ignore files ending in ~ in /etc/portage/repos.conf

Description Charlie Gehlin 2021-12-09 11:37:52 UTC
First, please either disable the use of ~-files in /etc/portage/repos.conf/ when eselect disables a repository _OR_ make [preferred-shell]-completion ignore those ~-files upon completing package-matchings. I'm having trouble with bash myself, but saw bug regarding zsh as well.

Second, 'eselect repository disable [repo]' forgets to remove some newline(s) from /etc/portage/repos.conf/eselect-repo.conf making the file larger and larger with newlines as one enables and disables repositories. I suggest either removing empty newlines with the 'eselect repository disable'-command _OR_ simply handle each added/removed repository with their own files all together. Again both seems to have been suggested in past bugreports.

BR /Charlie
Comment 1 shawnbon206 2022-01-14 13:58:48 UTC
Created attachment 762159 [details, diff]
patch  to ignore files ending in ~ in /etc/portage/repos.conf

/usr/share/bash-completion/helpers/gentoo-common.sh is the script with the issue, here is one potential fix by adding && ${f} != *~ in with the [[ -f ${f} ]]
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-22 05:36:38 UTC
(In reply to Sam James from comment #2)
> I think this is fixed by
> https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/
> ?id=f3f401b1166bb3d7f79b9f3cb8ebfc3527cd4394?

This is reverting the previous commit https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=7052f3bab2abeb620733fff21b2809429bacc554 (bug 562626).

So, it might just be a better idea to disable backup files in eselect-repository after all.
Comment 4 Duncan 2022-03-23 06:23:34 UTC
(In reply to Sam James from comment #3)
> (In reply to Sam James from comment #2)
> > I think this is fixed by
> > https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/
> > ?id=f3f401b1166bb3d7f79b9f3cb8ebfc3527cd4394?
> 
> This is reverting the previous commit
> https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/
> ?id=7052f3bab2abeb620733fff21b2809429bacc554 (bug 562626).

Indeed (well, that plus a similar change in a different spot).

From the git commit entry for the newer patch:

>>> portage ignores any file in /etc/portage/repos.conf/
>>> (when that is in fact a directory) that does not
>>> have a name of the form "*.conf".

Except portage doesn't ignore non-*.conf files in repos.conf. Thus my bug # 562626 with the patch that is now reverted.  And I know that hasn't changed as my repos.conf/* files still have no extension (just like the examples in the documentation, as I point out in the earlier bug), and portage definitely continues to see and use those repos.

>>> gentoo-bashcomp should emulate the behavior of portage. 

Agreed.

> So, it might just be a better idea to disable backup files in
> eselect-repository after all.

Can't disagree. =:^)

Maybe have a different dir, repos.conf.disabled/ or repos.conf.bak/ or some such, instead of renaming files to disable-in-place?  I do something similar with /etc/portage/patches/ files.