]> granicus.if.org Git - postgis/commitdiff
Don't override postgis_svn_revision.h with a fake revision (#1634)
authorSandro Santilli <strk@keybit.net>
Wed, 29 Feb 2012 13:35:20 +0000 (13:35 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 29 Feb 2012 13:35:20 +0000 (13:35 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9348 b70326c6-7e19-0410-871a-916f4a2858ee

utils/svn_repo_revision.pl

index 519e8707526c0ed9983a52fcbc0868e6a3e98936..add006981e4022a0d10857c12ce96bda8ec2cc2e 100755 (executable)
@@ -14,8 +14,6 @@ $target = $ARGV[0] if $ARGV[0];
 # Read the svn revision number
 my $svn_rev = &read_rev($target);
 
-# TODO: compare what's known already with what's to be written
-
 # Write it 
 &write_defn($svn_rev);
 
@@ -113,7 +111,7 @@ sub write_defn {
   my $oldrev = 0;
 
   # Do not override the file if new detected
-  # revision isn't different from the existing one
+  # revision isn't zero nor different from the existing one
   if ( -f $rev_file ) {
     open(IN, "<$rev_file");
     my $oldrevline = <IN>;
@@ -121,8 +119,8 @@ sub write_defn {
       $oldrev = $1;
     }
     close(IN);
-    if ( $rev == $oldrev ) {
-      print STDERR "Not updating existing rev file at $rev\n";
+    if ( $rev == 0 or $rev == $oldrev ) {
+      print STDERR "Not updating existing rev file at $oldrev\n";
       return;
     }
   }