forked from mirrors/openup
Fix run in non dry-run mode.
Add squeleton for the -K option.
This commit is contained in:
parent
46ab61d738
commit
e30c78e50e
1 changed files with 9 additions and 7 deletions
16
openup
16
openup
|
|
@ -29,18 +29,19 @@ VUXML_URL="https://stable.mtier.org/vuxml/$(uname -r | tr -d '.').xml"
|
|||
### DO NOT MODIFY ANYTHING BELOW THIS LINE!!! ###
|
||||
########################################################################
|
||||
|
||||
_OPENUP_VERSION=6
|
||||
_OPENUP_VERSION=7
|
||||
_OPENUP_MINREL=53
|
||||
|
||||
usage() {
|
||||
echo
|
||||
echo "Usage: ${0##*/} [-SUn]|[-c]" >&2
|
||||
echo "Usage: ${0##*/} [-K][-Sn|c]" >&2
|
||||
echo
|
||||
echo "Options:"
|
||||
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
|
||||
echo " -c check/cron mode, mutually exclusive with other options"
|
||||
echo " -c check/cron mode (cannot be used with -S and/or -n)"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
|
@ -133,7 +134,7 @@ check_openupd() {
|
|||
fi
|
||||
|
||||
if [ -n "${_N}" -o -n "${dryrun}" ]; then
|
||||
if [ "${_OPENUP_VERSION}" -lt "${_N}" -o -z "${dryrun}" ]; then
|
||||
if [ "${_OPENUP_VERSION}" -lt "${_N}" ]; then
|
||||
pr_error "New openup release (version ${_N}) is available; please update with:"
|
||||
pr_error "ftp -Vo $(readlink -f $0) ${OPENUP_URL}"
|
||||
pr_error "Exiting"
|
||||
|
|
@ -172,13 +173,13 @@ check_vuxml() {
|
|||
perl -pi -e 's,\$ARCH,'"$(arch -s)"',g' ${_TMPVUXML}
|
||||
|
||||
_BP=$(pkg_info -Q binpatch${_REL_INT}-$(arch -s) | sed 's/.[^-]*$//' | sort -u | tr '\n' ' ')
|
||||
_BP_OUTDATED=$(pkg_add -nv -D nosig ${_BP} 2>/dev/null | \
|
||||
_BP_OUTDATED=$(pkg_add -qnv -D nosig ${_BP} 2>/dev/null | \
|
||||
grep '^Adding.*(pretending)' | \
|
||||
sort -u | \
|
||||
sed -e 's,Adding ,,;s,(pretending),,;s,->.*,,' | \
|
||||
perl -ne '/^(.*)-(\d[^-]*)[-]?(\w*)(.*)$/ && print "$1\n"')
|
||||
|
||||
_PKG_OUTDATED=$(pkg_add -nuv -D nosig 2>/dev/null | \
|
||||
_PKG_OUTDATED=$(pkg_add -qnuv -D nosig 2>/dev/null | \
|
||||
grep '(installing)(pretending)' | \
|
||||
grep -v binpatch${_REL_INT}-$(arch -s) | \
|
||||
sed -e 's,Adding ,,;s,(pretending),,;s,->.*,,' | \
|
||||
|
|
@ -197,8 +198,9 @@ check_vuxml() {
|
|||
done | fmt | sed '/^$/d'
|
||||
}
|
||||
|
||||
while getopts 'SUcn' arg; do
|
||||
while getopts 'KScn' arg; do
|
||||
case ${arg} in
|
||||
K) exclude_kernel=1 ;;
|
||||
S) nosig=1; pkg_opt="${pkg_opt} -D nosig" ;;
|
||||
c) checkmode=1 ;;
|
||||
n) dryrun=" (dry run)"; pkg_opt="${pkg_opt} -n -D nosig" ;;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue