[system] / trunk / webwork2 / bin / ww-update-config Repository:
ViewVC logotype

Diff of /trunk/webwork2/bin/ww-update-config

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 4202 Revision 4203
1#!/usr/bin/perl 1#!/usr/bin/perl
2 2
3use strict; 3use strict;
4use warnings; 4use warnings;
5
6my $cvs_header_line = '\$' . 'CVSHeader';
5 7
6foreach my $arg (@ARGV) { 8foreach my $arg (@ARGV) {
7 my ($conf_file, $dist_file); 9 my ($conf_file, $dist_file);
8 10
9 if ($arg =~ /^(.*)\.dist$/) { 11 if ($arg =~ /^(.*)\.dist$/) {
22 if ($conf_version eq $dist_version) { 24 if ($conf_version eq $dist_version) {
23 print "$conf_file is up-to-date at version $conf_version.\n"; 25 print "$conf_file is up-to-date at version $conf_version.\n";
24 next; 26 next;
25 } 27 }
26 28
29 print "conf_version=$conf_version dist_version=$dist_version\n";
27 system "cvs diff -r '$conf_version' -r '$dist_version' '$dist_file'" 30 #system "cvs diff -r '$conf_version' -r '$dist_version' '$dist_file'"
28 . "| patch '$conf_file'"; 31 # . "| patch '$conf_file'";
29} 32}
30 33
31sub cvs_version { 34sub cvs_version {
32 my ($file) = @_; 35 my ($file) = @_;
33 open my $fh, "<", $file or die "couldn't open $file for reading: $!\n"; 36 open my $fh, "<", $file or die "couldn't open $file for reading: $!\n";
34 my $line; 37 my $line;
35 while (my $line = <$fh>) { 38 while (my $line = <$fh>) {
36 if ($line =~ /\$CVSHeader: .*?(1(?:\.\d+)+).*?\$/) { 39 if ($line =~ /$cvs_header_line.*?(1(?:\.\d+)+)/) {
37 return $1; 40 return $1;
38 } 41 }
39 } 42 }
40} 43}

Legend:
Removed from v.4202  
changed lines
  Added in v.4203

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9