diff --git a/lib/aurto/aur-vercmp-devel b/lib/aurto/aur-vercmp-devel new file mode 100755 index 0000000..d733eb4 --- /dev/null +++ b/lib/aurto/aur-vercmp-devel @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +## from: man aurvcs +# shellcheck disable=SC2035 disable=2094 +set -eu + +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 \ No newline at end of file diff --git a/lib/aurto/update-aurto b/lib/aurto/update-aurto index 7b7eddf..7548ac5 100755 --- a/lib/aurto/update-aurto +++ b/lib/aurto/update-aurto @@ -3,7 +3,7 @@ ## Should be in the same dir as `check-aurto-git` set -eu -readonly AURVCS=${AURVCS:-.*-(bzr|git|hg|svn)$} +readonly AURVCS=${AURVCS:-.*-(cvs|svn|git|hg|bzr|darcs)$} if [[ $EUID -ne 0 ]]; then # retry as root @@ -78,12 +78,15 @@ if rm "$lib_dir/check-vcs" 2>/dev/null; then vcs_pkgs=$(aur repo --database=aurto --list | cut -f1 | grep -E "$AURVCS" || true) if [ -n "$vcs_pkgs" ]; then echo "Checking $(echo "$vcs_pkgs" | wc -l) VCS packages matching $(yellow "$AURVCS") for updates..." >&2 - # init vcs sync cache + # init vcs sync cache (aurutils v3 args with ||-fallback to v2 args) sudo -u "$user" \ aur sync "$vcs_pkgs" \ - --no-ver-shallow --print >/dev/null 2>&1 + --no-ver --no-build --no-view --database=aurto >/dev/null 2>&1 \ + || sudo -u "$user" \ + aur sync "$vcs_pkgs" \ + --no-ver-shallow --print --database=aurto >/dev/null 2>&1 - mapfile -t git_outdated < <(sudo -u "$user" aur vercmp-devel --database=aurto | cut -d: -f1) + mapfile -t git_outdated < <(sudo -u "$user" "$lib_dir"/aur-vercmp-devel --database=aurto | cut -d: -f1) if [ ${#git_outdated[@]} -gt 0 ]; then sudo -u "$user" aurto remove "${git_outdated[@]}" sudo -u "$user" aurto add "${git_outdated[@]}" diff --git a/trust-check/Cargo.lock b/trust-check/Cargo.lock index d95aae3..5e8e88f 100644 --- a/trust-check/Cargo.lock +++ b/trust-check/Cargo.lock @@ -20,9 +20,9 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "curl" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78baca05127a115136a9898e266988fc49ca7ea2c839f60fc6e1fc9df1599168" +checksum = "e268162af1a5fe89917ae25ba3b0a77c8da752bdc58e7dbb4f15b91fbd33756e" dependencies = [ "curl-sys", "libc", @@ -35,9 +35,9 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.36+curl-7.71.1" +version = "0.4.38+curl-7.73.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68cad94adeb0c16558429c3c34a607acc9ea58e09a7b66310aabc9788fc5d721" +checksum = "498ecfb4f59997fd40023d62a9f1e506e768b2baeb59a1d311eb9751cdcd7e3f" dependencies = [ "cc", "libc", @@ -99,9 +99,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "redox_syscall"