[maven-repo-helper] 01/01: Support multiple relocations per artifact

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Wed Jun 29 22:26:46 UTC 2016


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository maven-repo-helper.

commit 5f1fe60167923f3423a01e1899c0f62ae4e35211
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Thu Jun 30 00:26:13 2016 +0200

    Support multiple relocations per artifact
---
 src/main/bin/mh_installpom | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/src/main/bin/mh_installpom b/src/main/bin/mh_installpom
index 345a73d..39c726d 100644
--- a/src/main/bin/mh_installpom
+++ b/src/main/bin/mh_installpom
@@ -175,23 +175,27 @@ if [[ "${version}" != "${debianVersion}" ]]; then
 fi
 
 if [[ ! -z "$RELOCATE" ]]; then
-    relocatedGAV=(${RELOCATE//:/ })
+    relocations=(${RELOCATE//,/ })
 
-    relocatedGroupId=${relocatedGAV[0]}
-    relocatedArtifactId=${relocatedGAV[1]}
-    relocatedVersion=${relocatedGAV[2]}
-    if [[ -z "${relocatedVersion}" ]]; then
-        relocatedVersion=debian
-    fi
+    for relocation in "${relocations[@]}"
+    do
+        relocatedGAV=(${relocation//:/ })
+
+        relocatedGroupId=${relocatedGAV[0]}
+        relocatedArtifactId=${relocatedGAV[1]}
+        relocatedVersion=${relocatedGAV[2]}
+        if [[ -z "${relocatedVersion}" ]]; then
+            relocatedVersion=debian
+        fi
 
-    relocatedGroupPath=$(echo $relocatedGroupId | tr . / )
+        relocatedGroupPath=$(echo $relocatedGroupId | tr . / )
 
-    relocatedPomPath=debian/${PACKAGE}/usr/share/maven-repo/${relocatedGroupPath}/${relocatedArtifactId}/${relocatedVersion}
-    relocatedPom=${relocatedPomPath}/${relocatedArtifactId}-${relocatedVersion}.pom
+        relocatedPomPath=debian/${PACKAGE}/usr/share/maven-repo/${relocatedGroupPath}/${relocatedArtifactId}/${relocatedVersion}
+        relocatedPom=${relocatedPomPath}/${relocatedArtifactId}-${relocatedVersion}.pom
 
-    mkdir -p ${relocatedPomPath}
+        mkdir -p ${relocatedPomPath}
 
-    cat >> ${relocatedPom} << EOF
+        cat >> ${relocatedPom} << EOF
 <project>
   <modelVersion>4.0.0</modelVersion>
   <groupId>${relocatedGroupId}</groupId>
@@ -207,5 +211,6 @@ if [[ ! -z "$RELOCATE" ]]; then
 </project>
 EOF
 
-    chmod 644 ${relocatedPom}
+        chmod 644 ${relocatedPom}
+    done
 fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/maven-repo-helper.git



More information about the pkg-java-commits mailing list