From da252b8a6f01c30407f59a6d53b64d392c927f8e Mon Sep 17 00:00:00 2001 From: Geaaru Date: Sat, 11 Jan 2020 19:25:40 +0100 Subject: [PATCH] Add SABAYON_UPGRADE_REPO env * the argument of the inner_chroot_script.sh is not used anymore. For set sabayon-limbo repository we need set SABAYON_UPGRADE_REPO variable with value sabayon-limbo. * equo upgrade is done only one time if SABAYON_UPGRADE_REPO is set. --- molecules/sabayon-amd64-spinbase-dev.spec | 2 +- scripts/inner_chroot_script.sh | 13 ------------- scripts/inner_source_chroot_update.sh | 18 +++++++++++++----- scripts/sabayon_iso_build.sh | 1 + 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/molecules/sabayon-amd64-spinbase-dev.spec b/molecules/sabayon-amd64-spinbase-dev.spec index c02440a..a0ba38d 100644 --- a/molecules/sabayon-amd64-spinbase-dev.spec +++ b/molecules/sabayon-amd64-spinbase-dev.spec @@ -3,7 +3,7 @@ %env %import ${SABAYON_MOLECULE_HOME:-/sabayon}/molecules/amd64.common %env destination_chroot: ${SABAYON_MOLECULE_HOME:-/sabayon}/chroots/limbo -%env inner_chroot_script: ${SABAYON_MOLECULE_HOME:-/sabayon}/scripts/inner_chroot_script.sh sabayon-limbo +%env inner_chroot_script: ${SABAYON_MOLECULE_HOME:-/sabayon}/scripts/inner_chroot_script.sh %env destination_livecd_root: ${SABAYON_MOLECULE_HOME:-/sabayon}/chroots/limbo # Release Version diff --git a/scripts/inner_chroot_script.sh b/scripts/inner_chroot_script.sh index 9f49a56..a4427d6 100755 --- a/scripts/inner_chroot_script.sh +++ b/scripts/inner_chroot_script.sh @@ -1,7 +1,5 @@ #!/bin/bash -UPGRADE_REPO="${1}" - /usr/sbin/env-update . /etc/profile @@ -66,17 +64,6 @@ rm -f /etc/env.d/02locale ln -sf ../locale.conf /etc/env.d/02locale -if [ -n "${UPGRADE_REPO}" ]; then - echo "Upgrading system by enabling ${UPGRADE_REPO}" - equo repo enable "${UPGRADE_REPO}" || exit 1 - FORCE_EAPI=2 safe_run equo update || exit 1 - - equo repo mirrorsort "${UPGRADE_REPO}" # ignore errors - ETP_NONINTERACTIVE=1 safe_run equo upgrade --fetch || exit 1 - ETP_NONINTERACTIVE=1 equo upgrade --purge || exit 1 - echo "-5" | equo conf update -fi - # Cleanup Perl cruft perl-cleaner --ph-clean diff --git a/scripts/inner_source_chroot_update.sh b/scripts/inner_source_chroot_update.sh index 99639ac..b4d2497 100755 --- a/scripts/inner_source_chroot_update.sh +++ b/scripts/inner_source_chroot_update.sh @@ -59,8 +59,16 @@ for repo in $(equo repo list -q); do equo repo mirrorsort "${repo}" # ignore errors done -safe_run equo upgrade --fetch || exit 1 -equo upgrade --purge || exit 1 +if [ -n "${SABAYON_UPGRADE_REPO}" ]; then + echo "Upgrading system by enabling ${SABAYON_UPGRADE_REPO}" + equo repo enable "${SABAYON_UPGRADE_REPO}" || exit 1 + FORCE_EAPI=2 safe_run equo update || exit 1 + + equo repo mirrorsort "${SABAYON_UPGRADE_REPO}" # ignore errors +fi + +ETP_NONINTERACTIVE=1 safe_run equo upgrade --fetch || exit 1 +ETP_NONINTERACTIVE=1 equo upgrade --purge || exit 1 # FIXME: Dup in iner_chroot_script.sh @@ -77,9 +85,6 @@ else plymouth-set-default-theme solar fi -equo remove "${PACKAGES_TO_REMOVE[@]}" # ignore -echo "-5" | equo conf update - if [[ ${SABAYON_INSTALL_KERNEL} -eq 1 ]] ; then # check if a kernel update is needed kernel_target_pkg="$(equo match -q --installed virtual/linux-binary)" @@ -136,6 +141,9 @@ if [ -n "${SABAYON_EXTRA_PKGS}" ] ; then safe_run equo i ${SABAYON_EXTRA_PKGS[@]} fi +equo remove "${PACKAGES_TO_REMOVE[@]}" # ignore +echo "-5" | equo conf update + # keep /lib/modules clean at all times for moddir in $(find /lib/modules -maxdepth 1 -type d -empty); do echo "Cleaning ${moddir} because it's empty" diff --git a/scripts/sabayon_iso_build.sh b/scripts/sabayon_iso_build.sh index 177f2fe..07719ff 100755 --- a/scripts/sabayon_iso_build.sh +++ b/scripts/sabayon_iso_build.sh @@ -72,6 +72,7 @@ SABAYON_SOURCE_ISO = ${SABAYON_SOURCE_ISO} SABAYON_SOURCE_ISO_DEV = ${SABAYON_SOURCE_ISO_DEV} DRACUT = ${DRACUT} DRACUT_SQUASHFS = ${DRACUT_SQUASHFS} +SABAYON_UPGRADE_REPO = ${SABAYON_UPGRADE_REPO} "