Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/java-ebuilder:master commit in: scripts/
Date: Wed, 30 Oct 2019 17:35:24
Message-Id: 1475724566.0e037f385db26b5ce17ee796ecf2e8a7af0d18b3.mgorny@gentoo
1 commit: 0e037f385db26b5ce17ee796ecf2e8a7af0d18b3
2 Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 6 03:29:26 2016 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 6 03:29:26 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=0e037f38
7
8 tree.sh: use dirs from conf file.
9
10 scripts/tree.sh | 36 ++++++++++++++++++++----------------
11 1 file changed, 20 insertions(+), 16 deletions(-)
12
13 diff --git a/scripts/tree.sh b/scripts/tree.sh
14 index acabb0a..3e7b828 100755
15 --- a/scripts/tree.sh
16 +++ b/scripts/tree.sh
17 @@ -2,7 +2,9 @@
18 # start from the root of a maven artifact and recursively resolve its
19 # dependencies.
20
21 -mkdir -p ../poms
22 +source /etc/java-ebuilder.conf
23 +
24 +mkdir -p "${POMDIR}"
25
26 gebd() {
27 case ${MA} in
28 @@ -45,8 +47,8 @@ gebd() {
29 local M=${MA}-${MV}
30 local SRC_URI="http://central.maven.org/maven2/${WORKDIR}/${MV}/${M}-sources.jar"
31
32 - if [[ ! -f ../poms/${M}.pom ]]; then
33 - pushd ../poms
34 + if [[ ! -f "${POMDIR}"/${M}.pom ]]; then
35 + pushd "${POMDIR}"
36 wget ${SRC_URI/-sources.jar/.pom}
37
38 # 3rd party plugin not needed here
39 @@ -66,40 +68,42 @@ gebd() {
40 PA=${PA}-bin
41 fi
42 local P=${PA}-${PV}
43 - local ebd=app-maven/${PA}/${P}.ebuild
44 + local ebd="${MAVEN_OVERLAY_DIR}"/app-maven/${PA}/${P}.ebuild
45
46 - if [[ ! -f app-maven/${PA}/${P}.ebuild ]]; then
47 - mkdir -p app-maven/${PA}
48 - java-ebuilder -p ../poms/${M}.pom -e ${ebd} -g --workdir . \
49 - -u ${SRC_URI} --slot ${SLOT:-0} --keywords ~amd64
50 + if [[ ! -f "${ebd}" ]]; then
51 + mkdir -p $(dirname ${ebd})
52 + java-ebuilder -p "${POMDIR}"/${M}.pom -e "${ebd}" -g --workdir . \
53 + -u ${SRC_URI} --slot ${SLOT:-0} --keywords ~amd64 \
54 + --cache-file "${CACHEDIR}"/cache
55
56 # empty parent artifacts
57 # FIXME, this should be removed in poms
58 sed -e '/app-maven\/jsch-agentproxy-bin/d' \
59 -e '/JAVA_GENTOO_CLASSPATH/s|jsch-agentproxy-bin,||' \
60 - -i ${ebd}
61 + -i "${ebd}"
62 fi
63
64 line=app-maven:${PA}:${PV}:${SLOT:-0}::${MID}
65 - if ! grep -q ${line} ${HOME}/.java-ebuilder/maven-cache ; then
66 - pushd ${HOME}/.java-ebuilder > /dev/null
67 + if ! grep -q ${line} "${CACHEDIR}"/maven-cache ; then
68 + pushd "${CACHEDIR}" > /dev/null
69 echo ${line} >> maven-cache
70 cat cache.{0,1} maven-cache > cache
71 popd > /dev/null
72 fi
73
74 - if [[ -z "${MAVEN_NODEP}" ]] && mfill ${ebd}; then
75 - java-ebuilder -p ../poms/${M}.pom -e ${ebd} -g --workdir . \
76 - -u ${SRC_URI} --slot ${SLOT:-0} --keywords ~amd64
77 + if [[ -z "${MAVEN_NODEP}" ]] && mfill "${ebd}"; then
78 + java-ebuilder -p "${POMDIR}"/${M}.pom -e "${ebd}" -g --workdir . \
79 + -u ${SRC_URI} --slot ${SLOT:-0} --keywords ~amd64 \
80 + --cache-file "${CACHEDIR}"/cache
81
82 # empty parent artifacts
83 # FIXME, this should be removed in poms
84 sed -e '/app-maven\/jsch-agentproxy-bin-[0-9]/d' \
85 -e '/JAVA_GENTOO_CLASSPATH/s|jsch-agentproxy-bin,||' \
86 - -i ${ebd}
87 + -i "${ebd}"
88 fi
89
90 - [[ ${SRC_URI} = *-sources.jar ]] || sed -i "/inherit/s/java-pkg-simple/java-pkg-binjar/" ${ebd}
91 + [[ ${SRC_URI} = *-sources.jar ]] || sed -i "/inherit/s/java-pkg-simple/java-pkg-binjar/" "${ebd}"
92 }
93
94 mfill() {