]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
scripts: misc improvements to update_ngtcp2.sh
authorJan Doskočil <jan.doskocil@nic.cz>
Wed, 24 Sep 2025 11:03:53 +0000 (13:03 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Wed, 24 Sep 2025 11:08:47 +0000 (13:08 +0200)
If new files were added between libngtcp2 versions, the script will now
store the files in a "NEWFILES" directory for operator's convenience.

scripts/update_ngtcp2.sh

index c116c81eee817472a88b6d981d2fb598a1ef9548..4bcc4b31f2d02d77fc3ce745dfff8608499ae56a 100755 (executable)
@@ -56,11 +56,13 @@ done
 cp "${clonedir}/ngtcp2/lib/ngtcp2_crypto.h" ./lib/ngtcp2_crypto.h
 cp "${clonedir}/ngtcp2/crypto/includes/ngtcp2/ngtcp2_crypto.h" ./ngtcp2_crypto.h
 
-newfiles="$(wc -l "${clonedir}/added" | cut -d' ' -f1)"
+newfiles="$(wc -l <"${clonedir}/added")"
 if [ "$newfiles" -gt 0 ]; then
        printf "%s new file(s) were added between %s and %s; add these manually if desired:\n" \
                "$newfiles" "$cur_version" "$1"
        cut -d'/' -f'5-' "${clonedir}/added" | xargs -r printf "\t%s\n"
+       mkdir NEWFILES
+       xargs <"$clonedir"/added -I{} mv {} ./NEWFILES
 fi
 
 rm -rf "$clonedir"