summaryrefslogtreecommitdiff
path: root/toru
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <josht@stravy.(none)>2011-04-14 23:14:37 -0500
committerJoshua Ismael Haase Hernández <josht@stravy.(none)>2011-04-14 23:14:37 -0500
commit01f55a1a7e979ab38e6d6d5b169507ab34f73ddb (patch)
treefa9cf5da2e5ed0df72dfbe603e90b885b050d07d /toru
parent4a585ee091e98d980c7f2ae8cc3e507dd4ee1a18 (diff)
parent47970ad081939c1024a2a9358e647ed2358f6de6 (diff)
Merge branch 'master' of vparabola:~/projects/libretoolsv20110416
Diffstat (limited to 'toru')
-rwxr-xr-xtoru47
1 files changed, 47 insertions, 0 deletions
diff --git a/toru b/toru
new file mode 100755
index 0000000..9716744
--- /dev/null
+++ b/toru
@@ -0,0 +1,47 @@
+#!/bin/bash
+# Queries the ABS
+# License: GPL3
+
+# TODO
+# * Add license text
+# * Use libremessages
+
+source /etc/abs.conf
+source /etc/libretools.conf
+
+TMPDIR=$(mktemp -d)
+
+[[ -z ${TMPDIR} ]] && exit 1
+
+update() {
+ pushd ${ABSROOT} >/dev/null
+
+# Find all the PKGBUILDs newer than the last update
+ find * -type f -name 'PKGBUILD' -newer ${ABSROOT}/toru >> ${TMPDIR}/update.list
+
+ while read _pkgbuild; do
+ pushd $(dirname ${_pkgbuild}) >/dev/null
+
+ unset pkgbase pkgname pkgver pkgrel
+
+ source PKGBUILD
+
+ for _pkg in ${pkgbase:-${pkgname[@]}}; do
+ dir="${TMPDIR}/packages/${_pkg}-${pkgver}-${pkgver}"
+ mkdir -p "${dir}"
+
+ echo "${ABSROOT}/${_pkgbuild}" >> "${dir}/path"
+
+ done
+
+ popd >/dev/null
+ done < ${TMPDIR}/update.list
+
+ popd >/dev/null
+
+ last_update
+}
+
+last_update() {
+ touch ${ABSROOT}/toru
+}