Merge branch 'repo-postsync' of git://github.com/redneb/portage-gentoo-git-config

This commit is contained in:
hasufell 2015-08-21 20:27:31 +02:00
commit 2a7607cdea
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
11 changed files with 95 additions and 93 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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