summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-09-01 01:52:51 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-09-01 01:52:51 +0200
commit3a86190d188e2910dad6e2731ac7d245241555aa (patch)
tree3d8e85df2135b30331a9d7f599040306fb517a0d /scripts
parenta2801d087415e0da6b06877e609a75029829d581 (diff)
downloadgentoo-3a86190d188e2910dad6e2731ac7d245241555aa.tar.gz
gentoo-3a86190d188e2910dad6e2731ac7d245241555aa.tar.bz2
gentoo-3a86190d188e2910dad6e2731ac7d245241555aa.tar.xz
gentoo-3a86190d188e2910dad6e2731ac7d245241555aa.zip
More improvements of layman script
Diffstat (limited to 'scripts')
-rw-r--r--scripts/layman_reinit.sh24
1 files changed, 16 insertions, 8 deletions
diff --git a/scripts/layman_reinit.sh b/scripts/layman_reinit.sh
index 64d14d0..6729149 100644
--- a/scripts/layman_reinit.sh
+++ b/scripts/layman_reinit.sh
@@ -1,13 +1,21 @@
#! /bin/bash
-repos=$(xmllint -xpath "//repo/name/text()|//repo/source/text()" /etc/portage/layman.xml | xargs -n2)
+(
+ repos=$(xmllint -xpath "//repo/name/text()|//repo/source/text()" /etc/portage/layman.xml | xargs -n2)
-layman -d ALL
-git checkout -- /etc/portage/repos.conf/layman.conf
+ cd /etc/portage
+
+ layman -d ALL
+ git checkout -- layman.xml
-for repo in $(cat /etc/portage/repos.conf/layman.conf | grep -oP "\[\K[^]]*"); do
- repo_src=$(echo "$repos" | grep -P "^$repo" | awk '{ print $2 }')
- layman -a "$repo" -O "$repo_src"
-done
+ for repo in $(cat /etc/portage/repos.conf/layman.conf | grep -oP "\[\K[^]]*"); do
+ repo_src=$(echo "$repos" | grep -P "^$repo" | awk '{ print $2 }')
+ if [ -n "$repo_src" ]; then
+ layman -a "$repo" -O "$repo_src"
+ else
+ layman -a "$repo"
+ fi
+ done
-git checkout -- /etc/portage/repos.conf/layman.conf
+ git checkout -- layman.xml
+)