Initial commit

This commit is contained in:
hasufell 2015-08-14 22:16:49 +02:00
commit 8551ee66b4
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
8 changed files with 117 additions and 0 deletions

View File

@ -0,0 +1,9 @@
#!/bin/bash
source /etc/portage/util-functions.sh
if [[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] ; then
die "PORTDIR empty or pointing to root!"
elif [[ ! -e ${PORTDIR} ]] ; then
die "${PORTDIR} does not exist!"
fi

View File

@ -0,0 +1,9 @@
#!/bin/bash
source /etc/portage/check-portdir.sh
source /etc/init.d/functions.sh
source /etc/portage/util-functions.sh
einfo "syncing metadata cache"
egencache --jobs=8 --repo=gentoo --update --update-use-local-desc || die "egencache failed!"
einfo "done syncing metadata cache"

19
etc/portage/postsync.d/sync_dtd Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
source /etc/portage/check-portdir.sh
source /etc/init.d/functions.sh
source /etc/portage/util-functions.sh
einfo "updating dtd directory"
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
if [[ -e dtd ]] ; then
einfo "dtd dir already exists, updating..."
cd glsa || die "could not cd into 'dtd'!"
git pull --ff || die "could not pull updates!"
else
einfo "dtd directory does not exist, cloning..."
git clone https://anongit.gentoo.org/git/data/dtd.git || die "could not clone repository!"
fi
einfo "done updating dtd directory"

View File

@ -0,0 +1,19 @@
#!/bin/bash
source /etc/portage/check-portdir.sh
source /etc/init.d/functions.sh
source /etc/portage/util-functions.sh
einfo "updating glsa directory"
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
if [[ -e glsa ]] ; then
einfo "glsa dir already exists, updating..."
cd glsa || die "could not cd into 'glsa'!"
git pull --ff || die "could not pull updates!"
else
einfo "glsa directory does not exist, cloning..."
git clone https://anongit.gentoo.org/git/data/glsa.git || die "could not clone repository!"
fi
einfo "done updating glsa directory"

View File

@ -0,0 +1,13 @@
#!/bin/bash
source /etc/portage/check-portdir.sh
source /etc/init.d/functions.sh
source /etc/portage/util-functions.sh
einfo "updating herds.xml"
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
[[ -e "${PORTDIR}"/metadata/herds.xml ]] && { rm "${PORTDIR}"/metadata/herds.xml || die "failed to rm herds.xml!" ;}
wget https://gitweb.gentoo.org/proj/api.git/plain/files/packages/herds.xml || die "failed to wget herds.xml"
einfo "done updating herds.xml"

View File

@ -0,0 +1,28 @@
#!/bin/bash
source /etc/portage/check-portdir.sh
source /etc/init.d/functions.sh
source /etc/portage/util-functions.sh
einfo "updating news items"
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
if [[ -e news ]] ; then
einfo "news dir already exists, updating..."
cd news || die "could not cd into 'news'!"
git pull --ff || die "could not pull updates!"
else
einfo "glsa directory does not exist, cloning..."
git clone https://anongit.gentoo.org/git/proj/gentoo-news.git news || die "could not clone repository!"
fi
cd "${PORTDIR}"/metadata/news || die "failed to cd into ${PORTDIR}/metadata/news"
git clean -fdxq || die "failed to clean git repo!"
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
einfo "done updating news items"

View File

@ -0,0 +1,12 @@
[DEFAULT]
main-repo = gentoo
[gentoo]
location = /usr/portage
sync-type = git
sync-uri = https://github.com/gentoo/gentoo.git
auto-sync = yes
# for daily squashfs snapshots
#sync-type = squashdelta
#sync-uri = mirror://gentoo/../snapshots/squashfs

View File

@ -0,0 +1,8 @@
#!/bin/bash
source /etc/init.d/functions.sh
die() {
eerror "$*"
exit 1
}