]> source.dussan.org Git - jgit.git/commitdiff
Fix version.sh to not overwrite ${project.version} 65/13565/1
authorMatthias Sohn <matthias.sohn@sap.com>
Tue, 4 Jun 2013 11:58:24 +0000 (13:58 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 4 Jun 2013 20:28:01 +0000 (22:28 +0200)
Change-Id: If5ae792581170bcba2dc1860012cbe389d8e9f24
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
tools/version.sh

index eaff9a61d829ec80f4ef397ac8f6230b9177f5cb..52a02c59f7029a63c19d03b5b7641199ec03d97c 100755 (executable)
@@ -133,7 +133,14 @@ perl -pi~ -e '
        ' org.eclipse.jgit.packaging/org.*.feature/feature.xml
 
 perl -pi~ -e '
-       s{<(version)>.*</\1>}{<${1}>'"$POM_V"'</${1}>};
+       if ($ARGV ne $old_argv) {
+               $seen_version = 0;
+               $old_argv = $ARGV;
+       }
+       if (!$seen_version) {
+               $seen_version = 1 if
+               s{<(version)>.*</\1>}{<${1}>'"$POM_V"'</${1}>};
+       }
        ' org.eclipse.jgit.packaging/org.*.feature/pom.xml
 
 perl -pi~ -e '
@@ -152,8 +159,8 @@ perl -pi~ -e '
                $seen_version = 0;
                $old_argv = $ARGV;
        }
-       if ($seen_version < 2) {
-               $seen_version++ if
+       if (!$seen_version) {
+               $seen_version = 1 if
                s{<(version)>.*</\1>}{<${1}>'"$POM_V"'</${1}>};
        }
        ' org.eclipse.jgit.packaging/pom.xml