summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpruefe-aktualitaet64
1 files changed, 64 insertions, 0 deletions
diff --git a/pruefe-aktualitaet b/pruefe-aktualitaet
new file mode 100755
index 0000000..692ed9e
--- /dev/null
+++ b/pruefe-aktualitaet
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+set -e
+
+if [ ! "$(readlink -f "$0")" == "$0" ]
+then
+ "$(readlink -f "$0")" "$@"
+ exit $?
+fi
+
+if [ $# -eq 0 ]
+then
+ erg="$(
+ "$0" $(
+ ls /usr/ports/distfiles | \
+ grep '^wurzel-' | \
+ sed 's|-[0-9.]\+\.tar\.bz2$||' | \
+ sort -u
+ )
+ )"
+ if [ -n "${erg}" ]
+ then
+ echo "${erg}"
+ exit 1
+ fi
+ exit
+elif [ $# -gt 1 ]
+then
+ for pkg in "$@"
+ do
+ echo "${pkg}"
+ done | \
+ parallel "$0"
+ exit
+fi
+
+. "/usr/ports/deepthought/$1/Pkgfile"
+
+beenden()
+{
+ if [ -n "${tmpDir}" ]
+ then
+ rm -rf "${tmpDir}"
+ fi
+ exit $1
+}
+
+tmpDir="$(mktemp -d)"
+cd "${tmpDir}"
+tar -xjf "/usr/ports/distfiles/${source##*/}"
+
+dateien="$(
+ grep "^${name}:" "$(dirname "$0")/dateien" | \
+ sed 's|^[^:]\+:\(.*/\)\([^/]*\)$|s@ \2$@ \1\2@;|'
+)"
+
+find . -type f -exec sha512sum {} \; | \
+ sed 's|^\(\S\+ \).*/\([^/]*\)$|\1\2|' | \
+ sed "${dateien}" | \
+ ssh wurzel 'sha512sum -c' 2>&1 | \
+ grep -v ': OK$' | \
+ sed 's|^|'"${name}"': |'
+
+beenden 0