diff options
author | Esteban Carnevale <alfplayer@mailoo.org> | 2014-12-16 13:23:08 -0300 |
---|---|---|
committer | Esteban Carnevale <alfplayer@mailoo.org> | 2014-12-16 16:45:13 -0300 |
commit | e2b688407eae8db10340de47da777d5330bbaa6a (patch) | |
tree | 247e9eb355456a412a5c5910fa2f2a30d12b08f4 | |
parent | 327178f593fa6e06ee7ab7489687ce1ff8e082b2 (diff) |
libredbdiff-standalone: Fix and improve support for multiple repos
-rwxr-xr-x | libredbdiff-standalone | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libredbdiff-standalone b/libredbdiff-standalone index f82e65f..859f862 100755 --- a/libredbdiff-standalone +++ b/libredbdiff-standalone @@ -22,6 +22,8 @@ mirrorlistarch="$baseconfpath/mirrorlist.archlinux" mirror='http://repo.parabola.nu/$repo/os/$arch' mirrorarch='http://mirrors.kernel.org/archlinux/$repo/os/$arch' +repos="libre pcr libre-multilib nonprism" + error() { echo -e "Error. $@" > /dev/stderr ; exit 1; } @@ -68,7 +70,11 @@ if (( $UPDATE )) ; then if [[ $? == 255 ]] ; then sed -i "s|^#DBPath .*|DBPath = ${dbpath}|" "${conffile}" echo "Enabling nonprism repo in ${conffile}" - sed -i 's|^# after the header, and they will be used before the default mirrors.|# after the header, and they will be used before the default mirrors.\n\n[nonprism]\nInclude = /etc/pacman.d/mirrorlist|' "${conffile}" + sed -i "s/\#\[nonprism\]/[nonprism]/" "${conffile}" + sed -i "\/\[nonprism\]/,+1 s/#Include/Include/" "${conffile}" + echo "Enabling pcr repo in ${conffile}" + sed -i "s/\#\[pcr\]/[pcr]/" "${conffile}" + sed -i "\/\[pcr\]/,+1 s/#Include/Include/" "${conffile}" echo "Enabling libre-multilib repo in ${conffile}" sed -i "s/\#\[libre-multilib\]/[libre-multilib]/" "${conffile}" sed -i "\/\[libre-multilib\]/,+1 s/#Include/Include/" "${conffile}" @@ -172,9 +178,11 @@ while read -a line ; do verarch["${line[0]}"]="${line[1]}" done < <(pacman --dbpath "${dbpatharch}" --config "${conffilearch}" -Ss | grep -v '^ ' | awk -F/ '{print $2}') -for repo in libre pcr libre-multilib nonprism ; do +expac --config "${conffile}" -S '%r/%n %v %S' > /tmp/${name}.parabola-packages + +for repo in ${repos} ; do echo "[$repo]" - expac --config "${conffile}" -S '%r/%n %v %S' | awk -F/ '$1 == "libre" {print $2}' | while read -a line ; do + awk -F/ -v repo="$repo" '$1 == repo {print $2}' /tmp/${name}.parabola-packages | while read -a line ; do ver["${line[0]}"]="${line[1]}" provides[${line[0]}]="${line[@]:2}" pkgname=${line[0]} |