| 82 | | #dont proceed if main/stable is old |
| 83 | | #get last changed date from svn |
| 84 | | open( INFO, "svn info http://svn.greenstone.org/main/$ENV{'BRANCH_PATH'}|" ) |
| 85 | | or die "Cant determine age of stable tag"; |
| 86 | | my $changed_date; |
| 87 | | while ( my $line = <INFO>) { |
| 88 | | chomp($line); |
| 89 | | if ( $line =~ /^Last Changed Date:/ ) { |
| 90 | | $changed_date = $line; |
| 91 | | break; |
| 92 | | } |
| 93 | | } |
| 94 | | close(INFO); |
| 95 | | #change the format |
| 96 | | $changed_date =~ s/.*: ([^ ]+) .*/\1/g; |
| 97 | | if ( $changed_date !~ /^20[0-9]{2}-[0-9]{2}-[0-9]{2}$/ ) { |
| 98 | | die "Cant determine age of stable tag"; |
| 99 | | } |
| 100 | | $changed_date =~ s/-/./g; |
| 101 | | #check if main/stable is new |
| 102 | | if ( $changed_date ne get_date() ) { |
| 103 | | print "main/stable is old, will not create snapshot\n"; |
| 104 | | exit; |
| 105 | | } else { |
| 106 | | print "main/stable is fresh, will create snapshot\n"; |
| | 87 | #dont proceed if main/stable is old |
| | 88 | #get last changed date from svn |
| | 89 | open( INFO, "svn info http://svn.greenstone.org/main/$ENV{'BRANCH_PATH'}|" ) |
| | 90 | or die "Cant determine age of stable tag"; |
| | 91 | my $changed_date; |
| | 92 | while ( my $line = <INFO>) { |
| | 93 | chomp($line); |
| | 94 | if ( $line =~ /^Last Changed Date:/ ) { |
| | 95 | $changed_date = $line; |
| | 96 | break; |
| 109 | | $ENV{'UPLOAD_DIR'}="nzdl\@puka.cs.waikato.ac.nz:/greenstone/greenstone.org/base/release-snapshots"; |
| | 99 | close(INFO); |
| | 100 | #change the format |
| | 101 | $changed_date =~ s/.*: ([^ ]+) .*/\1/g; |
| | 102 | if ( $changed_date !~ /^20[0-9]{2}-[0-9]{2}-[0-9]{2}$/ ) { |
| | 103 | die "Cant determine age of stable tag"; |
| | 104 | } |
| | 105 | $changed_date =~ s/-/./g; |
| | 106 | #check if main/stable is new |
| | 107 | if ( $changed_date ne get_date() ) { |
| | 108 | print "main/stable is old, will not create snapshot\n"; |
| | 109 | exit; |
| | 110 | } else { |
| | 111 | print "main/stable is fresh, will create snapshot\n"; |
| | 112 | } |