Skip to content

Instantly share code, notes, and snippets.

@Mic92
Last active December 27, 2015 02:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Mic92/7250403 to your computer and use it in GitHub Desktop.
Save Mic92/7250403 to your computer and use it in GitHub Desktop.
Etckeeper Wrapper for pacman and yaourt
#!/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
#!/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
@alerque
Copy link

alerque commented Mar 14, 2014

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?

@Mic92
Copy link
Author

Mic92 commented Jun 13, 2015

@alerque correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment