gluon-autoupdater: allow configuring the branch name independently of the UCI config section name
This commit is contained in:
parent
72e7ae68fa
commit
10d6c1930d
@ -3,6 +3,9 @@
|
|||||||
# option branch "stable"
|
# option branch "stable"
|
||||||
|
|
||||||
#config branch stable
|
#config branch stable
|
||||||
|
# The branch name given in the manifest
|
||||||
|
# option name 'stable'
|
||||||
|
|
||||||
# list mirror 'http://[fdef:ffc0:3dd7::8]/~freifunk/firmware/autoupdate'
|
# list mirror 'http://[fdef:ffc0:3dd7::8]/~freifunk/firmware/autoupdate'
|
||||||
|
|
||||||
# The updater will run once per hour and perform an update with a certain
|
# The updater will run once per hour and perform an update with a certain
|
||||||
|
@ -19,6 +19,7 @@ if test "a$1" != "a-f"; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
BRANCH_NAME=$(uci get autoupdater.${BRANCH}.name)
|
||||||
MIRRORS=$(uci get autoupdater.${BRANCH}.mirror)
|
MIRRORS=$(uci get autoupdater.${BRANCH}.mirror)
|
||||||
PUBKEYS=$(uci get autoupdater.${BRANCH}.pubkey)
|
PUBKEYS=$(uci get autoupdater.${BRANCH}.pubkey)
|
||||||
GOOD_SIGNATURES=$(uci get autoupdater.${BRANCH}.good_signatures)
|
GOOD_SIGNATURES=$(uci get autoupdater.${BRANCH}.good_signatures)
|
||||||
@ -83,10 +84,10 @@ verify_manifest() {
|
|||||||
analyse_manifest() {
|
analyse_manifest() {
|
||||||
local manifest_upper=$1
|
local manifest_upper=$1
|
||||||
|
|
||||||
grep -q "^BRANCH=${BRANCH}$" $manifest_upper
|
grep -q "^BRANCH=${BRANCH_NAME}$" $manifest_upper
|
||||||
|
|
||||||
if test $? -ne 0; then
|
if test $? -ne 0; then
|
||||||
echo "Wrong branch. We are on ${BRANCH}" >&2
|
echo "Wrong branch. We are on ${BRANCH_NAME}" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ delete autoupdater.$name
|
|||||||
set autoupdater.$name=branch
|
set autoupdater.$name=branch
|
||||||
END
|
END
|
||||||
|
|
||||||
for (qw(probability good_signatures)) {
|
for (qw(name probability good_signatures)) {
|
||||||
print "set autoupdater.$name.$_=$branch->{$_}\n";
|
print "set autoupdater.$name.$_=$branch->{$_}\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user