diff options
author | Erich Eckner <git@eckner.net> | 2021-08-10 19:02:30 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2021-08-10 19:02:30 +0200 |
commit | 8eeb9ff1a1c0f27ff5ff49bd5079b68d6fea1ef2 (patch) | |
tree | 462c99c0fcdd25ec3909a5062716d0c552ef9e75 /archPackagesUpdate | |
parent | 9694a103d14d20a04b6ad863bfc30a066e97ac95 (diff) | |
download | archlinuxewe-8eeb9ff1a1c0f27ff5ff49bd5079b68d6fea1ef2.tar.xz |
archPackagesUpdate: do not downgrade packages
Diffstat (limited to 'archPackagesUpdate')
-rwxr-xr-x | archPackagesUpdate | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/archPackagesUpdate b/archPackagesUpdate index b45f25b66..36ef176c4 100755 --- a/archPackagesUpdate +++ b/archPackagesUpdate @@ -354,7 +354,10 @@ else | sed ' s@^\([^/]\+/\)[^/]\+\(/[^/]\+-any\.pkg\.tar\.\(xz\|zst\)\)$@\0\n\1any\2@ ' \ - | sort -u + | sed ' + s@^\(\S\+\)-\([^-]\+-[^-]\+\)-\([^-]\+\)$@\2 \1-\3@ + ' \ + | sort -k2,2 -u ) fi @@ -408,11 +411,21 @@ for paket in $( \ [ "${singleArch}" == "any" ] || \ continue - pkgFile="${pkgnam}-${epoch:+${epoch}:}${pkgver}-${pkgrel}-${singleArch}.pkg.tar.zst" - if ! printf '%s\n' "${available_packages}" 2>/dev/null \ - | grep -qxF "${repo}/${singleArch}/${pkgFile}"; then - printf '%s\n' "${singleArch}" + pkgFile_a="${epoch:+${epoch}:}${pkgver}-${pkgrel}" + pkgFile_b="${repo}/${singleArch}/{pkgnam}-${singleArch}.pkg.tar.zst" + if printf '%s\n' \ + "${available_packages}" \ + | cut -d' ' -f2 \ + | grep -qxF "${pkgFile_b}" \ + && printf '%s\n' \ + "${available_packages}" \ + "${pkgFile_a} ${pkgFile_b}" \ + | sort -k2,2 -k1V,1 \ + | uniq -df1 \ + | grep -qxF "${pkgFile_a} ${pkgFile_b}"; then + continue fi + printf '%s\n' "${singleArch}" done |