Fetch pre-generated cache

This commit is contained in:
hasufell 2016-01-18 13:31:43 +01:00
parent a2cdf494da
commit 5349fe385a
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
1 changed files with 19 additions and 0 deletions

View File

@ -7,6 +7,25 @@ if [[ ${TARGET} == gentoo ]] ; then
# Number of jobs for egencache, default is number of processors.
egencache_jobnum="$(nproc)"
if [[ -f ${PORTDIR}/metadata/timestamp.x ]]; then
portage_current_timestamp=$(cut -f 1 -d " " "${PORTDIR}/metadata/timestamp.x" )
else
portage_current_timestamp=0
fi
ebegin "Fetching metadata timestamp for ${TARGET}"
rsync -aq rsync://rsync.gentoo.org/gentoo-portage/metadata/timestamp.x "${PORTDIR}"/metadata/timestamp.x
eend $?
portage_new_timestamp=$(cut -f 1 -d " " "${PORTDIR}/metadata/timestamp.x" )
if [[ ${portage_current_timestamp} -lt ${portage_new_timestamp} ]]; then
ebegin "Fetching pre-generated metadata cache for ${TARGET}"
rsync -aq rsync://rsync.gentoo.org/gentoo-portage/metadata/md5-cache/ "${PORTDIR}"/metadata/md5-cache/
eend $?
else
einfo "Metadata cache for ${TARGET} already recent, no need to fetch it :-)"
fi
ebegin "Updating metadata cache for repository ${TARGET}"
egencache --jobs=${egencache_jobnum} --repo=${TARGET} --update --update-use-local-desc
eend $?