- # 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.
- #
- # 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}
-EXIM_VARIANT_VERSION=$stamp
+ sub make_version_script {
+ my $context = shift;
+
+ #my $variant = substr( $context->{v}{release}, length($context->{v}{target_release}) );
+ #if ( $context->{v}{release} ne $context->{v}{target_release} . $variant ) {
+ # die "Broken version numbering, I'm buggy";
+ #}
+
+
+ # Work
+ if (not my $pid = fork // die "$ME: Cannot fork: $!\n") {
+
+ my $source_tree = catdir($context->{d}{vcs_export}, 'src', 'src');
+ ### $source_tree
+
+ chdir $source_tree or die "chdir $source_tree: $!\n";
+
+ croak "WARNING: version.sh already exists - leaving it in place\n"
+ if -f 'version.sh';
+
+ # 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.
+ #
+ # 4.89 series: the logic here did not handle _RC<N> thus breaking RC
+ # status in versions. nb: rc in context should be same as $variant
+ # in local context.
+
+ #my $stamp = $context->{minor} ? '_'.$context->{minor} : '';
+ #$stamp .= $context->{rc} if $context->{rc};
+ my $release = $context->{v}{rc} ? $context->{v}{target_release}
+ : $context->{v}{last_tag};
+
+ my $variant =
+ $context->{v}{rc} ? $context->{v}{rc}
+ : $context->{v}{quick} ? $context->{v}{quick}
+ : '';
+
+ print "[$cwd] create version.sh\n" if $verbose;
+ open(my $v, '>', 'version.sh') or die "Can't open version.sh for writing: $!\n";
+ print {$v} <<__;
+# initial version automatically generated by $0
+EXIM_RELEASE_VERSION=$release
+EXIM_VARIANT_VERSION=$variant