diff options
author | Benda Xu <heroxbd@gentoo.org> | 2017-01-09 20:19:16 +0900 |
---|---|---|
committer | Benda Xu <heroxbd@gentoo.org> | 2017-01-09 21:43:29 +0900 |
commit | 61bb1d8c568187e0393bc32d78d5972f8245cae9 (patch) | |
tree | 663336beed38cbea69cf780e15b9fcd0891ae715 /scripts/movl | |
parent | MavenVersion.java: parse version range. (diff) | |
download | java-ebuilder-61bb1d8c568187e0393bc32d78d5972f8245cae9.tar.gz java-ebuilder-61bb1d8c568187e0393bc32d78d5972f8245cae9.tar.bz2 java-ebuilder-61bb1d8c568187e0393bc32d78d5972f8245cae9.zip |
movl: refresh ebuilds and only digest 1 ebuild.
Diffstat (limited to 'scripts/movl')
-rwxr-xr-x | scripts/movl | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/scripts/movl b/scripts/movl index 231ab5d..efc31c7 100755 --- a/scripts/movl +++ b/scripts/movl @@ -1,5 +1,6 @@ #!/bin/bash -source /etc/java-ebuilder.conf +source "/etc/java-ebuilder.conf" +tsh="/usr/lib/java-ebuilder/tree.sh" clean-maven() { rm -f "${CACHEDIR}"/maven-cache @@ -21,6 +22,27 @@ clean() { clean-maven } +rrdep() { + # regenerate reverse dependencies + for rdep in $(egrep -l "$1.*->" -r "${MAVEN_OVERLAY_DIR}"/app-maven); do + [[ ${rdep} = *.ebuild ]] && "${tsh}" ${rdep} + done +} + +refresh() { + if [[ $1=*:* ]]; then + rrdep $1 + else + # input: package name + for ebd in "${MAVEN_OVERLAY_DIR}"/app-maven/$1/*.ebuild; do + mid=$(sed -nr 's,^MAVEN_ID="(.*)",\1,p' "${ebd}") + rm "${ebd}"; "${tsh}" ${mid} + sed "/${mid}/d" -i "${CACHEDIR}"/maven-cache + rrdep ${mid} + done + fi +} + build() { : ${PORTDIR:=$(portageq get_repo_path $(portageq envvar EROOT) gentoo)} : ${PORTAGE_TMPDIR:=$(portageq envvar PORTAGE_TMPDIR)} @@ -51,18 +73,20 @@ build() { fi for M in ${MAVEN_ARTS}; do - /usr/lib/java-ebuilder/tree.sh ${M} + "${tsh}" ${M} done - ls -1 "${MAVEN_OVERLAY_DIR}"/app-maven/*/*.ebuild | parallel ebuild {} digest + cd "${MAVEN_OVERLAY_DIR}"/app-maven + parallel ebuild '$(echo {}/*.ebuild | cut -d\ -f1)' digest ::: * } if [[ $# -gt 0 ]]; then - funcs=$@ + funcs=$1 + shift 1 else funcs=build fi for func in ${funcs}; do - ${func} + ${func} $@ done |