diff options
Diffstat (limited to 'libredbdiff-standalone')
-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]} |