diff options
author | 2020-08-23 11:28:36 +0800 | |
---|---|---|
committer | 2020-08-23 22:01:22 +0800 | |
commit | 13dc4654dc4c919fad3983c8a9eceab316e19858 (patch) | |
tree | ebe8a62f085a16be7efde59920265a4ed554037c | |
parent | rewrite scripts/* (diff) | |
download | java-ebuilder-13dc4654dc4c919fad3983c8a9eceab316e19858.tar.gz java-ebuilder-13dc4654dc4c919fad3983c8a9eceab316e19858.tar.bz2 java-ebuilder-13dc4654dc4c919fad3983c8a9eceab316e19858.zip |
update scripts.new/* to make use of 'hprefixify'
Signed-off-by: zongyu <zzy2529420793@gmail.com>
-rwxr-xr-x | scripts.new/movl | 4 | ||||
-rw-r--r-- | scripts.new/resources/Makefiles/cache.mk | 4 | ||||
-rw-r--r-- | scripts.new/resources/Makefiles/environment.mk | 23 | ||||
-rw-r--r-- | scripts.new/resources/Makefiles/stage2.mk | 9 |
4 files changed, 22 insertions, 18 deletions
diff --git a/scripts.new/movl b/scripts.new/movl index 1f8ae3d..793eea9 100755 --- a/scripts.new/movl +++ b/scripts.new/movl @@ -1,7 +1,7 @@ #!/bin/bash -EROOT=$(python -c "import portage;print(portage.root)") [[ ${CONFIG} ]] && CONFIG=$(printf "%q\n" "$(realpath "${CONFIG}")") -export PATH="${PATH}:${EROOT}/usr/lib/java-ebuilder/bin" +export PATH="${PATH}:/usr/lib/java-ebuilder/bin" +export EROOT=$(dirname /etc) if [[ $# -gt 0 ]]; then if [[ "$1" == "-h" || "$1" == "--help" ]]; then diff --git a/scripts.new/resources/Makefiles/cache.mk b/scripts.new/resources/Makefiles/cache.mk index 459bab9..a2d7a29 100644 --- a/scripts.new/resources/Makefiles/cache.mk +++ b/scripts.new/resources/Makefiles/cache.mk @@ -4,7 +4,7 @@ ${CACHE_TIMESTAMP}: ${PRE_STAGE1_CACHE}.raw: ${CACHE_TIMESTAMP} args=" --refresh-cache";\ for repo in ${REPOS}; do\ - args+=" -t $${repo}";\ + args="$${args} -t $${repo}";\ done;\ java-ebuilder $${args} --cache-file "$@" @@ -14,7 +14,7 @@ ${PRE_STAGE1_CACHE}: ${PRE_STAGE1_CACHE}.raw ${POST_STAGE1_CACHE}.raw: ${STAGE2_MAKEFILE} args=" --refresh-cache -t ${STAGE1_DIR}";\ for repo in ${REPOS}; do\ - args+=" -t $${repo}";\ + args="$${args} -t $${repo}";\ done;\ java-ebuilder $${args} --cache-file "$@" diff --git a/scripts.new/resources/Makefiles/environment.mk b/scripts.new/resources/Makefiles/environment.mk index 4ce014a..d583cb8 100644 --- a/scripts.new/resources/Makefiles/environment.mk +++ b/scripts.new/resources/Makefiles/environment.mk @@ -1,11 +1,12 @@ # Variables to drive tree.sh -# determine EROOT -# ${EROOT} with '\' to deal with spaces -EROOT=$(shell printf "%q\n" \ - "$(shell python -c "import portage;print(portage.root)")") -# quoted verion of ${EROOT} -EROOT_SH="$(shell python -c "import portage;print(portage.root)")" +# SH is bad +SHELL=bash + +# determine EROOT. +# thanks to hprefixify, I do not need to call "python3 -c ..." +EROOT_SH="$(shell dirname /etc)" +EROOT=$(shell printf "%q\n" ${EROOT_SH}) # java-ebuilder.conf CONFIG?=${EROOT}/etc/java-ebuilder.conf @@ -14,7 +15,6 @@ include ${CONFIG} # Aritifact whose dependency to be fill MAVEN_OVERLAY_DIR?=${EROOT}/var/lib/java-ebuilder/maven POMDIR?=${EROOT}/var/lib/java-ebuilder/poms -CACHE_DIR=$(shell printf "%q\n" ${CACHEDIR}) # helpers TSH=${EROOT}/usr/lib/java-ebuilder/bin/tree.sh @@ -27,12 +27,15 @@ STAGE2_MAKEFILE?=${EROOT}/var/lib/java-ebuilder/stage1/stage2.mk # PORTAGE REPOS ## grab all the repositories installed on this system -REPOS?=$(shell portageq get_repo_path ${EROOT_SH}\ - $(shell portageq get_repos ${EROOT_SH})) +REPOS?=$(shell portageq get_repo_path ${EROOT}\ + $(shell portageq get_repos ${EROOT})) REPOS+=${MAVEN_OVERLAY_DIR} -# cache +# where is the LookUp Table LUTFILE?=${EROOT}/usr/lib/java-ebuilder/resources/LUT + +# cache, redefine CACHE_DIR to make it work with GNU Make +CACHE_DIR=$(shell printf "%q\n" ${CACHEDIR}) CACHE_TIMESTAMP?=${CACHE_DIR}/cache.stamp PRE_STAGE1_CACHE?=${CACHE_DIR}/pre-stage1-cache POST_STAGE1_CACHE?=${CACHE_DIR}/post-stage1-cache diff --git a/scripts.new/resources/Makefiles/stage2.mk b/scripts.new/resources/Makefiles/stage2.mk index 09518dc..764bc5c 100644 --- a/scripts.new/resources/Makefiles/stage2.mk +++ b/scripts.new/resources/Makefiles/stage2.mk @@ -7,7 +7,7 @@ force-stage2: ${STAGE2_MAKEFILE} ${POST_STAGE1_CACHE} make -f ${STAGE2_MAKEFILE} all -j`nproc` -B post-stage2: - for dir in "${MAVEN_OVERLAY_DIR}"/*; do \ + for dir in ${MAVEN_OVERLAY_DIR}/*; do \ find $${dir} -type f -name \*.ebuild | grep . || continue;\ pushd $${dir} > /dev/null;\ parallel ebuild '$$(echo {}/*.ebuild | cut -d\ -f1)' digest ::: *;\ @@ -16,8 +16,9 @@ post-stage2: clean-stage2: # just to make sure "${MAVEN_OVERLAY_DIR}" points to an overlay - [[ -f "${MAVEN_OVERLAY_DIR}"/profiles/repo_name ]] &&\ - find "${MAVEN_OVERLAY_DIR}" -type f \ + if [[ -f ${MAVEN_OVERLAY_DIR}/profiles/repo_name ]]; then\ + find ${MAVEN_OVERLAY_DIR} -type f \ \( -name \*.ebuild \ -o -name Manifest \)\ - -delete + -delete;\ + fi |