#!/bin/sh set -eu export PATH=/bin:/usr/bin:/sbin:/usr/sbin LC_ALL=C trap '/sbin/poweroff -f' EXIT test "$(uname -o)" = Vinix test "$(id -u)" = 0 test "$(vpac o --quiet /usr/bin/pkg)" = vinix-pkg test "$(stat -c '%a' /usr/include/libiberty)" = 700 pkg upgrade >/tmp/public-mode-upgrade.log 2>&1 || { cat /tmp/public-mode-upgrade.log exit 1 } cat /tmp/public-mode-upgrade.log if grep -E '^error:|failed to run .*hook|scriptlet failed' /tmp/public-mode-upgrade.log; then exit 1 fi while IFS=' ' read -r name version; do test -s "/var/lib/vpac/local/$name-$version/desc" vpac q -F validation "local/$name" | grep -Eq '^validation[[:space:]]+signature$' done