Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 562626 - app-shells/gentoo-bashcomp-20180302: helpers/gentoo-common.sh _parsereposconf ignores non-*.conf repos.conf files
Summary: app-shells/gentoo-bashcomp-20180302: helpers/gentoo-common.sh _parsereposconf...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Shell Tools project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-09 07:51 UTC by Duncan
Modified: 2022-03-22 05:34 UTC (History)
0 users

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


Attachments
patch to gentoo-common.sh (app-shells.gentoo-bashcomp.parsereposconf.allfiles.patch,550 bytes, patch)
2019-01-01 05:33 UTC, Duncan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan 2015-10-09 07:51:45 UTC
So I just reorganized my repos.conf/* files and portage itself worked fine, but its bash-completion broke.  =:^(

The error was something about a missing /usr/portage, which is indeed the case, since there's no such directory -- my remote-based repos are located in directories /p/$reponame (/p being a separate partition only mounted when I'm working with portage or the kernel), with /l/p being my local repo/overlay, but my portage and repos configuration seems to be working fine, so why was it trying to use the default location?

After some troubleshooting I found that _parsereposeconf wasn't picking up the repos configuration due to this in /usr/share/bash-completion/helpers/gentoo-common.sh on lines 66-68:

    for f in /usr/share/portage/config/repos.conf \
        /etc/portage/repos.conf \
        /etc/portage/repos.conf/*.conf; do

The problem is the *.conf glob on line 68.  From the portage (5) manpage (whitespace reformatted for posting):

/etc/portage/

Files in this directory including make.conf, repos.conf, and any file with a name that begins with "package." can be more than just a flat file.  If it is a directory, then all the files in that directory will be sorted in ascending alphabetical order by file name and summed together as if it were  a  single file.

Example:
/etc/portage/package.accept_keywords/common
/etc/portage/package.accept_keywords/e17
/etc/portage/package.accept_keywords/kde

[end quote]

Where does it say only *.conf files in a directory already itself named with that pattern?  It doesn't, neither here, nor under the repos.conf description itself.  In fact, the example's lack of file extensions strongly suggest that they aren't required.  It's not e17.conf, kde.keywords, or common.accept_keywords.

And in fact, portage itself doesn't care about the presence or lack of such extensions.  It uses filenames without extensions such as gentoo, kde, default, etc, in /etc/portage/repos.conf/, parsing and honoring their content without complaint.

So that *.conf glob in the autocomplete is making an unwarranted assumption, screwing up autocomplete for users attempting to use a naming scheme that doesn't fit the *.conf glob.

Please simply delete the .conf part, making it a simple * glob.  Optionally ignore common backup file naming globs (*.bak, *~, etc, tho I'm not sure portage ignores them, the documentation doesn't /say/ it does, tho arguably it /should/ ignore them), but don't parse only *.conf files, as portage itself has no such requirement, and thus neither should its autocomplete helper.

Thanks. =:^)
Comment 1 Duncan 2019-01-01 04:57:43 UTC
3+ years and the bug still exists with gentoo-bashcomp-20180302, and not even a comment from the maintainer (equery meta says shell-tools@), either.

And it's trivial to fix.  Anyone even in shell-tools any longer?  Unmaintained?
Comment 2 Duncan 2019-01-01 05:33:57 UTC
Created attachment 559212 [details, diff]
patch to gentoo-common.sh

Here's the patch I put in /etc/portage/patches/app-shells/gentoo-bashcomp.
Comment 3 Larry the Git Cow gentoo-dev 2019-02-10 23:04:26 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=7052f3bab2abeb620733fff21b2809429bacc554

commit 7052f3bab2abeb620733fff21b2809429bacc554
Author:     Patrice Clement <monsieurp@gentoo.org>
AuthorDate: 2019-02-10 23:02:43 +0000
Commit:     Patrice Clement <monsieurp@gentoo.org>
CommitDate: 2019-02-10 23:04:09 +0000

    fix repos.conf files pattern matching.
    
    Courtesy of Duncan <1i5t5.duncan@cox.net>.
    
    Closes: https://bugs.gentoo.org/562626
    Signed-off-by: Patrice Clement <monsieurp@gentoo.org>

 helpers/gentoo-common.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 4 Larry the Git Cow gentoo-dev 2019-02-10 23:11:37 UTC
The bug has been referenced in the following commit(s):

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

commit 05b7292e4392abd73086c2e8e631a9dcc043e4a3
Author:     Patrice Clement <monsieurp@gentoo.org>
AuthorDate: 2019-02-10 23:08:13 +0000
Commit:     Patrice Clement <monsieurp@gentoo.org>
CommitDate: 2019-02-10 23:11:27 +0000

    app-shells/gentoo-bashcomp: version bump.
    
    Bug: https://bugs.gentoo.org/562626
    Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
    Package-Manager: Portage-2.3.51, Repoman-2.3.11

 app-shells/gentoo-bashcomp/Manifest                 |  1 +
 .../gentoo-bashcomp/gentoo-bashcomp-20190211.ebuild | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)