Skip to content

Instantly share code, notes, and snippets.

@namelessjon
Created March 1, 2011 10:20
Show Gist options
  • Save namelessjon/848942 to your computer and use it in GitHub Desktop.
Save namelessjon/848942 to your computer and use it in GitHub Desktop.
script to diff local PKGBUILD with AUR pkgbuild
#!/bin/bash
# Source: https://bbs.archlinux.org/viewtopic.php?pid=853603#p853603
# Author: falconindy
DIFF=${DIFF:-diff}
if [[ ! -f PKGBUILD ]]; then
echo "error: No PKGBUILD found in working directory."
exit 1
fi >&2
eval $(grep '^pkgname=' PKGBUILD)
if [[ -z $pkgname ]]; then
echo "error: pkgname not found in PKGBUILD"
exit 1
fi >&2
diff ${@:--u} PKGBUILD <(curl -s "http://aur.archlinux.org/packages/$pkgname/$pkgname/PKGBUILD")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment