Skip to content

Instantly share code, notes, and snippets.

@ScoreUnder
Created June 26, 2023 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ScoreUnder/9c2129c2546db2c16b069287cc54a128 to your computer and use it in GitHub Desktop.
Save ScoreUnder/9c2129c2546db2c16b069287cc54a128 to your computer and use it in GitHub Desktop.
Find bad Python AUR packages on Arch Linux
#!/bin/sh
# Find bad Python AUR packages on Arch Linux
# Simply run the script and it should show you what needs updating
# Non-destructive. Arch Linux only. Will show incorrect results when multiple Python versions are installed side by side.
# Intended to provide tech support to people updating complex python projects from the AUR
real_python_dir=$(pacman -Ql python | grep /usr/lib/python | head -1 | cut -d/ -f-4 | cut -d' ' -f2)
set -- /usr/lib/python3.*
for d do
if [ -e "$d" ] && [ "$d" != "$real_python_dir" ]; then
set -- "$@" "$d"
fi
shift
done
if [ "$#" -ne 0 ]; then
printf '\033[1;31m%s\033[0m\n' 'WARNING: You have out-of-date python packages, as follows:'
pacman -Qo -- "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment