aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Stephen P. Bennett <spb@exherbo.org> 2006-04-14 14:30:02 +0000
committerAvatar Stephen P. Bennett <spb@exherbo.org> 2006-04-14 14:30:02 +0000
commit5ac8fb56088d340c52d796b672d3739cfff412c7 (patch)
tree9e9621f45e22d21bf432cd3f5954c3113cdea940
parent444fa889205cd6c22264b9205846dc2076a9345e (diff)
downloadpaludis-5ac8fb56088d340c52d796b672d3739cfff412c7.tar.gz
paludis-5ac8fb56088d340c52d796b672d3739cfff412c7.tar.xz
Read /CONFIG_PROTECT{,_MASK} if present, and allow override of each
-rw-r--r--ebuild/builtin_merge.bash9
-rw-r--r--ebuild/builtin_unmerge.bash26
2 files changed, 28 insertions, 7 deletions
diff --git a/ebuild/builtin_merge.bash b/ebuild/builtin_merge.bash
index aef3d55..cd373da 100644
--- a/ebuild/builtin_merge.bash
+++ b/ebuild/builtin_merge.bash
@@ -32,10 +32,17 @@ builtin_merge()
local v
for v in CATEGORY CBUILD CFLAGS CHOST CXXFLAGS DEPEND DESCRIPTION EAPI \
FEATURES HOMEPAGE INHERITED IUSE KEYWORDS LICENSE PDEPEND PF \
- PROVIDE RDEPEND SLOT SRC_URI USE ; do
+ PROVIDE RDEPEND SLOT SRC_URI USE CONFIG_PROTECT CONFIG_PROTECT_MASK ; do
echo "${!v}" > "${dbdir}"/${v} || die "pkg db write ${v} failed"
done
+ if [[ -n ${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT} ]]; then
+ CONFIG_PROTECT=${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT}
+ fi
+ if [[ -n ${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK} ]]; then
+ CONFIG_PROTECT_MASK=${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK}
+ fi
+
[[ -f "${EBUILD}" ]] && cp "${EBUILD}" ${dbdir}/
local x
for i in ${INHERITED} ; do
diff --git a/ebuild/builtin_unmerge.bash b/ebuild/builtin_unmerge.bash
index 52dd7f0..10d047e 100644
--- a/ebuild/builtin_unmerge.bash
+++ b/ebuild/builtin_unmerge.bash
@@ -28,13 +28,27 @@ builtin_unmerge()
eval "${v}='$(< ${dbdir}/${v} )' || die \"Load key ${v} failed\""
done
- eval $(bzcat "${dbdir}/environment.bz2" | while read line; do
- if [[ ${line%%=*} == CONFIG_PROTECT ]]; then
- echo "CONFIG_PROTECT='${line#*=} ${CONFIG_PROTECT}'"
- elif [[ ${line%%=*} == CONFIG_PROTECT_MASK ]]; then
- echo "CONFIG_PROTECT_MASK='${line#*=} ${CONFIG_PROTECT_MASK}'"
+ if [[ -f ${dbdir}/CONFIG_PROTECT ]]; then
+ CONFIG_PROTECT="$(< ${dbdir}/CONFIG_PROTECT) ${CONFIG_PROTECT}"
+ if [[ -f ${dbdir}/CONFIG_PROTECT_MASK ]]; then
+ CONFIG_PROTECT_MASK="$(< ${dbdir}/CONFIG_PROTECT_MASK)"
fi
- done)
+ else
+ eval $(bzcat "${dbdir}/environment.bz2" | while read line; do
+ if [[ ${line%%=*} == CONFIG_PROTECT ]]; then
+ echo "CONFIG_PROTECT='${line#*=} ${CONFIG_PROTECT}'"
+ elif [[ ${line%%=*} == CONFIG_PROTECT_MASK ]]; then
+ echo "CONFIG_PROTECT_MASK='${line#*=}'"
+ fi
+ done)
+ fi
+
+ if [[ -n ${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT} ]]; then
+ CONFIG_PROTECT=${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT}
+ fi
+ if [[ -n ${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK} ]]; then
+ CONFIG_PROTECT_MASK=${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK}
+ fi
${PALUDIS_EBUILD_MODULES_DIR}/utils/unmerge "${ROOT}/" "${dbdir}/CONTENTS" \
|| die "unmerge failed"