Adjust postsync scripts to work correctly in repo.postsync.d

This commit is contained in:
Marios Titas 2015-08-21 00:59:04 +01:00
parent 76f7a75106
commit d70b7b6056
4 changed files with 52 additions and 36 deletions

View File

@ -1,14 +1,18 @@
#!/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}"
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
eend "$?"

View File

@ -1,14 +1,18 @@
#!/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}"
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
eend "$?"

View File

@ -1,9 +1,13 @@
#!/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 $?
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

@ -1,22 +1,26 @@
#!/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}"
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
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 $?