gentooup: better adaption to packagebuilding chroots
This commit is contained in:
parent
de9207112b
commit
d7842fb21d
1 changed files with 24 additions and 11 deletions
19
gentooup.sh
19
gentooup.sh
|
@ -7,6 +7,10 @@ PORTAGE_UPGRADE_OPTIONS=("-vuNDk")
|
||||||
|
|
||||||
PORTAGE_ASK="-a"
|
PORTAGE_ASK="-a"
|
||||||
|
|
||||||
|
INTERACTIVE=1
|
||||||
|
|
||||||
|
CHROOTED=0
|
||||||
|
|
||||||
SYNC_COMMAND="emaint sync -a"
|
SYNC_COMMAND="emaint sync -a"
|
||||||
|
|
||||||
int_handler() {
|
int_handler() {
|
||||||
|
@ -27,6 +31,11 @@ if [[ ! -t 1 ]] ; then
|
||||||
echo "Waiting 10s for manual abortion..."
|
echo "Waiting 10s for manual abortion..."
|
||||||
sleep 10
|
sleep 10
|
||||||
PORTAGE_ASK=""
|
PORTAGE_ASK=""
|
||||||
|
INTERACTIVE=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$(stat -c %d:%i /)" != "$(stat -c %d:%i /proc/1/root/.)" ]; then
|
||||||
|
CHROOTED=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${1} == "--no-sync" || ${2} == "--no-sync" ]] ; then
|
if [[ ${1} == "--no-sync" || ${2} == "--no-sync" ]] ; then
|
||||||
|
@ -54,15 +63,15 @@ echo "emerge options: ${PORTAGE_OPTIONS[*]}"
|
||||||
emerge $PORTAGE_ASK "${PORTAGE_UPGRADE_OPTIONS[@]}" "${PORTAGE_OPTIONS[@]}" world
|
emerge $PORTAGE_ASK "${PORTAGE_UPGRADE_OPTIONS[@]}" "${PORTAGE_OPTIONS[@]}" world
|
||||||
echo "emerge return value: $?"
|
echo "emerge return value: $?"
|
||||||
|
|
||||||
if [[ -t 1 ]] ; then
|
if [[ $INTERACTIVE == 1 ]] ; then
|
||||||
dispatch-conf
|
dispatch-conf
|
||||||
echo "dispatch-conf return value: $?"
|
echo "dispatch-conf return value: $?"
|
||||||
|
|
||||||
emerge "${PORTAGE_UPGRADE_OPTIONS[@]}" "${PORTAGE_OPTIONS[@]}" world
|
emerge "${PORTAGE_UPGRADE_OPTIONS[@]}" "${PORTAGE_OPTIONS[@]}" world
|
||||||
echo emerge return value: $?
|
echo "emerge return value: $?"
|
||||||
|
|
||||||
dispatch-conf
|
dispatch-conf
|
||||||
echo dispatch-conf return value: $?
|
echo "dispatch-conf return value: $?"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SETS=("@preserved-rebuild")
|
SETS=("@preserved-rebuild")
|
||||||
|
@ -85,6 +94,8 @@ fi
|
||||||
echo "**************** clean /etc/portage/ ***************"
|
echo "**************** clean /etc/portage/ ***************"
|
||||||
portpeek -rq
|
portpeek -rq
|
||||||
|
|
||||||
|
#Currently chroots are used to build and preserve packages!
|
||||||
|
if [[ $CHROOTED == 0 ]] ; then
|
||||||
echo "**************** clean /usr/portage/distfiles ***********"
|
echo "**************** clean /usr/portage/distfiles ***********"
|
||||||
eclean-dist -d
|
eclean-dist -d
|
||||||
|
|
||||||
|
@ -96,6 +107,8 @@ if [[ -n "$(which buildCurrentSymlinkedKernel.sh 2> /dev/null)" ]] ; then
|
||||||
elif [[ -x "${HOME}/bin/buildCurrentSymlinkedKernel.sh" ]] ; then
|
elif [[ -x "${HOME}/bin/buildCurrentSymlinkedKernel.sh" ]] ; then
|
||||||
"${HOME}/bin/buildCurrentSymlinkedKernel.sh"
|
"${HOME}/bin/buildCurrentSymlinkedKernel.sh"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "***************** remove unneeded packages *******************"
|
echo "***************** remove unneeded packages *******************"
|
||||||
echo Started at "$STARTDATE"
|
echo Started at "$STARTDATE"
|
||||||
|
|
Loading…
Add table
Reference in a new issue