saving uncommitted changes in /etc prior to emerge run

This commit is contained in:
hasufell 2015-08-14 21:35:32 +02:00 committed by Hans Wurst
parent 12a483fe36
commit 2dedf3a185
6 changed files with 23 additions and 21 deletions

View File

@ -0,0 +1,12 @@
#!/bin/bash
# set PORTDIR
PORTDIR="$(cave print-repository-metadata --raw-name location gentoo)"
PORTDIR="${PORTDIR#location=}"
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

@ -2,10 +2,7 @@
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
PORTDIR="/usr/portage"
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
source "/etc/paludis/hooks/set_portdir.bash"
einfo "syncing metadata cache"

View File

@ -2,10 +2,7 @@
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
PORTDIR="/usr/portage"
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
source "/etc/paludis/hooks/set_portdir.bash"
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"

View File

@ -2,10 +2,7 @@
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
PORTDIR="/usr/portage"
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
source "/etc/paludis/hooks/set_portdir.bash"
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"

View File

@ -2,10 +2,7 @@
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
PORTDIR="/usr/portage"
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
source "/etc/paludis/hooks/set_portdir.bash"
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"

View File

@ -2,10 +2,7 @@
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
PORTDIR="/usr/portage"
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
source "/etc/paludis/hooks/set_portdir.bash"
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
@ -20,4 +17,9 @@ fi
cd "${PORTDIR}"/metadata/news || die "failed to cd into ${PORTDIR}/metadata/news"
git clean -fdxq || die "failed to clean git repo!"
cp -a */* . || die "could not copy news dirs to base news dir!"
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