saving uncommitted changes in /etc prior to emerge run
This commit is contained in:
parent
12a483fe36
commit
2dedf3a185
12
paludis/hooks/set_portdir.bash
Normal file
12
paludis/hooks/set_portdir.bash
Normal 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
|
@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
||||||
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
||||||
|
source "/etc/paludis/hooks/set_portdir.bash"
|
||||||
PORTDIR="/usr/portage"
|
|
||||||
|
|
||||||
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
|
|
||||||
|
|
||||||
|
|
||||||
einfo "syncing metadata cache"
|
einfo "syncing metadata cache"
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
||||||
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
||||||
|
source "/etc/paludis/hooks/set_portdir.bash"
|
||||||
PORTDIR="/usr/portage"
|
|
||||||
|
|
||||||
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
|
|
||||||
|
|
||||||
|
|
||||||
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
||||||
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
||||||
|
source "/etc/paludis/hooks/set_portdir.bash"
|
||||||
PORTDIR="/usr/portage"
|
|
||||||
|
|
||||||
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
|
|
||||||
|
|
||||||
|
|
||||||
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
||||||
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
||||||
|
source "/etc/paludis/hooks/set_portdir.bash"
|
||||||
PORTDIR="/usr/portage"
|
|
||||||
|
|
||||||
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
|
|
||||||
|
|
||||||
|
|
||||||
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
||||||
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
||||||
|
source "/etc/paludis/hooks/set_portdir.bash"
|
||||||
PORTDIR="/usr/portage"
|
|
||||||
|
|
||||||
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
|
|
||||||
|
|
||||||
|
|
||||||
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
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"
|
cd "${PORTDIR}"/metadata/news || die "failed to cd into ${PORTDIR}/metadata/news"
|
||||||
git clean -fdxq || die "failed to clean git repo!"
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user