X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=tools%2Fupdate-version;h=7898219631008c53ea72180597ec9d147c44de4a;hp=e795dadff9fa12604fcfcb78eadcee3a0eccd0a6;hb=01ce2d43d6ba9721bf46c3e132c4be394ef3f0f9;hpb=bd926816f3b9d5982d1c497840c56724520c62dc diff --git a/tools/update-version b/tools/update-version index e795dadf..78982196 100755 --- a/tools/update-version +++ b/tools/update-version @@ -1,21 +1,29 @@ #!/bin/bash -oldver='1\.12\.0' -oldmonth=July -oldyear=2017 +set -eu -newmajor=1 -newminor=13 -newpatch=0 -newmonth=November -newyear=2018 +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:]]\+)' sed -i "s/$pat/This is wimlib version $newver ($newmonth $newyear)/" README -sed -i "s/$oldver/$newver/" configure.ac +sed -i "s/$oldver/$newver/" tools/get-version-number sed -i -e 's/\(#define WIMLIB_MAJOR_VERSION[[:space:]]\+\)[[:digit:]]\+/\1'$newmajor'/' \ -e 's/\(#define WIMLIB_MINOR_VERSION[[:space:]]\+\)[[:digit:]]\+/\1'$newminor'/' \ @@ -25,14 +33,3 @@ 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 "1i\\ -wimlib ($newver-1) unstable; urgency=low\\ -\\ - * Update to v$newver\\ -\\ - -- Eric Biggers $(date -R)\\ -" debian/changelog - -sed -i 's/\(Version:[[:space:]]*\)[^[:space:]]\+/\1'"$newver"'/' \ - rpm/*.spec