Last active
December 27, 2015 02:09
-
-
Save Mic92/7250403 to your computer and use it in GitHub Desktop.
Etckeeper Wrapper for pacman and yaourt
This file contains hidden or 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/bash | |
if [[ "$1" != -S && "$1" != -S*u && "$1" != -U ]]; then | |
/usr/bin/pacman "$@" | |
exit $? | |
fi | |
[[ $EUID -eq 0 ]] && etckeeper pre-install | |
/usr/bin/pacman "$@" | |
EXIT_CODE=$? | |
[[ $EUID -eq 0 ]] && etckeeper post-install | |
exit $EXIT_CODE |
This file contains hidden or 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/bash | |
if [[ "$1" == -Q* ]]; then | |
/usr/bin/yaourt "$@" | |
exit $? | |
fi | |
sudo etckeeper pre-install | |
/usr/bin/yaourt "$@" | |
EXIT_CODE=$? | |
sudo etckeeper post-install | |
exit $EXIT_CODE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Aren't these conceptually backwards? It seems like
"$1" != -Q*
should be"$1" == -Q*
. The point is to not run etckeeper when just querying the package manage rather that making potential changes correct?