diff --git a/paludis/hooks/set_portdir.bash b/paludis/hooks/set_portdir.bash index c292fa1..5924aa5 100644 --- a/paludis/hooks/set_portdir.bash +++ b/paludis/hooks/set_portdir.bash @@ -2,8 +2,7 @@ # set PORTDIR -PORTDIR="$(${CAVE} print-repository-metadata --raw-name location gentoo)" -PORTDIR="${PORTDIR#location=}" +PORTDIR="$(${CAVE} print-repository-metadata --format '%v' --raw-name location gentoo)" if [[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] ; then die "PORTDIR empty or pointing to root!" diff --git a/paludis/hooks/sync_all_post/01-sync_cache.bash b/paludis/hooks/sync_all_post/01-sync_cache.bash index 05db12e..111daf1 100644 --- a/paludis/hooks/sync_all_post/01-sync_cache.bash +++ b/paludis/hooks/sync_all_post/01-sync_cache.bash @@ -2,23 +2,23 @@ source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" source "/etc/paludis/hooks/set_portdir.bash" +source "/etc/paludis/hooks/util_functions.bash" -# you may change this to only update cache of specific overlays -overlay_list=( - $(${CAVE} print-repositories | grep -vE '(^gentoo$|^installed$|^installed-unpackaged$|^layman$|^paludis-overlay$|^repository$)') -) +# You may change this to only update cache of specific repositories. +# Should at least include 'gentoo'. Default is all repositories. +repository_list=( $(${CAVE} print-repositories --format e) ) -ebegin "Syncing metadata cache for gentoo repository" -#rsync -avPq rsync://rsync.gentoo.org/gentoo-portage/metadata/md5-cache/ "${PORTDIR}"/metadata/md5-cache/ -egencache --jobs=$(nproc) --repo=gentoo --update --update-use-local-desc -eend $? +# Number of jobs for egencache, default is number or processors. +egencache_jobnum="$(nproc)" -if [[ ${#overlay_list[@]} -gt 0 ]] ; then - ebegin "Syncing metadata cache for overlays" - for _overlay in ${overlay_list[@]} ; do - einfo " ${_overlay}" - egencache --jobs=$(nproc) --repo=${_overlay} --update --update-use-local-desc - done +#ebegin "Fetching pre-generated metadata cache for gentoo repository" +#rsync -aq rsync://rsync.gentoo.org/gentoo-portage/metadata/md5-cache/ "${PORTDIR}"/metadata/md5-cache/ +#eend $? + +einfo "Updating metadata cache for repositories:" +for _repo in ${repository_list[@]} ; do + ebegin " ${_repo}" + egencache --jobs=${egencache_jobnum} --repo=${_repo} --update --update-use-local-desc eend $? -fi +done diff --git a/paludis/hooks/sync_all_post/02-sync_dtd.bash b/paludis/hooks/sync_all_post/02-sync_dtd.bash index 54ef602..3a57acb 100644 --- a/paludis/hooks/sync_all_post/02-sync_dtd.bash +++ b/paludis/hooks/sync_all_post/02-sync_dtd.bash @@ -6,9 +6,8 @@ source "/etc/paludis/hooks/set_portdir.bash" DTDDIR=${PORTDIR}/metadata/dtd ebegin "Updating DTDs" if [[ -e ${DTDDIR} ]]; then - git -C "${DTDDIR}" pull --ff + git -C "${DTDDIR}" pull -q --ff else - git clone https://anongit.gentoo.org/git/data/dtd.git "${DTDDIR}" + git clone -q https://anongit.gentoo.org/git/data/dtd.git "${DTDDIR}" fi eend "$?" - diff --git a/paludis/hooks/sync_all_post/03-sync_glsa.bash b/paludis/hooks/sync_all_post/03-sync_glsa.bash index 5087de4..1f90505 100644 --- a/paludis/hooks/sync_all_post/03-sync_glsa.bash +++ b/paludis/hooks/sync_all_post/03-sync_glsa.bash @@ -6,9 +6,8 @@ source "/etc/paludis/hooks/set_portdir.bash" GLSADIR=${PORTDIR}/metadata/glsa ebegin "Updating GLSAs" if [[ -e ${GLSADIR} ]]; then - git -C "${GLSADIR}" pull --ff + git -C "${GLSADIR}" pull -q --ff else - git clone https://anongit.gentoo.org/git/data/glsa.git "${GLSADIR}" + git clone -q https://anongit.gentoo.org/git/data/glsa.git "${GLSADIR}" fi eend "$?" - diff --git a/paludis/hooks/sync_all_post/04-sync_herds_xml.bash b/paludis/hooks/sync_all_post/04-sync_herds_xml.bash index 1454b1b..3169df8 100644 --- a/paludis/hooks/sync_all_post/04-sync_herds_xml.bash +++ b/paludis/hooks/sync_all_post/04-sync_herds_xml.bash @@ -4,6 +4,5 @@ source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" source "/etc/paludis/hooks/set_portdir.bash" ebegin "Updating herds.xml" -wget -O "${PORTDIR}"/metadata/herds.xml https://api.gentoo.org/packages/herds.xml +wget -q -O "${PORTDIR}"/metadata/herds.xml https://api.gentoo.org/packages/herds.xml eend $? - diff --git a/paludis/hooks/sync_all_post/05-sync_news.bash b/paludis/hooks/sync_all_post/05-sync_news.bash index bfc1e61..4ce3576 100644 --- a/paludis/hooks/sync_all_post/05-sync_news.bash +++ b/paludis/hooks/sync_all_post/05-sync_news.bash @@ -7,9 +7,9 @@ source "/etc/paludis/hooks/util_functions.bash" NEWSDIR="${PORTDIR}"/metadata/news ebegin "Updating news items" if [[ -e ${NEWSDIR} ]]; then - git -C "${NEWSDIR}" pull --ff + git -C "${NEWSDIR}" pull -q --ff else - git clone https://anongit.gentoo.org/git/proj/gentoo-news.git "${NEWSDIR}" + git clone -q https://anongit.gentoo.org/git/proj/gentoo-news.git "${NEWSDIR}" fi eend_die $? diff --git a/paludis/hooks/util_functions.bash b/paludis/hooks/util_functions.bash index 6a430a9..8a2e188 100644 --- a/paludis/hooks/util_functions.bash +++ b/paludis/hooks/util_functions.bash @@ -6,3 +6,4 @@ eend_die() { eend "$@" [[ $1 -ne 0 ]] && exit $1 } +