commit:     f3f401b1166bb3d7f79b9f3cb8ebfc3527cd4394
Author:     redneb <redneb <AT> gmx <DOT> com>
AuthorDate: Tue Nov 16 15:42:15 2021 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Tue Nov 16 16:08:23 2021 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=f3f401b1

ignore non conf files in /etc/portage/repos.conf.

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".

gentoo-bashcomp should emulate the behavior of portage. Otherwise you
might run into issues: e.g. if there is a backup of eselect-repo.conf
called eselect-repo.conf~ that contains references to a now removed
overlay, gentoo-bashcomp should not try to search for completions in the
now nonexistent repo directory

Closes: https://github.com/gentoo/gentoo-bashcomp/pull/5
Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>

 helpers/gentoo-common.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/helpers/gentoo-common.sh b/helpers/gentoo-common.sh
index 6e8d51c..9424ad6 100644
--- a/helpers/gentoo-common.sh
+++ b/helpers/gentoo-common.sh
@@ -7,7 +7,7 @@
 # Retrieve PORTDIR/PORTDIR_OVERLAY location.
 #
 # In order of highest to lowest priority:
-# /etc/portage/repos.conf{,/*}
+# /etc/portage/repos.conf{,/*.conf}
 # /usr/share/portage/config/repos.conf
 # /etc/portage/make.conf
 # /etc/make.conf
@@ -65,7 +65,7 @@ _parsereposconf() {
 
     for f in @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf \
         @GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf \
-        @GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*; do
+        @GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*.conf; do
 
         [[ -f ${f} ]] || continue
         insection=0

Reply via email to