The ability to release 4.XX.Y via hardcoding a version.sh as part of
release broke the ability to do properly versioned RC releases. Fix
that.
Try to fix ownership of files in tarballs to not be local system user.
(cherry picked from commit
7677a8673f89843326aab3944e608c6be4339039)
Signed-off-by: Phil Pennock <pdp@exim.org>
# make sure this looks like a real release version
# which should (currently) be 4.xx[.y] or 4.xx[.y]_RCx
# make sure this looks like a real release version
# which should (currently) be 4.xx[.y] or 4.xx[.y]_RCx
- unless ( $release =~ /^(?<release>(?<major>4\.\d\d)(?:\.(?<minor>\d+))?(?:_RC\d+)?)$/ ) {
+ unless ( $release =~ /^(?<release>(?<major>4\.\d\d)(?:\.(?<minor>\d+))?(?<rc>_RC\d+)?)$/ ) {
croak "The given version number does not look right - $release";
}
$context->{release} = $+{release};
$context->{major} = $+{major};
$context->{minor} = $+{minor};
croak "The given version number does not look right - $release";
}
$context->{release} = $+{release};
$context->{major} = $+{major};
$context->{minor} = $+{minor};
+ $context->{candidatev} = $+{rc};
($context->{trelease} = $+{release}) =~ s/_RC\d+//;
}
($context->{trelease} = $+{release}) =~ s/_RC\d+//;
}
# 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.
# 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.
+ #
+ # 4.89 series: the logic here did not handle _RC<N> thus breaking RC
+ # status in versions. nb: candidatev in context should be same as $variant
+ # in local context.
+ my $stamp = $context->{minor} ? '_'.$context->{minor} : '';
+ $stamp .= $context->{candidatev} if $context->{candidatev};
+ #
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}
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_VARIANT_VERSION=$stamp
EXIM_COMPILE_NUMBER=0
__
close($v);
EXIM_COMPILE_NUMBER=0
__
close($v);
+ # We ideally do not want local system user information in release tarballs;
+ # those are artifacts of use of tar for backups and have no place in
+ # software release packaging; if someone extracts as root, then they should
+ # get sane file ownerships.
+ my $ownership = "";
+ if (`tar --help 2>&1` =~ /^\s*--owner=/m) {
+ $ownership .= " --owner=$context->{tar_perms}{user} --group=$context->{tar_perms}{group}";
+ # on this GNU tar, --numeric-owner works during creation too
+ $ownership .= " --numeric-owner";
+ }
+
# See also environment variables set in main, tuning compression levels
my @COMPRESSIONS = (
# compressors-dict-key, file-extension, flags-as-string
# See also environment variables set in main, tuning compression levels
my @COMPRESSIONS = (
# compressors-dict-key, file-extension, flags-as-string
my ($compkey, $extension, $flags) = @{$comp};
next unless $context->{compressors}{$compkey};
print "Creating: ${pkgs}/${dirname}.tar.${extension}\n" if ($verbose || $debug);
my ($compkey, $extension, $flags) = @{$comp};
next unless $context->{compressors}{$compkey};
print "Creating: ${pkgs}/${dirname}.tar.${extension}\n" if ($verbose || $debug);
- system("$tar cf ${pkgs}/${dirname}.tar.${extension} ${flags} --numeric-owner -C ${pkgdirs} ${dirname}");
+ system("$tar cf ${pkgs}/${dirname}.tar.${extension} ${flags} ${ownership} -C ${pkgdirs} ${dirname}");
tmp_dir => File::Temp->newdir(),
webgen_base => "$FindBin::Bin/../../../exim-website",
tar_cmd => 'tar',
tmp_dir => File::Temp->newdir(),
webgen_base => "$FindBin::Bin/../../../exim-website",
tar_cmd => 'tar',
+ tar_perms => {
+ user => '0',
+ group => '0',
+ },
make_cmd => 'make',
compressors => {
gzip => 1,
make_cmd => 'make',
compressors => {
gzip => 1,