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

Bug 730624

Summary: app-shells/gentoo-bashcomp-20190211 : skip the ~ ending files (backup file) in /etc/portage/repos.conf
Product: Gentoo Linux Reporter: Marco Genasci <fedeliallalinea>
Component: Current packagesAssignee: Gentoo Shell Tools project <shell-tools>
Status: RESOLVED FIXED    
Severity: normal CC: gentoo, imatiimba, jernej.jakob, Lolo.Gentoo, lssndrbarbieri, m1027, redblade7, redneb, sam, telans, till2.schaefer
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=722304
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 834038    
Bug Blocks:    
Attachments: Patch
Reverts the previous incorrect patch, and fixes the bug by ignoring backup prefixed and suffixed files.

Description Marco Genasci 2020-07-03 19:03:43 UTC
New gentoo-bashcomp version loop all files in /etc/portage/repos.conf (old version only *.conf files).
This is a good thing but can be skip backup file (~ ending file)? This can cause an issue, see [1]
A solution is list files ending with a character with '/etc/portage/repos.conf/*[a-zA-Z]'.

[1] https://forums.gentoo.org/viewtopic-t-1115760.html

Reproducible: Always
Comment 1 James Beddek 2020-07-09 09:41:54 UTC
Removing the backup file also solved this issue for me, thanks.

Reference: https://forums.gentoo.org/viewtopic-t-1115990.html
Comment 2 Till Schäfer 2020-07-15 11:26:39 UTC
This leads to completion errors in various tools after deleting a repo with eselect-repository. 

Example: 

$ equery uses <TAB> bash: cd: /var/db/repos/snapd: No such file or directory
bash: cd: /var/db/repos/snapd: No such file or directory
Comment 3 redneb 2021-11-16 15:55:06 UTC
Created attachment 751722 [details, diff]
Patch

Here's a patch that fixes this issue. I also posted it a PR in Github in case that helps: https://github.com/gentoo/gentoo-bashcomp/pull/5
Comment 4 Ken Rushia 2022-02-25 18:05:47 UTC
(In reply to redneb from comment #3)
> Created attachment 751722 [details, diff] [details, diff]
> Patch
> 
> Here's a patch that fixes this issue. I also posted it a PR in Github in
> case that helps: https://github.com/gentoo/gentoo-bashcomp/pull/5

That patch will reopen bug 562626. I believe the line in question should read something like:
@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*~

...but to be sure, I made a new bug 834038 that will hopefully clarify things.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-02-25 18:10:11 UTC
(In reply to Ken Rushia from comment #4)
> (In reply to redneb from comment #3)
> > Created attachment 751722 [details, diff] [details, diff] [details, diff]
> > Patch
> > 
> > Here's a patch that fixes this issue. I also posted it a PR in Github in
> > case that helps: https://github.com/gentoo/gentoo-bashcomp/pull/5
> 
> That patch will reopen bug 562626. I believe the line in question should
> read something like:
> @GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*~
> 
> ...but to be sure, I made a new bug 834038 that will hopefully clarify
> things.

The patch was merged (without updating the bug) so could you submit a new one?
Comment 6 Jernej Jakob 2022-06-07 13:51:39 UTC
Created attachment 783368 [details, diff]
Reverts the previous incorrect patch, and fixes the bug by ignoring backup prefixed and suffixed files.

This should fix the bug.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-22 02:03:24 UTC
(In reply to Jernej Jakob from comment #6)
> Created attachment 783368 [details, diff] [details, diff]
> Reverts the previous incorrect patch, and fixes the bug by ignoring backup
> prefixed and suffixed files.
> 
> This should fix the bug.

Thank you. Could you include your Signed-off-by here please?
Comment 8 Larry the Git Cow gentoo-dev 2023-01-14 16:39:37 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=184a51233d05f7b45a3c3fc73782be600add6000

commit 184a51233d05f7b45a3c3fc73782be600add6000
Author:     Jernej Jakob <jernej.jakob+gentoo@gmail.com>
AuthorDate: 2022-06-07 13:44:35 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-01-14 16:39:34 +0000

    Ignore backup prefixed or suffixed files in repos.conf subdirectory.
    
    Portage ignores any files starting with '.' or ending with '~' in
    the repos.conf directory.
    
    See 'portage.util' function '_recursive_basename_filter'.
    
    Closes: https://bugs.gentoo.org/730624
    Signed-off-by: Sam James <sam@gentoo.org>

 helpers/gentoo-common.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 9 Erik Quaeghebeur 2023-03-12 22:46:06 UTC
Can you make a new release to get this out to users being bothered by the bug?
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-13 21:19:28 UTC
*** Bug 870373 has been marked as a duplicate of this bug. ***
Comment 11 Larry the Git Cow gentoo-dev 2023-03-13 21:23:51 UTC
The bug has been referenced in the following commit(s):

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

commit 81aa9d9a0ee5f9f33fb9ab1f591c79f1fb134ffd
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-03-13 21:23:21 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-03-13 21:23:33 +0000

    app-shells/gentoo-bashcomp: add 20230313
    
    Bug: https://bugs.gentoo.org/730624
    Bug: https://bugs.gentoo.org/870373
    Bug: https://bugs.gentoo.org/834038
    Signed-off-by: Sam James <sam@gentoo.org>

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