build: add file size field to manifest lines
We would like to check the file size instead of downloading indefinitely. The file size is added in another copy of the manifest lines, which is ignored by older autoupdater implementations.
This commit is contained in:
parent
245e0f9ecc
commit
21b3dd3259
16
scripts/filesize.sh
Executable file
16
scripts/filesize.sh
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
check_command() {
|
||||||
|
which "$1" >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
if check_command gnustat; then
|
||||||
|
gnustat -c%s "$@"
|
||||||
|
elif check_command gstat; then
|
||||||
|
gstat -c%s "$@"
|
||||||
|
elif check_command stat; then
|
||||||
|
stat -c%s "$@"
|
||||||
|
else
|
||||||
|
echo "$0: no suitable stat implementation was found" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
@ -21,8 +21,22 @@ generate_line() {
|
|||||||
local model="$1"
|
local model="$1"
|
||||||
local file="$2"
|
local file="$2"
|
||||||
|
|
||||||
[ ! -e "${GLUON_IMAGEDIR}/sysupgrade/$file" ] || echo "$model" "$GLUON_RELEASE" "$(scripts/sha256sum.sh "${GLUON_IMAGEDIR}/sysupgrade/$file")" "$file"
|
[ ! -e "${GLUON_IMAGEDIR}/sysupgrade/$file" ] || echo \
|
||||||
[ ! -e "${GLUON_IMAGEDIR}/sysupgrade/$file" ] || echo "$model" "$GLUON_RELEASE" "$(scripts/sha512sum.sh "${GLUON_IMAGEDIR}/sysupgrade/$file")" "$file"
|
"$model" \
|
||||||
|
"$GLUON_RELEASE" \
|
||||||
|
"$(scripts/sha256sum.sh "${GLUON_IMAGEDIR}/sysupgrade/$file")" \
|
||||||
|
"$(scripts/filesize.sh "${GLUON_IMAGEDIR}/sysupgrade/$file")" \
|
||||||
|
"$file"
|
||||||
|
[ ! -e "${GLUON_IMAGEDIR}/sysupgrade/$file" ] || echo \
|
||||||
|
"$model" \
|
||||||
|
"$GLUON_RELEASE" \
|
||||||
|
"$(scripts/sha256sum.sh "${GLUON_IMAGEDIR}/sysupgrade/$file")" \
|
||||||
|
"$file"
|
||||||
|
[ ! -e "${GLUON_IMAGEDIR}/sysupgrade/$file" ] || echo \
|
||||||
|
"$model" \
|
||||||
|
"$GLUON_RELEASE" \
|
||||||
|
"$(scripts/sha512sum.sh "${GLUON_IMAGEDIR}/sysupgrade/$file")" \
|
||||||
|
"$file"
|
||||||
}
|
}
|
||||||
|
|
||||||
generate() {
|
generate() {
|
||||||
|
Loading…
Reference in New Issue
Block a user