diff --git a/paludis/hooks/sync_all_post/01-sync_cache.bash b/paludis/hooks/sync_all_post/01-sync_cache.bash deleted file mode 100644 index 111daf1..0000000 --- a/paludis/hooks/sync_all_post/01-sync_cache.bash +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -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 repositories. -# Should at least include 'gentoo'. Default is all repositories. -repository_list=( $(${CAVE} print-repositories --format e) ) - -# Number of jobs for egencache, default is number or processors. -egencache_jobnum="$(nproc)" - -#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 $? -done - diff --git a/paludis/hooks/sync_all_post/02-sync_dtd.bash b/paludis/hooks/sync_all_post/02-sync_dtd.bash deleted file mode 100644 index 3a57acb..0000000 --- a/paludis/hooks/sync_all_post/02-sync_dtd.bash +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" -source "/etc/paludis/hooks/set_portdir.bash" - -DTDDIR=${PORTDIR}/metadata/dtd -ebegin "Updating DTDs" -if [[ -e ${DTDDIR} ]]; then - git -C "${DTDDIR}" pull -q --ff -else - 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 deleted file mode 100644 index 1f90505..0000000 --- a/paludis/hooks/sync_all_post/03-sync_glsa.bash +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" -source "/etc/paludis/hooks/set_portdir.bash" - -GLSADIR=${PORTDIR}/metadata/glsa -ebegin "Updating GLSAs" -if [[ -e ${GLSADIR} ]]; then - git -C "${GLSADIR}" pull -q --ff -else - 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 deleted file mode 100644 index 3169df8..0000000 --- a/paludis/hooks/sync_all_post/04-sync_herds_xml.bash +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" -source "/etc/paludis/hooks/set_portdir.bash" - -ebegin "Updating 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 deleted file mode 100644 index 01f38f8..0000000 --- a/paludis/hooks/sync_all_post/05-sync_news.bash +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" -source "/etc/paludis/hooks/set_portdir.bash" -source "/etc/paludis/hooks/util_functions.bash" - -NEWSDIR="${PORTDIR}"/metadata/news -ebegin "Updating news items" -if [[ -e ${NEWSDIR} ]]; then - git -C "${NEWSDIR}" pull -q --ff -else - git clone -q https://anongit.gentoo.org/git/data/gentoo-news.git "${NEWSDIR}" -fi - -eend $? "Try to remove ${PORTDIR}/metadata/news" diff --git a/paludis/hooks/sync_post/01-sync_gentoo_cache.bash b/paludis/hooks/sync_post/01-sync_gentoo_cache.bash new file mode 100644 index 0000000..766efec --- /dev/null +++ b/paludis/hooks/sync_post/01-sync_gentoo_cache.bash @@ -0,0 +1,17 @@ +#!/bin/bash + +source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" +source "/etc/paludis/hooks/set_portdir.bash" + +if [[ ${TARGET} == gentoo ]] ; then + # Number of jobs for egencache, default is number or processors. + egencache_jobnum="$(nproc)" + +# 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 $? + + ebegin "Cache update for repository ${TARGET}" + egencache --jobs=${egencache_jobnum} --repo=${TARGET} --update --update-use-local-desc + eend $? +fi diff --git a/paludis/hooks/sync_post/02-sync_gentoo_dtd.bash b/paludis/hooks/sync_post/02-sync_gentoo_dtd.bash new file mode 100644 index 0000000..6c50bf3 --- /dev/null +++ b/paludis/hooks/sync_post/02-sync_gentoo_dtd.bash @@ -0,0 +1,15 @@ +#!/bin/bash + +source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" +source "/etc/paludis/hooks/set_portdir.bash" + +if [[ ${TARGET} == gentoo ]] ; then + DTDDIR=${PORTDIR}/metadata/dtd + ebegin "Updating DTDs" + if [[ -e ${DTDDIR} ]]; then + git -C "${DTDDIR}" pull -q --ff + else + git clone -q https://anongit.gentoo.org/git/data/dtd.git "${DTDDIR}" + fi + eend "$?" +fi diff --git a/paludis/hooks/sync_post/03-sync_gentoo_glsa.bash b/paludis/hooks/sync_post/03-sync_gentoo_glsa.bash new file mode 100644 index 0000000..9042159 --- /dev/null +++ b/paludis/hooks/sync_post/03-sync_gentoo_glsa.bash @@ -0,0 +1,15 @@ +#!/bin/bash + +source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" +source "/etc/paludis/hooks/set_portdir.bash" + +if [[ ${TARGET} == gentoo ]] ; then + GLSADIR=${PORTDIR}/metadata/glsa + ebegin "Updating GLSAs" + if [[ -e ${GLSADIR} ]]; then + git -C "${GLSADIR}" pull -q --ff + else + git clone -q https://anongit.gentoo.org/git/data/glsa.git "${GLSADIR}" + fi + eend "$?" +fi diff --git a/paludis/hooks/sync_post/04-sync_gentoo_herds_xml.bash b/paludis/hooks/sync_post/04-sync_gentoo_herds_xml.bash new file mode 100644 index 0000000..804c180 --- /dev/null +++ b/paludis/hooks/sync_post/04-sync_gentoo_herds_xml.bash @@ -0,0 +1,10 @@ +#!/bin/bash + +source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" +source "/etc/paludis/hooks/set_portdir.bash" + +if [[ ${TARGET} == gentoo ]] ; then + ebegin "Updating herds.xml" + wget -q -O "${PORTDIR}"/metadata/herds.xml https://api.gentoo.org/packages/herds.xml + eend $? +fi diff --git a/paludis/hooks/sync_post/05-sync_gentoo_news.bash b/paludis/hooks/sync_post/05-sync_gentoo_news.bash new file mode 100644 index 0000000..3f04e81 --- /dev/null +++ b/paludis/hooks/sync_post/05-sync_gentoo_news.bash @@ -0,0 +1,15 @@ +#!/bin/bash + +source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" +source "/etc/paludis/hooks/set_portdir.bash" + +if [[ ${TARGET} == gentoo ]] ; then + NEWSDIR="${PORTDIR}"/metadata/news + ebegin "Updating news items" + if [[ -e ${NEWSDIR} ]]; then + git -C "${NEWSDIR}" pull -q --ff + else + git clone -q https://anongit.gentoo.org/git/data/gentoo-news.git "${NEWSDIR}" + fi + eend $? "Try to remove ${PORTDIR}/metadata/news" +fi diff --git a/paludis/hooks/sync_post/06-sync_overlay_cache.bash b/paludis/hooks/sync_post/06-sync_overlay_cache.bash new file mode 100644 index 0000000..4e53c11 --- /dev/null +++ b/paludis/hooks/sync_post/06-sync_overlay_cache.bash @@ -0,0 +1,13 @@ +#!/bin/bash + +source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" +source "/etc/paludis/hooks/set_portdir.bash" + +if [[ ${TARGET} != gentoo && $(${CAVE} print-repository-metadata --raw-name format --format "%v" ${TARGET}) == e ]] ; then + # Number of jobs for egencache, default is number or processors. + egencache_jobnum="$(nproc)" + + ebegin "Cache update for repository ${TARGET}" + egencache --jobs=${egencache_jobnum} --repo=${TARGET} --update --update-use-local-desc + eend $? +fi diff --git a/paludis/hooks/util_functions.bash b/paludis/hooks/util_functions.bash deleted file mode 100644 index 6a430a9..0000000 --- a/paludis/hooks/util_functions.bash +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" - -eend_die() { - eend "$@" - [[ $1 -ne 0 ]] && exit $1 -}