From 3762c6fa6c5c4214698512376fc10e0581956c6e Mon Sep 17 00:00:00 2001 From: Yuta SATOH Date: Tue, 2 Jan 2018 22:39:07 +0900 Subject: automatic_updater.sh: add the missing code to upgrade correctly. --- scripts/automatic_updater.sh | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/scripts/automatic_updater.sh b/scripts/automatic_updater.sh index 2afa6f6..58e8ced 100755 --- a/scripts/automatic_updater.sh +++ b/scripts/automatic_updater.sh @@ -42,7 +42,7 @@ move_makeconf(){ } update_portage(){ - local dl_portage_ver="2.3.8" + local dl_portage_ver="2.3.6" echo "Updating the sys-apps/portage with a manual method..." @@ -63,8 +63,8 @@ update_portage(){ eselect python set 1 } -update_bmake(){ - echo "Updating the bmake..." +update_bmake_command(){ + echo "Updating bmake..." [[ -e /usr/local/bin/make ]] && exit 1 @@ -73,15 +73,32 @@ update_bmake(){ make cp -a make /usr/local/bin/ cd "${PORTDIR}/sys-freebsd/freebsd-ubin" && ebuild $(ls -1 freebsd-ubin-${TARGETVER}*.ebuild | tail -n 1) clean + + env-update + source /etc/profile +} + +update_config_command(){ + echo "Updating config..." + + [[ -e /usr/local/sbin/config ]] && exit 1 + + cd "${PORTDIR}/sys-freebsd/freebsd-usbin" && ebuild $(ls -1 freebsd-usbin-${TARGETVER}*.ebuild | tail -n 1) prepare + cd "${PORTAGE_TMPDIR}"/portage/sys-freebsd/freebsd-usbin-${TARGETVER}*/work/usr.sbin/config + /usr/local/bin/make -m /usr/share/mk/system + cp -a config /usr/local/sbin/ + cd "${PORTDIR}/sys-freebsd/freebsd-usbin" && ebuild $(ls -1 freebsd-usbin-${TARGETVER}*.ebuild | tail -n 1) clean } update_minimal(){ echo "Updating the minimal packages to upgrade the Gentoo/FreeBSD..." emerge -u sys-devel/gcc-config --exclude sys-freebsd/* - update_bmake + update_bmake_command emerge --nodeps sys-freebsd/freebsd-mk-defs + update_config_command + emerge -u ' /etc/portage/package.unmask/binutils-oldversion + echo "sys-devel/binutils" > /etc/portage/package.unmask/toolchain-oldversion + echo "sys-devel/gcc" >> /etc/portage/package.unmask/toolchain-oldversion emerge -u '