summaryrefslogtreecommitdiffstats
path: root/scripts/layman_reinit.sh
blob: 64d14d0bf4fef7ed88f2f9b7a9dab4cfc0b1ef54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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