gluon-autoupdater: fix version comparison

This commit is contained in:
Matthias Schiffer 2014-03-11 20:32:58 +01:00
parent c8c9d72df9
commit 13d632acb8
2 changed files with 4 additions and 3 deletions

View File

@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/gluon-autoupdater define Package/gluon-autoupdater
SECTION:=gluon SECTION:=gluon
CATEGORY:=Gluon CATEGORY:=Gluon
DEPENDS:=+gluon-core +gluon-cron +ecdsautils +!BUSYBOX_CONFIG_SHA512SUM:coreutils-sha512sum DEPENDS:=+gluon-core +gluon-cron +opkg +ecdsautils +!BUSYBOX_CONFIG_SHA512SUM:coreutils-sha512sum
TITLE:=Automatically update firmware TITLE:=Automatically update firmware
endef endef

View File

@ -28,9 +28,10 @@ GOOD_SIGNATURES=$(uci get autoupdater.${BRANCH}.good_signatures)
VERSION_FILE=/lib/gluon/release VERSION_FILE=/lib/gluon/release
# returns 0 when $1 is a higher version number than $2
newer_than() { newer_than() {
local old="$(printf '%s\n%s\n' "$1" "$2" | sort -n | head -n 1)" # negate the return value as opkg returns 1 when the proposition is true
test "$1" != "$old" ! opkg compare-versions "$1" '>>' "$2"
} }
fetch_manifest() { fetch_manifest() {