Last active
April 5, 2018 13:56
-
-
Save abenson/51193d4c93a29589d3376dbe02c02ee2 to your computer and use it in GitHub Desktop.
Check for available packages on Void
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# xupavail - counts the number of packages available for update | |
SUDO= | |
if command -v sudo >/dev/null && | |
sudo -l | grep -q -e ' ALL$' -e xbps-install; then | |
SUDO=sudo | |
elif [ "$(whoami)" != root ]; then | |
SUDO='su root -c '\''"$@"'\'' -- -' | |
fi | |
$SUDO xbps-install -SMun "$@" | grep -v hold | wc -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment