1
0
Fork 0
forked from mirrors/openup

Implement -K (exclude kernel binpatches). Not working in cron mode yet.

This commit is contained in:
Antoine Jacoutot 2013-09-04 17:42:19 +02:00
commit 88a7c27b82

31
openup
View file

@ -37,7 +37,7 @@ usage() {
echo "Usage: ${0##*/} [-K][-Sn|c]" >&2
echo
echo "Options:"
echo " -K do not check for kernel binpatches (when running non GENERIC) - NOT YET"
echo " -K do not check for kernel binpatches (when running non GENERIC)"
echo " -S do not check for package signatures"
echo " -n dry-run mode, no modification is done"
echo
@ -146,7 +146,10 @@ update_binpatches() {
_BP=$(pkg_info -Q binpatch${_REL_INT}-$(arch -s) | sed 's/.[^-]*$//' | sort -u | tr '\n' ' ')
if [ -n "$_BP" ]; then
if [ -n "${_BP}" ]; then
if [ -n "${exclude_kernel}" ]; then
_BP=$(echo ${_BP} | sed -e "s,binpatch${_REL_INT}-$(arch -s)-kernel,,g")
fi
pr_bigarrow "Updating binpatch(es)"
_CMD="pkg_add ${pkg_opt} ${_BP}"
pr_smallarrow "${_CMD}"
@ -155,12 +158,19 @@ update_binpatches() {
}
update_pkg() {
local _CMD
local _CMD _PKG
pr_bigarrow "Updating package(s)"
_CMD="pkg_add -u ${pkg_opt}"
pr_smallarrow "${_CMD}"
eval ${_CMD}
_PKG=$(pkg_info -q | perl -ne '/^(.*)-(\d[^-]*)[-]?(\w*)(.*)$/ && print "$1\n"' | \
grep -v binpatch${_REL_INT}-$(arch -s))
if [ -n "${_PKG}" ]; then
pr_bigarrow "Updating package(s)"
_CMD="pkg_add -u ${pkg_opt}"
pr_smallarrow "${_CMD}"
# we don't want to display ${_PKG}, there could be hundreds
_CMD="${_CMD} ${_PKG}"
eval ${_CMD}
fi
}
# this only outputs the most recent vulnerability for each pkg
@ -212,9 +222,10 @@ done
check_openupd
if [ -n "${nosig}" -o -n "${dryrun}" -a -n "${dryrun}" ]; then
usage
fi
# XXX
#if [ -n "${nosig}" -o -n "${dryrun}" -a -n "${dryrun}" ]; then
# usage
#fi
if [ "${checkmode}" ]; then
check_vuxml