1
0
Fork 0
forked from mirrors/openup

Implement FETCH for wget lovers.

from Thomas Wies
This commit is contained in:
Antoine Jacoutot 2014-11-14 16:28:02 +01:00
commit 148f9a5480

10
openup
View file

@ -35,6 +35,8 @@ PKG_PATH_UPDATE="https://stable.mtier.org/updates/$(uname -r)/$(arch -s)"
#PKG_PATH_UPDATE_LTS="https://user%domain.tld:password@stable.mtier.org/updates-lts/$(uname -r)/$(arch -s)"
# URL to the latest vuxml (vulnerabilities database)
VUXML_URL="https://stable.mtier.org/vuxml/$(uname -r | tr -d '.').xml"
# fetch command (must behave like "ftp -o"); e.g. "wget -O"
FETCH="ftp -Vo"
# exclusion list: pkg names without version/flavor, separated by space
EXCLUDE_PKG=""
########################################################################
@ -72,7 +74,7 @@ get_key() {
[ -r /etc/signify/mtier-${_REL_INT}-pkg.pub ] && return
pr "Downloading and installing public key"
ftp -Vo ${_TMPKEY} ${PKG_PUBKEY_URL} || bye_bye
${FETCH} ${_TMPKEY} ${PKG_PUBKEY_URL} || bye_bye
install -m0644 ${_TMPKEY} /etc/signify/mtier-${_REL_INT}-pkg.pub || bye_bye
}
@ -80,7 +82,7 @@ check_openupd() {
local _U
pr "Checking for openup update"
_U="ftp -Vo - ${OPENUP_URL} | awk -F '=' '/^_OPENUP_VERSION/ { print \$2 }'"
_U="${FETCH} - ${OPENUP_URL} | awk -F '=' '/^_OPENUP_VERSION/ { print \$2 }'"
_U=$(eval $_U)
if [ -z "${_U}" ]; then
pr_err "Cannot retrieve ${OPENUP_URL}"
@ -90,7 +92,7 @@ check_openupd() {
if [ "${_OPENUP_VERSION}" -lt "${_U}" ]; then
pr_err "New openup release (version ${_U}) available; please update with:"
pr_err "ftp -Vo $(readlink -f $0) ${OPENUP_URL}"
pr_err "${FETCH} $(readlink -f $0) ${OPENUP_URL}"
bye_bye
fi
}
@ -153,7 +155,7 @@ update_pkg() {
check_vuxml() {
local _BP_MATCH _OUTDATED _PKG_MATCH _b _e _p
ftp -Vo ${_TMPVUXML} ${VUXML_URL} >/dev/null || bye_bye
${FETCH} ${_TMPVUXML} ${VUXML_URL} >/dev/null || bye_bye
perl -pi -e 's,\$ARCH,'"${_ARCH}"',g' ${_TMPVUXML}
_BP_MATCH="$(grep binpatch ${_TMPVUXML} | sed -e 's,<name>,,g;s,</name>,,g;s,\$ARCH,'"${_ARCH}"',g' | sort -u)"