summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Reynolds <fauno@kiwwwi.com.ar>2011-04-07 20:38:11 -0300
committerNicolas Reynolds <fauno@kiwwwi.com.ar>2011-04-07 20:38:11 -0300
commit7b9a203f5c44e907bcfb0faac0743932cc8aa40c (patch)
tree0c73b03e5a3bb8ad7e44f51bd5228e226ba0c41d
parent0651d7e2d50f233026bb3c8049a60c4875a30f96 (diff)
First stub of ABS querying script. Toru is the name of Pacman designer :P
**Not meant for use yet!!**
-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
+}