forked from mirrors/openup
Renove old binpatches entries; not bumping yet, I prefer to have it
in a wild for a bit.
This commit is contained in:
parent
2eea8f06cb
commit
96259b429c
1 changed files with 18 additions and 12 deletions
30
openup
30
openup
|
|
@ -83,18 +83,6 @@ if [ -n "${_badrel}" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# check that we have no installed binpatches from a previous release
|
||||
_BPLIST=$(pkg_info -q | grep "^binpatch")
|
||||
if [ -n "${_BPLIST}" ]; then
|
||||
_i=$(echo ${_BPLIST} | wc -w)
|
||||
_v=$(echo ${_BPLIST} | grep "^binpatch${_REL_INT}" | wc -w)
|
||||
if [ "${_i}" -ne "${_v}" ]; then
|
||||
pr_error "Binpatch(es) from a previous release installed"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
unset _BPLIST
|
||||
|
||||
_ARCH=$(arch -s)
|
||||
_TMPDIR="${TMPDIR:=/tmp}"
|
||||
_TMPCERT=$(mktemp -p ${_TMPDIR} .openup-pkg_cert.XXXXXXXXXX) || exit 1
|
||||
|
|
@ -162,6 +150,23 @@ check_openupd() {
|
|||
fi
|
||||
}
|
||||
|
||||
# check that we have no installed binpatches from a previous release and
|
||||
# if so remove the entries manually (we don't want pkg_delete to
|
||||
# nodify nor error out on installed files from newer release/binpatch)
|
||||
rm_old_bp() {
|
||||
local _bp
|
||||
local _BPDB=$(ls -d /var/db/binpatch/[0-9]* |grep -v ${_REL})
|
||||
local _BPPKG=$(ls -d /var/db/pkg/binpatch* |grep -v binpatch${_REL_INT})
|
||||
if [ -n "${_BPPKG}" -o -n "${_BPDB}" ]; then
|
||||
pr_bigarrow "Removing old binpatch(es) entry"
|
||||
fi
|
||||
for _bp in ${_BPPKG} ${_BPDB}; do
|
||||
_CMD="rm -rf ${_bp}"
|
||||
pr_smallarrow "${_CMD}"
|
||||
cmd.exe ${_CMD}
|
||||
done
|
||||
}
|
||||
|
||||
update_binpatches() {
|
||||
local _BP _CMD
|
||||
|
||||
|
|
@ -269,6 +274,7 @@ if [ "${checkmode}" ]; then
|
|||
|
||||
else
|
||||
if [ -z "${nosig}" ]; then get_cert; fi
|
||||
rm_old_bp
|
||||
update_binpatches
|
||||
update_pkg
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue