7 ###############################################################################
8 # This is an auxiliary script that is part of the Exim test suite. It must be #
9 # run as root, and is normally called from the main controlling script. Its #
10 # job is to make a copy of Exim, suitably patched so that it can run in the #
11 # test harness. See further comments in the main script. #
13 # The only argument to this script is the name of the Exim binary that is to #
14 # be copied. The script must be run in the correct current directory. #
16 # One option, -o <outfile> can be given. Default is "eximdir/exim" #
17 ###############################################################################
22 my $outfile = defined($opt_o) ? $opt_o : 'eximdir/exim';
24 open(IN, $ARGV[0]) || die "** Failed to open $ARGV[0]: $!\n";
25 open(OUT, ">$outfile") || die "** Failed to open $outfile: $!\n";
29 s/>>>running<<</<<<testing>>>/;
31 (\d+[_.]\d+ # major.minor
32 (?:[_.]\d+)? # optional security-patchlevel
33 (?:[_.]\d+)? # optional patchlevel
34 (?:[_-]RC\d+|[_-]?dev(?:start)?)? # optional RC or dev(start)
35 (?:(?:[_-]\d+)? # git tag distance
36 [-_][[:xdigit:]]+)? # git id
37 (?:[-_]XX)?\0 # git dirty bit
38 <<eximversion>> # marker
41 {"x.yz\0" . ("*" x (length($1) - 5))}xe;
48 chmod 04755, $outfile;
50 # End of patchexim script