X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=tools%2Fupdate-version;h=6a769a29e7b4193d6694aac5c7211f6809dae5b3;hb=4510c2363673a5a4e5f09defb6157781c82c2468;hp=bfa07dbe33596fa27c9ebd6f8d72432f5a33eca9;hpb=39edbeed8b1d86646e7a8e457f39244c54b1cf14;p=wimlib diff --git a/tools/update-version b/tools/update-version index bfa07dbe..6a769a29 100755 --- a/tools/update-version +++ b/tools/update-version @@ -1,15 +1,23 @@ #!/bin/bash -oldver='1\.8\.1' -oldmonth=May -oldyear=2015 +set -eu -newmajor=1 -newminor=8 -newpatch=2 -newmonth=August -newyear=2015 +if [ $# -ne 1 ]; then + echo "Usage: $0 NEW_VERS" 1>&2 + exit 1 +fi +oldmonth=$(head -1 doc/man1/wimcapture.1 | cut -d' ' -f4 | tr -d '"') +oldyear=$(head -1 doc/man1/wimcapture.1 | cut -d' ' -f5 | tr -d '"') +oldver=$(grep 'the library interface of wimlib' include/wimlib.h \ + | egrep -o '[0-9]+\.[0-9]+\.[0-9]+') + +newver=$1 +newmajor=$(echo "$newver" | cut -d'.' -f1) +newminor=$(echo "$newver" | cut -d'.' -f2) +newpatch=$(echo "$newver" | cut -d'.' -f3) +newmonth=$(date +%B) +newyear=$(date +%Y) newver="${newmajor}.${newminor}.${newpatch}" pat='This is wimlib version [^[:space:]]\+ ([^[:space:]]\+ [^[:space:]]\+)' @@ -26,8 +34,6 @@ sed -i -e 's/\(#define WIMLIB_MAJOR_VERSION[[:space:]]\+\)[[:digit:]]\+/\1'$newm sed -i -e "1s/$oldmonth $oldyear/$newmonth $newyear/;1s/wimlib $oldver/wimlib $newver/" \ doc/man[1-9]/*.[1-9] -sed -i "s/pkgver=$oldver/pkgver=$newver/" archlinux/PKGBUILD - sed -i "1i\\ wimlib ($newver-1) unstable; urgency=low\\ \\