commit bc8d9c14f0922e7e3a3a1105955d510bd23f4656
Author: Michael Simacek <msimacek(a)redhat.com>
Date: Thu Sep 12 10:11:36 2013 +0200
pom_editor: fix not failing on no-ops
java-utils/pom_editor.sh | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/java-utils/pom_editor.sh b/java-utils/pom_editor.sh
index 61663a9..78fc780 100644
--- a/java-utils/pom_editor.sh
+++ b/java-utils/pom_editor.sh
@@ -94,10 +94,11 @@ _pom_patch()
# them don't. In order to be able to process all POMs in a uniform
# way we force explicit namespace declaration here. (An assumption
# is made that model version is 4.0.0.)
- sed -i 's|<project>|<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">|' "${pom}"
+ sed -i 's|<project\s*\(/\)>|<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"\1>|' "${pom}"
# Apply identity transformation.
- xsltproc --nonet - "${pom}" >"${pom}".tmp
<<<"${_pom_xslt_header}${_pom_xslt_trailer}"
+ cp "${pom}" "${pom}.tmp"
+ (xsltproc --nonet - "${pom}"
<<<"${_pom_xslt_header}${_pom_xslt_trailer}")|diff -uwZE
"${pom}" - |patch "${pom}.tmp" >/dev/null
# Try to apply the patch.
xsltproc --nonet - "${pom}".tmp |diff -uwZE "${pom}" - |patch
"${pom}" >/dev/null