+ @extra_files = split(' ', $_);
+ last;
+ }
+ }
+ close IN;
+
+ my $confversion;
+ open(IN, '<', 'configure.in') or die "Unable to open configure.in: $!\n";
+ while (<IN>) {
+ if (/^RSYNC_VERSION=(.*)/) {
+ $confversion = $1;
+ last;
+ }
+ }
+ close IN;
+ die "Unable to find RSYNC_VERSION in configure.in\n" unless defined $confversion;
+
+ open(IN, '<', 'OLDNEWS') or die "Unable to open OLDNEWS: $!\n";
+ $_ = <IN>;
+ my($lastversion) = /(\d+\.\d+\.\d+)/;
+ my $last_protocol_version;
+ while (<IN>) {
+ if (my($ver,$pdate,$pver) = /^\s+\S\S\s\S\S\S\s\d\d\d\d\s+(\d+\.\d+\.\d+)\s+(\d\d \w\w\w \d\d\d\d\s+)?(\d+)$/) {
+ $last_protocol_version = $pver if $ver eq $lastversion;
+ }
+ }
+ close IN;
+ die "Unable to determine protocol_version for $lastversion.\n" unless defined $last_protocol_version;
+
+ my($protocol_version,$subprotocol_version);
+ open(IN, '<', 'rsync.h') or die "Unable to open rsync.h: $!\n";
+ while (<IN>) {
+ if (/^#define\s+PROTOCOL_VERSION\s+(\d+)/) {
+ $protocol_version = $1;
+ } elsif (/^#define\s+SUBPROTOCOL_VERSION\s+(\d+)/) {
+ $subprotocol_version = $1;