diff options
-rwxr-xr-x | satellit_upgrader/pack-update.sh | 8 | ||||
-rw-r--r-- | satellit_upgrader/updater.template.sh | 12 |
2 files changed, 11 insertions, 9 deletions
diff --git a/satellit_upgrader/pack-update.sh b/satellit_upgrader/pack-update.sh index bc5e97d..fb25efb 100755 --- a/satellit_upgrader/pack-update.sh +++ b/satellit_upgrader/pack-update.sh @@ -66,9 +66,9 @@ declare -rg LIST_LDADP=" declare -rg TGZ_DNBD3="files/dnbd3.tar.gz" declare -rg FILES_DNBD3=" - CMakeLists.txt - src/ - version.txt + dnbd3.*source/CMakeLists.txt + dnbd3.*source/src/ + dnbd3.*source/inc/dnbd3/version.h " checkfiles () { @@ -80,7 +80,7 @@ BEGIN { numStrings == 0 { exit 0 } { for (str in strs) { - if ( $0 == str ) { + if ( $0 ~ str ) { delete strs[str] numStrings-- } diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index 15c63d3..f42b5d8 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -694,12 +694,13 @@ rm -f -- "$PATH_DNBD3/is-enabled" if [ -n "$TGZ_DNBD3" ]; then tmpdir="$TMPDIR/dnbd3.tmp" mkdir -p "$tmpdir" - tar -x -C "$tmpdir" -f "$TMPDIR/$TGZ_DNBD3" || perror "Could not extract $TGZ_DNBD3 to $tmpdir" - cver=$( "$PATH_DNBD3/dnbd3-server" --version 2> /dev/null | awk -F': ' '{print $2}' ) - nver=$( cat "$tmpdir/version.txt" ) + tar --transform='s,^[./]*dnbd3[^/]*/,,' -x -C "$tmpdir" -f "$TMPDIR/$TGZ_DNBD3" || perror "Could not extract $TGZ_DNBD3 to $tmpdir" + cver=$( "$PATH_DNBD3/dnbd3-server" --version 2> /dev/null | grep -Po '(?<=^Version: ).*(?=, branch)' ) + nver=$( < "$tmpdir/inc/dnbd3/version.h" grep -Po '(?<=^#define DNBD3_VERSION ").*(?=")' ) + [ -z "$cver" ] && pwarning "BUG BUG! Cannot query dnbd3 version information from currently installed binary!" [ -z "$nver" ] && pwarning "BUG BUG! Updater package contains no dnbd3 version information!" mkdir -p "$PATH_DNBD3" - if [ "$cver" != "$nver" ]; then + if [ "${cver#v}" != "${nver#v}" ]; then aptinst libjansson-dev aptinst libfuse-dev aptinst cmake @@ -707,7 +708,8 @@ if [ -n "$TGZ_DNBD3" ]; then cd "$tmpdir" mkdir build cd build - if ! failprint cmake -DBUILD_FUSE_CLIENT=OFF -DBUILD_KERNEL_MODULE=OFF -DBUILD_STRESSTEST=OFF -DBUILD_SERVER=ON -DCMAKE_BUILD_TYPE=Release ..; then + if ! failprint cmake -DDNBD3_CLIENT_FUSE=OFF -DDNBD3_KERNEL_MODULE=OFF \ + -DDNBD3_SERVER=ON -DDNBD3_SERVER_FUSE=OFF -DCMAKE_BUILD_TYPE=Release ..; then pwarning "Could not cmake new version $nver of dnbd3-server" elif ! failprint make -j2 dnbd3-server; then pwarning "Could not compile new version $nver of dnbd3-server" |