diff --git a/smoketest/scenarios/50-stale-system.sh b/smoketest/scenarios/50-stale-system.sh index c5d1f34..0e576c7 100644 --- a/smoketest/scenarios/50-stale-system.sh +++ b/smoketest/scenarios/50-stale-system.sh @@ -9,11 +9,22 @@ scenario() { date="$(date -d '30 days ago' +%Y/%m/%d)" # Go back to Arch as it was a month ago, from the Arch Linux Archive, which - # is also a mirror that stopped syncing a month ago + # is also a mirror that stopped syncing a month ago. Packages from Arch's + # repos that the archive doesn't have yet, often split off since (e.g. + # clang-libs from clang), go first: their files conflict with the old + # packages'. update installs them again run_in_vm downgrade "set -e + pacman -Qqn | sort > ~/native-now echo 'Server = https://archive.archlinux.org/repos/$date/\$repo/os/\$arch' \ | sudo tee /etc/pacman.d/mirrorlist - sudo pacman -Syyuu --noconfirm" + sudo pacman -Syy + newer=\"\$(pacman -Qqm | sort | comm -12 ~/native-now -)\" + rm ~/native-now + if [ -n \"\$newer\" ]; then + echo \"Not in the archive yet, removing: \"\$newer + sudo pacman -Rdd --noconfirm \$newer + fi + sudo pacman -Suu --noconfirm" [ "$STATUS" -eq 0 ] || skip "couldn't downgrade to Arch as of $date (see $LAST_LOG)" vm_reboot kernel_before="$(vm_value 'uname -r')"