Move hooks to sync_post

This also removes overlay egencaching, might be re-added later
or just added to the README as a suggestion.
This commit is contained in:
hasufell 2015-08-22 00:17:33 +02:00
parent 8e1d6c5ba5
commit 86a8707cbc
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
11 changed files with 72 additions and 81 deletions

View File

@ -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

View File

@ -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 "$?"

View File

@ -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 "$?"

View File

@ -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 $?

View File

@ -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"

View File

@ -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 "Updating metadata cache for repository ${TARGET}"
egencache --jobs=${egencache_jobnum} --repo=${TARGET} --update --update-use-local-desc
eend $?
fi

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,8 +0,0 @@
#!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
eend_die() {
eend "$@"
[[ $1 -ne 0 ]] && exit $1
}