]>
git.wh0rd.org - fontconfig.git/blob - new-version.sh
4 if git-status
> /dev
/null
; then
7 echo 'Uncommited changes in repository' 1>&2
16 echo 'Invalid version number:' "$version" 1>&2
22 awk -F. '{ printf ("major=%d\nminor=%d\nrevision=%d\n",
25 # Update the version numbers
27 $test sed -i configure.
in "/^AM_INIT_AUTOMAKE/s/2\.[0-9.]*/$version/"
29 $test sed -i fontconfig
/fontconfig.h \
30 -e "/^#define FC_MAJOR/s/[0-9]*/$major/" \
31 -e "/^#define FC_MINOR/s/[0-9]*/$minor/" \
32 -e "/^#define FC_REVISION/s/[0-9]*/$revision/"
35 # Compute pretty form of new version number
37 version_note
=`echo $version | awk -F. '{
39 printf ("%d.%d.%d (%d.%d RC%d)\n",
40 $1, $2, $3, $1, $2 + 1, $3 - 90);
42 printf ("%d.%d\n", $1, $2);
44 printf ("%d.%d.%d\n", $1, $2, $3); }'`
47 # Find previous version in README
49 last_note
=`grep '^2\.[0-9.]*' README |
51 sed 's/ (2\.[0-9]* RC[0-9]*)//'`
60 echo 'cannot find previous changelog' 1>&2
65 # Format the current date for the README header
67 date=`date '+%Y-%m-%d'`
70 # Update the readme file
72 if [ $version != $last ]; then
76 (sed '/^2\.[0-9.]*$/,$d' README |
77 sed -e "s/Version.*/Version $version_note/" \
78 -e "s/200.*/$date/" |
awk '
82 space=(70 - length) / 2;
83 for (i = 0; i < space; i++)
98 git-log
--pretty=short
$last.. | git-shortlog |
cat
101 # previous changelogs
104 sed -n '/^2\.[0-9.]*$/,$p' README
) > README.tmp ||
105 (echo "README update failed"; exit 1)
107 $test mv README.tmp README
110 $test git-commit
-m"Bump version to $version" \
112 fontconfig
/fontconfig.h \
116 $test git-tag
-u 096c4dd3
-m"Version $version" $version
118 # Make distributed change log
120 $test "git-log --stat $last.. > ChangeLog-$version"