diff options
author | Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de> | 2016-02-24 23:59:26 +0100 |
---|---|---|
committer | Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de> | 2016-02-25 23:27:38 +0100 |
commit | 9677df8a76b314477c37b0fed7401dcfb1c268eb (patch) | |
tree | ff35db5dfb6d1b9ec85ad9ff464a851e404b45cc | |
parent | bc3c7bb7d4aba3e563434e5627fe1f2176aa18c0 (diff) |
Release: fix release script
- accept minor version number
- allow to skip the build-of-documentation step
- allow release of "any" version from anywhere
- avoid calling "old" reversion scripts, create version.sh
-rwxr-xr-x | release-process/scripts/mk_exim_release.pl | 56 | ||||
-rwxr-xr-x | src/scripts/reversion | 12 |
2 files changed, 50 insertions, 18 deletions
diff --git a/release-process/scripts/mk_exim_release.pl b/release-process/scripts/mk_exim_release.pl index 995720e2c..553ea95a9 100755 --- a/release-process/scripts/mk_exim_release.pl +++ b/release-process/scripts/mk_exim_release.pl @@ -22,16 +22,15 @@ sub get_and_check_version { my $context = shift; # make sure this looks like a real release version - # which should (currently) be 4.xx or 4.xx_RCx - unless ( $release =~ /^(4\.\d\d(?:_RC\d+)?)$/ ) { + # which should (currently) be 4.xx[.y] or 4.xx[.y]_RCx + unless ( $release =~ /^(?<release>(?<major>4\.\d\d)(?:\.(?<minor>\d+))?(?:_RC\d+)?)$/ ) { croak "The given version number does not look right - $release"; } - my $full_release = $1; # untainted here... - my $trunc_release = $full_release; - $trunc_release =~ s/^(4\.\d\d)(?:_RC\d+)?$/$1/; + $context->{release} = $+{release}; + $context->{major} = $+{major}; + $context->{minor} = $+{minor}; - $context->{release} = $full_release; - $context->{trelease} = $trunc_release; + ($context->{trelease} = $+{release}) =~ s/_RC\d+//; } # ------------------------------------------------------------------ @@ -87,7 +86,6 @@ sub export_git_tree { my $archive_file = sprintf( '%s/%s-%s.tar', $context->{tmp}, $context->{pkgname}, $context->{release} ); $context->{tmp_archive_file} = $archive_file; my @cmd = ( 'git', 'archive', '--format=tar', "--output=$archive_file", $context->{tag} ); - # run git command print( "Running: ", join( ' ', @cmd ), "\n" ) if ($verbose); system(@cmd) == 0 || croak "Export failed"; @@ -124,13 +122,37 @@ sub make_version_script { return; } - my @cmd = ("../scripts/reversion", "release"); + # Currently (25. Feb. 2016) the mk_exim_release.pl up to now can't + # deal with security releases.!? So we need a current + # mk_exim_release.pl. But if we use a current (master), the + # reversion script returns wrong version info (it's running inside + # the Git tree and uses git --describe, which always returns the + # current version of master.) I do not want to change the old + # reversion scripts (in 4.86.1, 4.85.1). + # + # Thus we've to provide the version.sh, based on the info we have + # about the release. If reversion finds this, it doesn't try to find + # it's own way to get a valid version number from the git. + open(my $v, '>', 'version.sh') or die "Can't open '>version.sh' $!\n"; + print {$v} <<__; +# initial version automatically generated from $0 +EXIM_RELEASE_VERSION=$context->{major} +EXIM_VARIANT_VERSION=@{[$context->{minor}?'_'.$context->{minor}:'']} +EXIM_COMPILE_NUMBER=0 +__ + close($v); + unlink 'version.h'; + return; + + # Later, if we get the reversion script fixed, we can call it again. + # For now (25. Feb. 2016) we'll leave it unused. + my @cmd = ("../scripts/reversion", "release", $context->{tag}); print( "Running: ", join( ' ', @cmd ), "\n" ) if ($verbose); system(@cmd) == 0 || croak "reversion failed"; unlink "version.h"; - -f "version.sh" or die "failed to create version.h"; + -f "version.sh" or die "failed to create version.sh"; } # ------------------------------------------------------------------ @@ -288,7 +310,7 @@ sub build_package_directories { my $context = shift; build_main_package_directory($context); - build_pspdfinfo_directory($context); + build_pspdfinfo_directory($context) if $context->{build_docs}; } # ------------------------------------------------------------------ @@ -370,6 +392,7 @@ sub create_tar_files { bzip2 => 1, lzip => 0, }, + build_docs => 1, }; my $delete; my $cleanup = 1; @@ -388,6 +411,7 @@ sub create_tar_files { 'man!' => \$man, 'delete!' => \$delete, 'cleanup!' => \$cleanup, + 'build-docs!' => \$context->{build_docs}, ) ) { @@ -404,7 +428,7 @@ sub create_tar_files { chdir( $context->{directory} ) || die; unpack_tree($context); make_version_script($context); - build_documentation($context); + build_documentation($context) if $context->{build_docs}; build_package_directories($context); create_tar_files($context); do_cleanup($context) if ($cleanup); @@ -423,7 +447,7 @@ mk_exim_release.pl - Build an exim release mk_exim_release.pl [options] version Options: - --debug force debug mode (SQL Trace) + --debug force debug mode --verbose force verbose mode --help display this help and exits --man displays man page @@ -432,6 +456,7 @@ mk_exim_release.pl [options] version --directory=dir dir to package --no-lzip do not create .tar.lz files --delete Delete packaging directory at start + --noweb skip the website generation =head1 OPTIONS @@ -439,8 +464,7 @@ mk_exim_release.pl [options] version =item B<--debug> -Forces debug mode cause all SQL statements generated by L<DBIx::Class> -to be output. +Forces debug mode. =item B<--tar> @@ -478,7 +502,7 @@ Builds an exim release. Starting in a populated git repo that has already been tagged for release, build docs, build packages etc. -Parameter is the version number to build as - ie 4.72 4.72RC1 etc +Parameter is the version number to build as - ie 4.72 4.72RC1, 4.86.1, etc =head1 AUTHOR diff --git a/src/scripts/reversion b/src/scripts/reversion index c4618868e..66c6efbe0 100755 --- a/src/scripts/reversion +++ b/src/scripts/reversion @@ -1,5 +1,8 @@ #!/bin/sh +set -e +export LC_ALL=C + # Update Exim's version header file. # Compatibility gross-ness for non-POSIX systems @@ -37,8 +40,13 @@ then # Modify the output of git describe into separate parts for # the name "exim" and the release and variant versions. # Put a dot in the version number and remove a spurious g. - set $(git describe --dirty=-XX --match 'exim-4*' | - sed 's|-| |;s|_|.|;s|[-_]| _|;s|-g|-|') + if [ "$2" ] + then + description=$(git describe "$2") + else + description=$(git describe --dirty=-XX --match 'exim-4*') + fi + set $(echo "$description" | sed 's|-| |;s|_|.|;s|[-_]| _|;s|-g|-|') # Only update if we need to if [ "$2 $3" != "$EXIM_RELEASE_VERSION $EXIM_VARIANT_VERSION" ] then |