-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaur-vercmp-devel
More file actions
executable file
·31 lines (25 loc) · 949 Bytes
/
Copy pathaur-vercmp-devel
File metadata and controls
executable file
·31 lines (25 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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 --noprepare
}
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