From fba7c37f98658e3ee94bb454868885b7f3a8ec5e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 10 Jan 2008 10:40:41 -0800 Subject: [PATCH] Create new-version.sh to help with releases, update INSTALL instructions --- INSTALL | 36 ++++----------- new-version.sh | 121 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+), 26 deletions(-) create mode 100644 new-version.sh diff --git a/INSTALL b/INSTALL index 4ea9080..0017eed 100644 --- a/INSTALL +++ b/INSTALL @@ -10,44 +10,28 @@ This should generate valid Makefiles, then: If you're going to package fontconfig for release, there are several important steps: - 1. Update the version numbers - configure.in - fontconfig/fontconfig.h - - 2. Fix the README - Change version number - Set the date - Append the short log - - git-log --pretty=short 2.4.xx.. | git-shortlog + 1. Create new version + sh new-version.sh 2.xx.xx - 3. Commit those changes - - 4. rebuild the configuration files with autogen.sh + 2. rebuild the configuration files with autogen.sh sh autogen.sh --sysconfdir=/etc --prefix=/usr --mandir=/usr/share/man --localstatedir=/var - 5. make distcheck (NB: won't work without docbook-utils -PL) + 3. make distcheck (NB: won't work without docbook-utils -PL) - 6. tag the tree - git-tag -u 096c4dd3 -m 'Version 2.4.x' 2.4.x - - 7. make Changelog-2.4.x - git-log --stat 2.4.(x-1).. > ChangeLog-2.4.x - - 8. Copy ChangeLog-2.4.x and fontconfig-2.4.x.tar.gz to + 4. Copy ChangeLog-2.x.y and fontconfig-2.x.y.tar.gz to - freedesktop.org:/srv/fontconfig.freedesktop.org/www/release + freedesktop.org:/srv/fontconfig.freedesktop.org/www/release - 9. Update the Fontconfig Devel wiki page + 5. Update the Fontconfig Devel wiki page http://fontconfig.org/wiki/Devel -10. Update the fontconfig documentation + 6. Update the fontconfig documentation scp -rp doc/fontconfig-user.html doc/fontconfig-devel fontconfig.org:/srv/fontconfig.freedesktop.org/www -11. Compute md5sums for release files: + 7. Compute md5sums for release files: md5sum fontconfig-2.4.x.tar.gz ChangeLog-2.4.x -12. Post a note to fontconfig@fontconfig.org. Include the md5sums. + 8. Post a note to fontconfig@fontconfig.org. Include the md5sums. gpg sign the message. diff --git a/new-version.sh b/new-version.sh new file mode 100644 index 0000000..b3f15fa --- /dev/null +++ b/new-version.sh @@ -0,0 +1,121 @@ +#!/bin/sh + +test=echo +if git-status > /dev/null; then + : +else + echo 'Uncommited changes in repository' 1>&2 + exit 1 +fi + +version="$1" +case "$version" in +2.[0-9.]*) + ;; +*) + echo 'Invalid version number:' "$version" 1>&2 + exit 1 + ;; +esac + +eval `echo $version | + awk -F. '{ printf ("major=%d\nminor=%d\nrevision=%d\n", + $1, $2, $3); }'` + +# Update the version numbers + +$test sed -i configure.in "/^AM_INIT_AUTOMAKE/s/2\.[0-9.]*/$version/" + +$test sed -i fontconfig/fontconfig.h \ + -e "/^#define FC_MAJOR/s/[0-9]*/$major/" \ + -e "/^#define FC_MINOR/s/[0-9]*/$minor/" \ + -e "/^#define FC_REVISION/s/[0-9]*/$revision/" + +# +# Compute pretty form of new version number +# +version_note=`echo $version | awk -F. '{ + if ($3 > 90) + printf ("%d.%d.%d (%d.%d RC%d)\n", + $1, $2, $3, $1, $2 + 1, $3 - 90); + else if ($3 == 0) + printf ("%d.%d\n", $1, $2); + else + printf ("%d.%d.%d\n", $1, $2, $3); }'` + +# +# Find previous version in README +# +last_note=`grep '^2\.[0-9.]*' README | + head -1 | + sed 's/ (2\.[0-9]* RC[0-9]*)//'` +case $last_note in +2.*.*) + last=$last_note + ;; +2.*) + last="$last_note.0" + ;; +*) + echo 'cannot find previous changelog' 1>&2 + exit 1 +esac + +# +# Format the current date for the README header +# +date=`date '+%Y-%m-%d'` + +# +# Update the readme file +# +if [ $version != $last ]; then + # + # header + # + (sed '/^2\.[0-9.]*$/,$d' README | + sed -e "s/Version.*/Version $version_note/" \ + -e "s/200.*/$date/" | awk ' + /^[ \t]/ { + gsub ("^[ \t]*", ""); + gsub ("[ \t]*$", ""); + space=(70 - length) / 2; + for (i = 0; i < space; i++) + printf (" "); + print + next + } + { + print + }' + + # + # changelog + # + + echo $version_note + echo + git-log --pretty=short $last.. | git-shortlog | cat + + # + # previous changelogs + # + + sed -n '/^2\.[0-9.]*$/,$p' README) > README.tmp || + (echo "README update failed"; exit 1) + + $test mv README.tmp README +fi + +$test git-commit -m"Bump version to $version" \ + configure.in \ + fontconfig/fontconfig.h \ + README + +# tag the tree +$test git-tag -u 096c4dd3 -m"Version $version" $version + +# Make distributed change log + +$test "git-log --stat $last.. > ChangeLog-$version" + -- 2.39.5