1
0
Fork 0
forked from mirrors/openup

Implement binpatch support in cron (-c) mode.

This finishes the initial implementation of openup...
This commit is contained in:
Antoine Jacoutot 2013-09-03 11:46:28 +02:00
commit f68e518450

17
openup
View file

@ -181,16 +181,25 @@ update_pkg() {
# this only outputs the most recent vulnerability for each pkg # this only outputs the most recent vulnerability for each pkg
check_vuxml() { check_vuxml() {
local _OUTDATED local _BP _BP_OUTDATED _PKG_OUTDATED
ftp -Vo ${_TMPVUXML} ${VUXML_URL} >/dev/null ftp -Vo ${_TMPVUXML} ${VUXML_URL} >/dev/null
perl -pi -e 's,\$ARCH,'"$(arch -s)"',g' ${_TMPVUXML}
_OUTDATED=$(pkg_add -nuv -D nosig 2>/dev/null | \ _BP=$(pkg_info -Q binpatch${_REL_INT}-$(arch -s) | sed 's/.[^-]*$//' | sort -u | tr '\n' ' ')
grep '(installing)(pretending)' | \ _BP_OUTDATED=$(pkg_add -nv -D nosig ${_BP} 2>/dev/null | \
grep '^Adding.*(pretending)' | \
sort -u | \
sed -e 's,Adding ,,;s,(pretending),,;s,->.*,,' | \ sed -e 's,Adding ,,;s,(pretending),,;s,->.*,,' | \
perl -ne '/^(.*)-(\d[^-]*)[-]?(\w*)(.*)$/ && print "$1\n"') perl -ne '/^(.*)-(\d[^-]*)[-]?(\w*)(.*)$/ && print "$1\n"')
for p in ${_OUTDATED} _PKG_OUTDATED=$(pkg_add -nuv -D nosig 2>/dev/null | \
grep '(installing)(pretending)' | \
grep -v binpatch${_REL_INT}-$(arch -s) | \
sed -e 's,Adding ,,;s,(pretending),,;s,->.*,,' | \
perl -ne '/^(.*)-(\d[^-]*)[-]?(\w*)(.*)$/ && print "$1\n"')
for p in ${_BP_OUTDATED} ${_PKG_OUTDATED}
do do
pr_bigarrow "${p} <" pr_bigarrow "${p} <"
# XXX how do we print only the 1st matching range in awk? # XXX how do we print only the 1st matching range in awk?