summaryrefslogtreecommitdiffstats
path: root/scripts/bootstrap/layman_reinit.sh
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-09-01 02:50:10 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-09-01 02:50:10 +0200
commit359b7fb5959b2a8874772c46477fe034d3030102 (patch)
treeadc4c8c39febfeff06898bc106de7fae6055528e /scripts/bootstrap/layman_reinit.sh
parent3a86190d188e2910dad6e2731ac7d245241555aa (diff)
downloadgentoo-359b7fb5959b2a8874772c46477fe034d3030102.tar.gz
gentoo-359b7fb5959b2a8874772c46477fe034d3030102.tar.bz2
gentoo-359b7fb5959b2a8874772c46477fe034d3030102.tar.xz
gentoo-359b7fb5959b2a8874772c46477fe034d3030102.zip
Some reshuffle to easier migrate between local and remote systems
Diffstat (limited to 'scripts/bootstrap/layman_reinit.sh')
-rw-r--r--scripts/bootstrap/layman_reinit.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/bootstrap/layman_reinit.sh b/scripts/bootstrap/layman_reinit.sh
new file mode 100644
index 0000000..ce88379
--- /dev/null
+++ b/scripts/bootstrap/layman_reinit.sh
@@ -0,0 +1,19 @@
+#! /bin/bash
+
+(
+ repos=$(xmllint -xpath "//repo/name/text()|//repo/source/text()" /etc/portage/layman.xml | xargs -n2)
+
+ cd /etc/portage
+
+ layman -d ALL
+ 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 -- layman.xml
+)