diff options
Diffstat (limited to 'toru')
-rwxr-xr-x | toru | 47 |
1 files changed, 47 insertions, 0 deletions
@@ -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 +} |