Sync with portage-gentoo-git-config repo

This commit is contained in:
hasufell 2015-08-17 18:08:31 +02:00
parent 94f0eeac03
commit b8646c27e5
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
7 changed files with 54 additions and 44 deletions

View File

@ -3,7 +3,7 @@
# set PORTDIR # set PORTDIR
PORTDIR="$(cave print-repository-metadata --raw-name location gentoo)" PORTDIR="$(cave print-repository-metadata --raw-name location gentoo)"
PORTDIR="${PORTDIR#location=}" PORTDIR=${PORTDIR#location=}
if [[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] ; then if [[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] ; then
die "PORTDIR empty or pointing to root!" die "PORTDIR empty or pointing to root!"

View File

@ -1,9 +1,22 @@
#!/bin/bash #!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash" source "/etc/paludis/hooks/set_portdir.bash"
# add your overlays here (name of the overlay!)
overlay_list=(
)
einfo "syncing metadata cache" ebegin "Syncing metadata cache for gentoo repository"
egencache --jobs=8 --repo=gentoo --update --update-use-local-desc || die "egencache failed!" rsync -avPq rsync://rsync.gentoo.org/gentoo-portage/metadata/md5-cache/ "${PORTDIR}"/metadata/md5-cache/
egencache --jobs=$(nproc) --repo=gentoo --update --update-use-local-desc
eend $?
if [[ ${#overlay_list[@]} -gt 0 ]] ; then
ebegin "Syncing metadata cache for overlays"
for _overlay in ${overlay_list[@]} ; do
einfo " ${_overlay}"
egencache --jobs=$(nproc) --repo=${_overlay} --update --update-use-local-desc
done
eend $?
fi

View File

@ -1,17 +1,13 @@
#!/bin/bash #!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash" source "/etc/paludis/hooks/set_portdir.bash"
DTDDIR=${PORTDIR}/metadata/dtd
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!" ebegin "Updating DTDs"
if [[ -e dtd ]] ; then if [[ -e ${DTDDIR} ]]; then
einfo "dtd dir already exists, updating..." git -C "${DTDDIR}" pull --ff
cd dtd || die "could not cd into 'dtd'!"
git pull --ff || die "could not pull updates!"
else else
einfo "dtd directory does not exist, cloning..." git clone https://anongit.gentoo.org/git/data/dtd.git "${DTDDIR}"
git clone https://anongit.gentoo.org/git/data/dtd.git || die "could not clone repository!"
fi fi
eend "$?"

View File

@ -1,17 +1,13 @@
#!/bin/bash #!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash" source "/etc/paludis/hooks/set_portdir.bash"
GLSADIR=${PORTDIR}/metadata/glsa
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!" ebegin "Updating GLSAs"
if [[ -e glsa ]] ; then if [[ -e ${GLSADIR} ]]; then
einfo "glsa dir already exists, updating..." git -C "${GLSADIR}" pull --ff
cd glsa || die "could not cd into 'glsa'!"
git pull --ff || die "could not pull updates!"
else else
einfo "glsa directory does not exist, cloning..." git clone https://anongit.gentoo.org/git/data/glsa.git "${GLSADIR}"
git clone https://anongit.gentoo.org/git/data/glsa.git || die "could not clone repository!"
fi fi
eend "$?"

View File

@ -1,10 +1,8 @@
#!/bin/bash #!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash" source "/etc/paludis/hooks/set_portdir.bash"
ebegin "Updating herds.xml"
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!" wget -O "${PORTDIR}"/metadata/herds.xml https://api.gentoo.org/packages/herds.xml
[[ -e "${PORTDIR}"/metadata/herds.xml ]] && { rm "${PORTDIR}"/metadata/herds.xml || die "failed to rm herds.xml!" ;} eend $?
wget https://gitweb.gentoo.org/data/api.git/plain/files/packages/herds.xml || die "failed to wget herds.xml"

View File

@ -3,23 +3,22 @@
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash" source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "${PALUDIS_EBUILD_DIR}/die_functions.bash" source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash" source "/etc/paludis/hooks/set_portdir.bash"
source "/etc/paludis/hooks/util_functions.bash"
NEWSDIR="${PORTDIR}"/metadata/news
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!" ebegin "Updating news items"
if [[ -e news ]] ; then if [[ -e ${NEWSDIR} ]]; then
einfo "news dir already exists, updating..." git -C "${NEWSDIR}" pull --ff
cd news || die "could not cd into 'news'!"
git pull --ff || die "could not pull updates!"
else else
einfo "glsa directory does not exist, cloning..." git clone https://anongit.gentoo.org/git/proj/gentoo-news.git "${NEWSDIR}"
git clone https://anongit.gentoo.org/git/proj/gentoo-news.git news || die "could not clone repository!"
fi fi
eend_die $?
cd "${PORTDIR}"/metadata/news || die "failed to cd into ${PORTDIR}/metadata/news" ebegin "Cleaning news git repo"
git clean -fdxq || die "failed to clean git repo!" git -C "${NEWSDIR}" clean -fdxq
eend_die $?
ebegin "Copying news to base directory"
cp -a "${NEWSDIR}"/*/* "${NEWSDIR}"
eend $?
if [[ -n "$(find . -mindepth 1 -maxdepth 1 -type d -name "*-*-*")" ]] ; then
die "it seems the repository format of proj/gentoo-news has changed! Update your script!"
else
cp -a */* . || die "could not copy news dirs to base news dir!"
fi

View File

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