summaryrefslogtreecommitdiff
path: root/update-patchv
blob: 4b17aa606782a3027d1e34ea3a7d361743779fd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

set -e

if [ $# -ne 1 ]; then
  echo "Usage: $0 <patchnumber>"
  exit 1
fi

vers="`perl -pe 's/^(\d+\.\d+\.\d+).*/\1/' VERSION`"
full="${vers}-p$1"
echo $full > VERSION
perl -pi -e "s/(?<=#define MPFR_VERSION_STRING ).*/\"$full\"/" mpfr.h
perl -pi -e "s/(?<=return \").*\"/$full\"/" version.c
perl -pi -e "s/(?<=#if ).*/0/" tests/tversion.c

echo "MPFR version successfully updated."