aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/_gentoo_repos')
-rw-r--r--src/_gentoo_repos44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/_gentoo_repos b/src/_gentoo_repos
index 3419cdc..7f88a64 100644
--- a/src/_gentoo_repos
+++ b/src/_gentoo_repos
@@ -1,40 +1,40 @@
#autoload
# Usage:
-# _gentoo_repos -> returns the main repo (with PORTDIR fallback)
-# _gentoo_repos -o -> returns the list of non-main repos (with PORTDIR_OVERLAY fallback)
+# _gentoo_repos -> returns the list of all repos
+# _gentoo_repos -m -> returns the main repo
+# _gentoo_repos -o -> returns the list of non-main repos
_gentoo_repos() {
- local main_repo main_repo_path overlay overlay_path
+ local main_repo main_repo_path overlay overlay_paths
if [[ -e /usr/share/portage/config/repos.conf ]]; then
- if [[ ${1} == "-o" ]]; then
- for overlay in $(_repos_conf -l); do
- overlay_path+=($(_repos_conf ${overlay} location))
- done
+ main_repo=$(_repos_conf DEFAULT main-repo)
+ main_repo_path=$(_repos_conf ${main_repo} location)
- source /etc/make.conf 2>/dev/null
- source /etc/portage/make.conf 2>/dev/null
+ for overlay in $(_repos_conf -l); do
+ overlay_paths+=($(_repos_conf ${overlay} location))
+ done
- overlay_path+=(${(@)PORTDIR_OVERLAY})
-
- echo "${(@u)overlay_path}"
- else
- main_repo=$(_repos_conf DEFAULT main-repo)
- main_repo_path=$(_repos_conf ${main_repo} location)
+ source /etc/make.conf 2>/dev/null
+ source /etc/portage/make.conf 2>/dev/null
- echo "${main_repo_path}"
- fi
+ overlay_paths+=(${(@)PORTDIR_OVERLAY})
else
source /usr/share/portage/config/make.globals 2>/dev/null
source /etc/make.conf 2>/dev/null
source /etc/portage/make.conf 2>/dev/null
- if [[ ${1} == "-o" ]]; then
- echo "${(@u)PORTDIR_OVERLAY}"
- else
- echo "${PORTDIR}"
- fi
+ main_repo_path="${PORTDIR}"
+ overlay_paths=(${(@)PORTDIR_OVERLAY})
+ fi
+
+ if [[ $1 == "-m" ]]; then
+ echo "${main_repo_path}"
+ elif [[ $1 == "-o" ]]; then
+ echo "${(@u)overlay_paths}"
+ else
+ echo "${main_repo_path} ${(@u)overlay_paths}"
fi
}