saving uncommitted changes in /etc prior to emerge run

This commit is contained in:
hasufell 2015-08-22 02:31:01 +02:00 committed by Hans Wurst
parent b4eaf2e93f
commit a3271aff2e
12 changed files with 85 additions and 81 deletions

View File

@ -1,24 +0,0 @@
#!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash"
source "/etc/paludis/hooks/util_functions.bash"
# You may change this to only update cache of specific repositories.
# Should at least include 'gentoo'. Default is all repositories.
repository_list=( $(${CAVE} print-repositories --format e) )
# Number of jobs for egencache, default is number or processors.
egencache_jobnum="$(nproc)"
#ebegin "Fetching pre-generated metadata cache for gentoo repository"
#rsync -aq rsync://rsync.gentoo.org/gentoo-portage/metadata/md5-cache/ "${PORTDIR}"/metadata/md5-cache/
#eend $?
einfo "Updating metadata cache for repositories:"
for _repo in ${repository_list[@]} ; do
ebegin " ${_repo}"
egencache --jobs=${egencache_jobnum} --repo=${_repo} --update --update-use-local-desc
eend $?
done

View File

@ -1,13 +0,0 @@
#!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash"
DTDDIR=${PORTDIR}/metadata/dtd
ebegin "Updating DTDs"
if [[ -e ${DTDDIR} ]]; then
git -C "${DTDDIR}" pull -q --ff
else
git clone -q https://anongit.gentoo.org/git/data/dtd.git "${DTDDIR}"
fi
eend "$?"

View File

@ -1,13 +0,0 @@
#!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash"
GLSADIR=${PORTDIR}/metadata/glsa
ebegin "Updating GLSAs"
if [[ -e ${GLSADIR} ]]; then
git -C "${GLSADIR}" pull -q --ff
else
git clone -q https://anongit.gentoo.org/git/data/glsa.git "${GLSADIR}"
fi
eend "$?"

View File

@ -1,8 +0,0 @@
#!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash"
ebegin "Updating herds.xml"
wget -q -O "${PORTDIR}"/metadata/herds.xml https://api.gentoo.org/packages/herds.xml
eend $?

View File

@ -1,15 +0,0 @@
#!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash"
source "/etc/paludis/hooks/util_functions.bash"
NEWSDIR="${PORTDIR}"/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 ${PORTDIR}/metadata/news"

View File

@ -0,0 +1,17 @@
#!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash"
if [[ ${TARGET} == gentoo ]] ; then
# Number of jobs for egencache, default is number or processors.
egencache_jobnum="$(nproc)"
# ebegin "Fetching pre-generated metadata cache for gentoo repository"
# rsync -aq rsync://rsync.gentoo.org/gentoo-portage/metadata/md5-cache/ "${PORTDIR}"/metadata/md5-cache/
# eend $?
ebegin "Cache update for repository ${TARGET}"
egencache --jobs=${egencache_jobnum} --repo=${TARGET} --update --update-use-local-desc
eend $?
fi

View File

@ -0,0 +1,15 @@
#!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash"
if [[ ${TARGET} == gentoo ]] ; then
DTDDIR=${PORTDIR}/metadata/dtd
ebegin "Updating DTDs"
if [[ -e ${DTDDIR} ]]; then
git -C "${DTDDIR}" pull -q --ff
else
git clone -q https://anongit.gentoo.org/git/data/dtd.git "${DTDDIR}"
fi
eend "$?"
fi

View File

@ -0,0 +1,15 @@
#!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash"
if [[ ${TARGET} == gentoo ]] ; then
GLSADIR=${PORTDIR}/metadata/glsa
ebegin "Updating GLSAs"
if [[ -e ${GLSADIR} ]]; then
git -C "${GLSADIR}" pull -q --ff
else
git clone -q https://anongit.gentoo.org/git/data/glsa.git "${GLSADIR}"
fi
eend "$?"
fi

View File

@ -0,0 +1,10 @@
#!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash"
if [[ ${TARGET} == gentoo ]] ; then
ebegin "Updating herds.xml"
wget -q -O "${PORTDIR}"/metadata/herds.xml https://api.gentoo.org/packages/herds.xml
eend $?
fi

View File

@ -0,0 +1,15 @@
#!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash"
if [[ ${TARGET} == gentoo ]] ; then
NEWSDIR="${PORTDIR}"/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 ${PORTDIR}/metadata/news"
fi

View File

@ -0,0 +1,13 @@
#!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
source "/etc/paludis/hooks/set_portdir.bash"
if [[ ${TARGET} != gentoo && $(${CAVE} print-repository-metadata --raw-name format --format "%v" ${TARGET}) == e ]] ; then
# Number of jobs for egencache, default is number or processors.
egencache_jobnum="$(nproc)"
ebegin "Cache update for repository ${TARGET}"
egencache --jobs=${egencache_jobnum} --repo=${TARGET} --update --update-use-local-desc
eend $?
fi

View File

@ -1,8 +0,0 @@
#!/bin/bash
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
eend_die() {
eend "$@"
[[ $1 -ne 0 ]] && exit $1
}