Permalink
Browse files

aurdiff: compare local and remote PKGBUILD

  • Loading branch information...
1 parent 2cce891 commit d9fb4b9d9528fa6bc93d9041b51a84f5d9d46dbe @c00kiemon5ter committed Dec 5, 2011
Showing with 20 additions and 0 deletions.
  1. +20 −0 aurdiff
View
20 aurdiff
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Diff PKGBUILD in current directory with the one in the AUR.
+# Thanks to Dave Reisner
+
+PKGBUILD=${1:-PKGBUILD}
+
+if [ ! -f "$PKGBUILD" -o ! -r "$PKGBUILD" ]; then
+ echo "error: could not open file: $PKGBUILD" >&2
+ exit 1
+fi
+
+eval $(grep '^pkgname=' "$PKGBUILD")
+if [ -z $pkgname ]; then
+ echo "error: no definition of \$pkgname in $PKGBUILD" >&2
+ exit 1
+fi
+
+curl -s "http://aur.archlinux.org/packages/$pkgname/PKGBUILD" \
+ | diff -u "$PKGBUILD" -

0 comments on commit d9fb4b9

Please sign in to comment.