]> wimlib.net Git - wimlib/blobdiff - tools/update-version
Remove obsolete Linux packaging files
[wimlib] / tools / update-version
index 65ab7725b30f5307b1f174a8333eb7afdc58803d..092c572ed2c5d98854a502fc7bcbf433837c93ac 100755 (executable)
@@ -1,15 +1,23 @@
 #!/bin/bash
 
-oldver='1\.8\.3'
-oldmonth=November
-oldyear=2015
+set -eu
 
-newmajor=1
-newminor=9
-newpatch=0
-newmonth=January
-newyear=2016
+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:]]\+)'
@@ -25,16 +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 "s/pkgver=$oldver/pkgver=$newver/" archlinux/PKGBUILD
-
-sed -i "1i\\
-wimlib ($newver-1) unstable; urgency=low\\
-\\
-  * Update to v$newver\\
-\\
- -- Eric Biggers <ebiggers3@gmail.com>  $(date -R)\\
-" debian/changelog
-
-sed -i 's/\(Version:[[:space:]]*\)[^[:space:]]\+/\1'"$newver"'/' \
-               rpm/*.spec