Initial commit

This commit is contained in:
David Thurstenson 2021-02-05 12:31:10 -06:00
commit 03c4817b78
4 changed files with 66 additions and 0 deletions

22
PKGBUILD Normal file
View File

@ -0,0 +1,22 @@
# Maintainer: David Thurstenson <thurstylark@gmail.com>
pkgname=tl-aurutils-helpers
pkgver=0.1
pkgrel=1
pkgdesc="Scripts for automating common aurutils tasks"
arch=('any')
url="https://git.thurstylark.com/$pkgname.git/"
license=('GPL')
depends=('aurutils')
source=("aur-remove"
"aur-sync-devel"
"aur-vercmp-devel")
md5sums=('e6daee721038a55017b84cf32aa081bb'
'b57425fd69e51200a0de40354b127e32'
'19fb39b8b745dc3ecea1df8d2eca9307')
package() {
for i in ${source[@]}; do
install -Dm655 $i \
${pkgdir}/usr/bin/$i
done
}

12
aur-remove Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh --
# aur-remove - remove listed packages from all local repositories
if [ "$#" -eq 0 ]; then
printf 'usage: aur remove package [package ...]\n' >&2
exit 1
fi
aur repo --path-list | while read -r repo_path; do
repo-remove "$repo_path" "$@"
paccache -c "${repo_path%/*}" -rvk0 "$@"
done

5
aur-sync-devel Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
mapfile -t packages < <(aur vercmp-devel | cut -d: -f1)
aur sync "${packages[@]}" --no-ver-argv

27
aur-vercmp-devel Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
AURDEST=${AURDEST:-$XDG_CACHE_HOME/aurutils/sync}
AURVCS=${AURVCS:-.*-(cvs|svn|git|hg|bzr|darcs)$}
filter_vcs() {
awk -v "mask=$AURVCS" '$1 ~ mask {print $1}' "$@"
}
# Note that valid PKGBUILDs cannot contain \n in pkgname.
get_latest_revision() {
grep -Fxf - <(printf '%s\n' *) | xargs -r aur srcver
}
db_tmp=$(mktemp)
trap 'rm -rf "$db_tmp"' EXIT
# Retrieve a list of the local repository contents. The repository
# can be specified with the usual aur-repo arguments.
aur repo --list "$@" >"$db_tmp"
# Find VCS packages that are outdated according to aur-srcver.
# This checks out the latest revision for existing source directories,
# assuming the PKGBUILD has been viewed priorly.
if cd "$AURDEST"; then
aur vercmp -p <(filter_vcs "$db_tmp" | get_latest_revision) <"$db_tmp"
fi