diff --git a/etc/portage/check-portdir.sh b/etc/portage/check-portdir.sh deleted file mode 100644 index 7fe1ff6..0000000 --- a/etc/portage/check-portdir.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -source /etc/portage/util-functions.sh - -if [[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] ; then - die "PORTDIR empty or pointing to root!" -elif [[ ! -e ${PORTDIR} ]] ; then - die "${PORTDIR} does not exist!" -fi diff --git a/etc/portage/postsync.d/sync_cache b/etc/portage/postsync.d/sync_cache deleted file mode 100755 index 6f0e39a..0000000 --- a/etc/portage/postsync.d/sync_cache +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -source /etc/portage/check-portdir.sh -source /etc/init.d/functions.sh -source /etc/portage/util-functions.sh - -# You may change this to only update cache of specific repositories. -# Should at least include 'gentoo'. Default is all repositories. -repository_list=( $(portageq get_repos /) ) - -# Number of jobs for egencache, default is number or processors. -parallel_jobs="$(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="${parallel_jobs}" --repo="${repo}" --update --update-use-local-desc - eend $? -done - diff --git a/etc/portage/postsync.d/sync_dtd b/etc/portage/postsync.d/sync_dtd deleted file mode 100755 index c9f9def..0000000 --- a/etc/portage/postsync.d/sync_dtd +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -source /etc/portage/check-portdir.sh -source /etc/init.d/functions.sh -source /etc/portage/util-functions.sh - -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/etc/portage/postsync.d/sync_glsa b/etc/portage/postsync.d/sync_glsa deleted file mode 100755 index d463fcb..0000000 --- a/etc/portage/postsync.d/sync_glsa +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -source /etc/portage/check-portdir.sh -source /etc/init.d/functions.sh -source /etc/portage/util-functions.sh - -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/etc/portage/postsync.d/sync_herds_xml b/etc/portage/postsync.d/sync_herds_xml deleted file mode 100755 index a19888e..0000000 --- a/etc/portage/postsync.d/sync_herds_xml +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -source /etc/portage/check-portdir.sh -source /etc/init.d/functions.sh -source /etc/portage/util-functions.sh - -ebegin "Updating herds.xml" -wget -q -O "${PORTDIR}"/metadata/herds.xml https://api.gentoo.org/packages/herds.xml -eend $? diff --git a/etc/portage/postsync.d/sync_news b/etc/portage/postsync.d/sync_news deleted file mode 100755 index 4466bcb..0000000 --- a/etc/portage/postsync.d/sync_news +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -source /etc/portage/check-portdir.sh -source /etc/init.d/functions.sh -source /etc/portage/util-functions.sh - -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/proj/gentoo-news.git "${NEWSDIR}" -fi -eend_die $? - -ebegin "Cleaning news git repo" -git -C "${NEWSDIR}" clean -fdxq -eend_die $? - -ebegin "Copying news to base directory" -cp -a "${NEWSDIR}"/*/* "${NEWSDIR}" -eend $? diff --git a/etc/portage/repo.postsync.d/sync_gentoo_cache b/etc/portage/repo.postsync.d/sync_gentoo_cache new file mode 100755 index 0000000..e52d8bf --- /dev/null +++ b/etc/portage/repo.postsync.d/sync_gentoo_cache @@ -0,0 +1,20 @@ +#!/bin/bash + +source /etc/init.d/functions.sh +source /etc/portage/util-functions.sh + +repository_name="${1}" +repository_path="${3}" + +# Number of jobs for egencache, default is number or processors. +parallel_jobs="$(nproc)" + +if [[ ${repository_name} == "gentoo" ]]; 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 $? + + ebegin "Updating metadata cache for ${repository_name}" + egencache --jobs="${parallel_jobs}" --repo="${repository_name}" --update --update-use-local-desc + eend $? +fi diff --git a/etc/portage/repo.postsync.d/sync_gentoo_dtd b/etc/portage/repo.postsync.d/sync_gentoo_dtd new file mode 100755 index 0000000..431003e --- /dev/null +++ b/etc/portage/repo.postsync.d/sync_gentoo_dtd @@ -0,0 +1,18 @@ +#!/bin/bash + +source /etc/init.d/functions.sh +source /etc/portage/util-functions.sh + +repository_name="${1}" +repository_path="${3}" + +if [[ ${repository_name} == "gentoo" ]]; then + DTDDIR="${repository_path}"/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/etc/portage/repo.postsync.d/sync_gentoo_glsa b/etc/portage/repo.postsync.d/sync_gentoo_glsa new file mode 100755 index 0000000..f0e93c7 --- /dev/null +++ b/etc/portage/repo.postsync.d/sync_gentoo_glsa @@ -0,0 +1,18 @@ +#!/bin/bash + +source /etc/init.d/functions.sh +source /etc/portage/util-functions.sh + +repository_name="${1}" +repository_path="${3}" + +if [[ ${repository_name} == "gentoo" ]]; then + GLSADIR="${repository_path}"/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/etc/portage/repo.postsync.d/sync_gentoo_herds_xml b/etc/portage/repo.postsync.d/sync_gentoo_herds_xml new file mode 100755 index 0000000..2d84e14 --- /dev/null +++ b/etc/portage/repo.postsync.d/sync_gentoo_herds_xml @@ -0,0 +1,13 @@ +#!/bin/bash + +source /etc/init.d/functions.sh +source /etc/portage/util-functions.sh + +repository_name="${1}" +repository_path="${3}" + +if [[ ${repository_name} == "gentoo" ]]; then + ebegin "Updating herds.xml" + wget -q -O "${repository_path}"/metadata/herds.xml https://api.gentoo.org/packages/herds.xml + eend $? +fi diff --git a/etc/portage/repo.postsync.d/sync_gentoo_news b/etc/portage/repo.postsync.d/sync_gentoo_news new file mode 100755 index 0000000..5dfb2e3 --- /dev/null +++ b/etc/portage/repo.postsync.d/sync_gentoo_news @@ -0,0 +1,26 @@ +#!/bin/bash + +source /etc/init.d/functions.sh +source /etc/portage/util-functions.sh + +repository_name="${1}" +repository_path="${3}" + +if [[ ${repository_name} == "gentoo" ]]; then + NEWSDIR="${repository_path}"/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/proj/gentoo-news.git "${NEWSDIR}" + fi + eend_die $? + + ebegin "Cleaning news git repo" + git -C "${NEWSDIR}" clean -fdxq + eend_die $? + + ebegin "Copying news to base directory" + cp -a "${NEWSDIR}"/*/* "${NEWSDIR}" + eend $? +fi