portage-gentoo-git-config/etc/portage/repo.postsync.d/sync_gentoo_news

18 lines
407 B
Bash
Executable File

#!/bin/bash
source /lib/gentoo/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/data/gentoo-news.git "${NEWSDIR}"
fi
eend $? "Try to remove ${NEWSDIR}"
fi