27 lines
590 B
Bash
Executable File
27 lines
590 B
Bash
Executable File
#!/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
|