summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@kiwwwi.com.ar>2012-02-04 13:12:11 -0300
committerNicolás Reynolds <fauno@kiwwwi.com.ar>2012-02-04 13:12:11 -0300
commit9808018ca09050ade144d0dfc0b0b6edadefa368 (patch)
tree4e732bb40323e5a920a3ebd9ab1fe371bb5cec9d
parent8aae92a56d577749d8ff73179ad5186ee7cba34b (diff)
Diff PKGBUILDs if duplicate + use https AUR
-rwxr-xr-xaur36
1 files changed, 28 insertions, 8 deletions
diff --git a/aur b/aur
index 1b17358..b96cb20 100755
--- a/aur
+++ b/aur
@@ -42,28 +42,48 @@ for _pkg in ${@}; do
_pkg="${_pkg%%[<>=]*}"
if [ -f "${_pkg}/PKGBUILD" ]; then
- warning "${_pkg} already existed. skipping..."
- continue
+ warning "${_pkg} already existed."
+
+# Check if we want to diff
+ if [ -z "${DIFFTOOL}" ]; then
+ continue
+ else
+# Store our copy of the PKGBUILD dir
+ _diff="${PWD}/${_pkg}"
+ stdnull "pushd $(mktemp -d /tmp/${_pkg}.XXXX)"
+ msg2 "Downloading PKGBUILD into ${PWD} for diff"
+ fi
fi
msg "Downloading $_pkg..."
- wget -O - -q http://aur.archlinux.org/packages/$_pkg/$_pkg.tar.gz | \
+ wget -O - -q https://aur.archlinux.org/packages/$_pkg/$_pkg.tar.gz | \
tar xzf - >/dev/null 2>&1
- [[ $? -ne 0 ]] && {
+ if [ $? -ne 0 ]; then
error "Couldn't get $_pkg"
continue
- }
+ fi
stdnull "pushd $_pkg"
+ if [ ! -z "$_diff" ]; then
+ msg2 "Diffing files"
+# Diff all files with our difftool
+ for file in *; do
+ ${DIFFTOOL} ${_diff}/${file} ${file}
+ done
+
+# Go back to our copy to continue working
+ stdnull "pushd ${_diff}"
+ fi
+
source PKGBUILD
- pkgbuild-check-nonfree || {
+ if ! pkgbuild-check-nonfree; then
if [ $? -eq 15 ]; then
warning "This PKGBUILD links to known unfree packages"
fi
- }
+ fi
msg2 "Checking license..."
free=0
@@ -84,7 +104,7 @@ for _pkg in ${@}; do
if ! is_built $_dep; then
if ! find ${ABSROOT} -maxdepth 2 -type d -name "$_dep" | egrep "*" >/dev/null ; then
msg2 "$_dep will be get from AUR"
- missing_deps+=($_dep)
+ missing_deps+=($_dep)
fi
else
msg2 "$_dep is on repos"