summaryrefslogtreecommitdiffstats
path: root/scripts/layman_reinit.sh
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-09-01 01:44:35 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-09-01 01:44:35 +0200
commita2801d087415e0da6b06877e609a75029829d581 (patch)
tree576528fe584fd2b28c60fce7fdb45f447d9f955b /scripts/layman_reinit.sh
parent016f9ba4fa9664300edeebc2f8f396cf023d5390 (diff)
downloadgentoo-a2801d087415e0da6b06877e609a75029829d581.tar.gz
gentoo-a2801d087415e0da6b06877e609a75029829d581.tar.bz2
gentoo-a2801d087415e0da6b06877e609a75029829d581.tar.xz
gentoo-a2801d087415e0da6b06877e609a75029829d581.zip
Fix layman script
Diffstat (limited to 'scripts/layman_reinit.sh')
-rw-r--r--scripts/layman_reinit.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/layman_reinit.sh b/scripts/layman_reinit.sh
new file mode 100644
index 0000000..64d14d0
--- /dev/null
+++ b/scripts/layman_reinit.sh
@@ -0,0 +1,13 @@
+#! /bin/bash
+
+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
+
+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
+
+git checkout -- /etc/portage/repos.conf/layman.conf