diff --git a/etc/portage/repo.postsync.d/sync_gentoo_dtd b/etc/portage/repo.postsync.d/sync_gentoo_dtd index c9f9def..b3f4b46 100755 --- a/etc/portage/repo.postsync.d/sync_gentoo_dtd +++ b/etc/portage/repo.postsync.d/sync_gentoo_dtd @@ -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 "$?" diff --git a/etc/portage/repo.postsync.d/sync_gentoo_glsa b/etc/portage/repo.postsync.d/sync_gentoo_glsa index d463fcb..2d1cfc9 100755 --- a/etc/portage/repo.postsync.d/sync_gentoo_glsa +++ b/etc/portage/repo.postsync.d/sync_gentoo_glsa @@ -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 "$?" diff --git a/etc/portage/repo.postsync.d/sync_gentoo_herds_xml b/etc/portage/repo.postsync.d/sync_gentoo_herds_xml index a19888e..06a3fc8 100755 --- a/etc/portage/repo.postsync.d/sync_gentoo_herds_xml +++ b/etc/portage/repo.postsync.d/sync_gentoo_herds_xml @@ -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 diff --git a/etc/portage/repo.postsync.d/sync_gentoo_news b/etc/portage/repo.postsync.d/sync_gentoo_news index 4466bcb..a3eef5d 100755 --- a/etc/portage/repo.postsync.d/sync_gentoo_news +++ b/etc/portage/repo.postsync.d/sync_gentoo_news @@ -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 $?