1 |
commit: 13dc4654dc4c919fad3983c8a9eceab316e19858 |
2 |
Author: zongyu <zzy2529420793 <AT> gmail <DOT> com> |
3 |
AuthorDate: Sun Aug 23 03:28:36 2020 +0000 |
4 |
Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Aug 23 14:01:22 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=13dc4654 |
7 |
|
8 |
update scripts.new/* to make use of 'hprefixify' |
9 |
|
10 |
Signed-off-by: zongyu <zzy2529420793 <AT> gmail.com> |
11 |
|
12 |
scripts.new/movl | 4 ++-- |
13 |
scripts.new/resources/Makefiles/cache.mk | 4 ++-- |
14 |
scripts.new/resources/Makefiles/environment.mk | 23 +++++++++++++---------- |
15 |
scripts.new/resources/Makefiles/stage2.mk | 9 +++++---- |
16 |
4 files changed, 22 insertions(+), 18 deletions(-) |
17 |
|
18 |
diff --git a/scripts.new/movl b/scripts.new/movl |
19 |
index 1f8ae3d..793eea9 100755 |
20 |
--- a/scripts.new/movl |
21 |
+++ b/scripts.new/movl |
22 |
@@ -1,7 +1,7 @@ |
23 |
#!/bin/bash |
24 |
-EROOT=$(python -c "import portage;print(portage.root)") |
25 |
[[ ${CONFIG} ]] && CONFIG=$(printf "%q\n" "$(realpath "${CONFIG}")") |
26 |
-export PATH="${PATH}:${EROOT}/usr/lib/java-ebuilder/bin" |
27 |
+export PATH="${PATH}:/usr/lib/java-ebuilder/bin" |
28 |
+export EROOT=$(dirname /etc) |
29 |
|
30 |
if [[ $# -gt 0 ]]; then |
31 |
if [[ "$1" == "-h" || "$1" == "--help" ]]; then |
32 |
|
33 |
diff --git a/scripts.new/resources/Makefiles/cache.mk b/scripts.new/resources/Makefiles/cache.mk |
34 |
index 459bab9..a2d7a29 100644 |
35 |
--- a/scripts.new/resources/Makefiles/cache.mk |
36 |
+++ b/scripts.new/resources/Makefiles/cache.mk |
37 |
@@ -4,7 +4,7 @@ ${CACHE_TIMESTAMP}: |
38 |
${PRE_STAGE1_CACHE}.raw: ${CACHE_TIMESTAMP} |
39 |
args=" --refresh-cache";\ |
40 |
for repo in ${REPOS}; do\ |
41 |
- args+=" -t $${repo}";\ |
42 |
+ args="$${args} -t $${repo}";\ |
43 |
done;\ |
44 |
java-ebuilder $${args} --cache-file "$@" |
45 |
|
46 |
@@ -14,7 +14,7 @@ ${PRE_STAGE1_CACHE}: ${PRE_STAGE1_CACHE}.raw |
47 |
${POST_STAGE1_CACHE}.raw: ${STAGE2_MAKEFILE} |
48 |
args=" --refresh-cache -t ${STAGE1_DIR}";\ |
49 |
for repo in ${REPOS}; do\ |
50 |
- args+=" -t $${repo}";\ |
51 |
+ args="$${args} -t $${repo}";\ |
52 |
done;\ |
53 |
java-ebuilder $${args} --cache-file "$@" |
54 |
|
55 |
|
56 |
diff --git a/scripts.new/resources/Makefiles/environment.mk b/scripts.new/resources/Makefiles/environment.mk |
57 |
index 4ce014a..d583cb8 100644 |
58 |
--- a/scripts.new/resources/Makefiles/environment.mk |
59 |
+++ b/scripts.new/resources/Makefiles/environment.mk |
60 |
@@ -1,11 +1,12 @@ |
61 |
# Variables to drive tree.sh |
62 |
|
63 |
-# determine EROOT |
64 |
-# ${EROOT} with '\' to deal with spaces |
65 |
-EROOT=$(shell printf "%q\n" \ |
66 |
- "$(shell python -c "import portage;print(portage.root)")") |
67 |
-# quoted verion of ${EROOT} |
68 |
-EROOT_SH="$(shell python -c "import portage;print(portage.root)")" |
69 |
+# SH is bad |
70 |
+SHELL=bash |
71 |
+ |
72 |
+# determine EROOT. |
73 |
+# thanks to hprefixify, I do not need to call "python3 -c ..." |
74 |
+EROOT_SH="$(shell dirname /etc)" |
75 |
+EROOT=$(shell printf "%q\n" ${EROOT_SH}) |
76 |
|
77 |
# java-ebuilder.conf |
78 |
CONFIG?=${EROOT}/etc/java-ebuilder.conf |
79 |
@@ -14,7 +15,6 @@ include ${CONFIG} |
80 |
# Aritifact whose dependency to be fill |
81 |
MAVEN_OVERLAY_DIR?=${EROOT}/var/lib/java-ebuilder/maven |
82 |
POMDIR?=${EROOT}/var/lib/java-ebuilder/poms |
83 |
-CACHE_DIR=$(shell printf "%q\n" ${CACHEDIR}) |
84 |
|
85 |
# helpers |
86 |
TSH=${EROOT}/usr/lib/java-ebuilder/bin/tree.sh |
87 |
@@ -27,12 +27,15 @@ STAGE2_MAKEFILE?=${EROOT}/var/lib/java-ebuilder/stage1/stage2.mk |
88 |
|
89 |
# PORTAGE REPOS |
90 |
## grab all the repositories installed on this system |
91 |
-REPOS?=$(shell portageq get_repo_path ${EROOT_SH}\ |
92 |
- $(shell portageq get_repos ${EROOT_SH})) |
93 |
+REPOS?=$(shell portageq get_repo_path ${EROOT}\ |
94 |
+ $(shell portageq get_repos ${EROOT})) |
95 |
REPOS+=${MAVEN_OVERLAY_DIR} |
96 |
|
97 |
-# cache |
98 |
+# where is the LookUp Table |
99 |
LUTFILE?=${EROOT}/usr/lib/java-ebuilder/resources/LUT |
100 |
+ |
101 |
+# cache, redefine CACHE_DIR to make it work with GNU Make |
102 |
+CACHE_DIR=$(shell printf "%q\n" ${CACHEDIR}) |
103 |
CACHE_TIMESTAMP?=${CACHE_DIR}/cache.stamp |
104 |
PRE_STAGE1_CACHE?=${CACHE_DIR}/pre-stage1-cache |
105 |
POST_STAGE1_CACHE?=${CACHE_DIR}/post-stage1-cache |
106 |
|
107 |
diff --git a/scripts.new/resources/Makefiles/stage2.mk b/scripts.new/resources/Makefiles/stage2.mk |
108 |
index 09518dc..764bc5c 100644 |
109 |
--- a/scripts.new/resources/Makefiles/stage2.mk |
110 |
+++ b/scripts.new/resources/Makefiles/stage2.mk |
111 |
@@ -7,7 +7,7 @@ force-stage2: ${STAGE2_MAKEFILE} ${POST_STAGE1_CACHE} |
112 |
make -f ${STAGE2_MAKEFILE} all -j`nproc` -B |
113 |
|
114 |
post-stage2: |
115 |
- for dir in "${MAVEN_OVERLAY_DIR}"/*; do \ |
116 |
+ for dir in ${MAVEN_OVERLAY_DIR}/*; do \ |
117 |
find $${dir} -type f -name \*.ebuild | grep . || continue;\ |
118 |
pushd $${dir} > /dev/null;\ |
119 |
parallel ebuild '$$(echo {}/*.ebuild | cut -d\ -f1)' digest ::: *;\ |
120 |
@@ -16,8 +16,9 @@ post-stage2: |
121 |
|
122 |
clean-stage2: |
123 |
# just to make sure "${MAVEN_OVERLAY_DIR}" points to an overlay |
124 |
- [[ -f "${MAVEN_OVERLAY_DIR}"/profiles/repo_name ]] &&\ |
125 |
- find "${MAVEN_OVERLAY_DIR}" -type f \ |
126 |
+ if [[ -f ${MAVEN_OVERLAY_DIR}/profiles/repo_name ]]; then\ |
127 |
+ find ${MAVEN_OVERLAY_DIR} -type f \ |
128 |
\( -name \*.ebuild \ |
129 |
-o -name Manifest \)\ |
130 |
- -delete |
131 |
+ -delete;\ |
132 |
+ fi |