Merge branch 'cache_fetch' of git://github.com/junghans/portage-gentoo-git-config

This commit is contained in:
hasufell 2015-11-05 15:43:57 +01:00
commit 120e5d88d4
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -10,9 +10,24 @@ source /lib/gentoo/functions.sh
# Number of jobs for egencache, default is number or processors.
parallel_jobs="$(nproc)"
ebegin "Fetching pre-generated metadata cache for ${repository_name}"
rsync -aq rsync://rsync.gentoo.org/gentoo-portage/metadata/md5-cache/ "${repository_path}"/metadata/md5-cache/
if [[ -f ${repository_path}/metadata/timestamp.x ]]; then
portage_current_timestamp=$(cut -f 1 -d " " "${repository_path}/metadata/timestamp.x" )
else
portage_current_timestamp=0
fi
ebegin "Fetching metadata timestamp for ${repository_name}"
rsync -aq rsync://rsync.gentoo.org/gentoo-portage/metadata/timestamp.x "${repository_path}"/metadata/timestamp.x
eend $?
portage_new_timestamp=$(cut -f 1 -d " " "${repository_path}/metadata/timestamp.x" )
if [[ ${portage_current_timestamp} -lt ${portage_new_timestamp} ]]; then
ebegin "Fetching pre-generated metadata cache for ${repository_name}"
rsync -aq rsync://rsync.gentoo.org/gentoo-portage/metadata/md5-cache/ "${repository_path}"/metadata/md5-cache/
eend $?
else
einfo "Metadata cache for ${repository_name} already recent, no need to fetch it :-)"
fi
ebegin "Updating metadata cache for ${repository_name}"
egencache --jobs="${parallel_jobs}" --repo="${repository_name}" --update --update-use-local-desc