Skip to content

Commit 45d2f0c

Browse files
committed
Upstream.
1 parent 0e5e293 commit 45d2f0c

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

_lib/ubDistBuild

_prog/core-upgrade.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,20 @@ _upgrade_core() {
6363
local functionEntryPWD
6464
functionEntryPWD="$PWD"
6565

66+
local currentExitStatus
67+
currentExitStatus=0
68+
6669
! "$scriptAbsoluteLocation" _openChRoot && _messagePlain_bad 'fail: _openChRoot' && _messageFAIL
6770

6871
_chroot sudo -n --preserve-env=GH_TOKEN --preserve-env=INPUT_GITHUB_TOKEN -u user bash -c 'cd /home/user/core/infrastructure/ubDistFetch ; /home/user/ubDistBuild/ubiquitous_bash.sh _gitBest pull'
6972
_chroot sudo -n --preserve-env=GH_TOKEN --preserve-env=INPUT_GITHUB_TOKEN -u user bash -c 'cd /home/user/core/infrastructure/ubDistFetch ; /home/user/ubDistBuild/ubiquitous_bash.sh _gitBest submodule update --recursive'
7073
_chroot sudo -n -u user bash -c 'cd /home/user/core/infrastructure/ubDistFetch ; ./ubiquitous_bash.sh _upgrade'
74+
[[ "$?" != "0" ]] && currentExitStatus=1
7175

7276
! "$scriptAbsoluteLocation" _closeChRoot && _messagePlain_bad 'fail: _closeChRoot' && _messageFAIL
7377

78+
[[ "$currentExitStatus" != "0" ]] && _messagePlain_bad 'fail: _upgrade_core' && _messageFAIL
79+
7480
cd "$functionEntryPWD"
7581
}
7682

@@ -135,9 +141,10 @@ APT::AutoRemove::SuggestsImportant "true";' | sudo -n tee /etc/apt/apt.conf.d/99
135141

136142
# https://www.commandinline.com/cheat-sheet/apt/?utm_source=chatgpt.com
137143
_chroot env DEBIAN_FRONTEND=noninteractive apt-get -y update
144+
! _chroot env DEBIAN_FRONTEND=noninteractive apt-get -y update && _messagePlain_bad 'fail: update' && _messageFAIL
138145
_chroot env DEBIAN_FRONTEND=noninteractive apt-get --install-recommends -y upgrade
139-
_chroot env DEBIAN_FRONTEND=noninteractive apt --install-recommends -y upgrade
140-
_chroot env DEBIAN_FRONTEND=noninteractive apt --install-recommends -y full-upgrade
146+
! _chroot env DEBIAN_FRONTEND=noninteractive apt --install-recommends -y upgrade && _messagePlain_bad 'fail: upgrade' && _messageFAIL
147+
! _chroot env DEBIAN_FRONTEND=noninteractive apt --install-recommends -y full-upgrade && _messagePlain_bad 'fail: full-upgrade' && _messageFAIL
141148

142149

143150

ubiquitous_bash.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ _ub_cksum_special_derivativeScripts_contents() {
3636
#export ub_setScriptChecksum_disable='true'
3737
( [[ -e "$0".nck ]] || [[ "${BASH_SOURCE[0]}" != "${0}" ]] || [[ "$1" == '--profile' ]] || [[ "$1" == '--script' ]] || [[ "$1" == '--call' ]] || [[ "$1" == '--return' ]] || [[ "$1" == '--devenv' ]] || [[ "$1" == '--shell' ]] || [[ "$1" == '--bypass' ]] || [[ "$1" == '--parent' ]] || [[ "$1" == '--embed' ]] || [[ "$1" == '--compressed' ]] || [[ "$0" == "/bin/bash" ]] || [[ "$0" == "-bash" ]] || [[ "$0" == "/usr/bin/bash" ]] || [[ "$0" == "bash" ]] ) && export ub_setScriptChecksum_disable='true'
3838
export ub_setScriptChecksum_header='2591634041'
39-
export ub_setScriptChecksum_contents='648402823'
39+
export ub_setScriptChecksum_contents='1433949787'
4040

4141
# CAUTION: Symlinks may cause problems. Disable this test for such cases if necessary.
4242
# WARNING: Performance may be crucial here.
@@ -54461,14 +54461,20 @@ _upgrade_core() {
5446154461
local functionEntryPWD
5446254462
functionEntryPWD="$PWD"
5446354463

54464+
local currentExitStatus
54465+
currentExitStatus=0
54466+
5446454467
! "$scriptAbsoluteLocation" _openChRoot && _messagePlain_bad 'fail: _openChRoot' && _messageFAIL
5446554468

5446654469
_chroot sudo -n --preserve-env=GH_TOKEN --preserve-env=INPUT_GITHUB_TOKEN -u user bash -c 'cd /home/user/core/infrastructure/ubDistFetch ; /home/user/ubDistBuild/ubiquitous_bash.sh _gitBest pull'
5446754470
_chroot sudo -n --preserve-env=GH_TOKEN --preserve-env=INPUT_GITHUB_TOKEN -u user bash -c 'cd /home/user/core/infrastructure/ubDistFetch ; /home/user/ubDistBuild/ubiquitous_bash.sh _gitBest submodule update --recursive'
5446854471
_chroot sudo -n -u user bash -c 'cd /home/user/core/infrastructure/ubDistFetch ; ./ubiquitous_bash.sh _upgrade'
54472+
[[ "$?" != "0" ]] && currentExitStatus=1
5446954473

5447054474
! "$scriptAbsoluteLocation" _closeChRoot && _messagePlain_bad 'fail: _closeChRoot' && _messageFAIL
5447154475

54476+
[[ "$currentExitStatus" != "0" ]] && _messagePlain_bad 'fail: _upgrade_core' && _messageFAIL
54477+
5447254478
cd "$functionEntryPWD"
5447354479
}
5447454480

@@ -54533,9 +54539,10 @@ APT::AutoRemove::SuggestsImportant "true";' | sudo -n tee /etc/apt/apt.conf.d/99
5453354539

5453454540
# https://www.commandinline.com/cheat-sheet/apt/?utm_source=chatgpt.com
5453554541
_chroot env DEBIAN_FRONTEND=noninteractive apt-get -y update
54542+
! _chroot env DEBIAN_FRONTEND=noninteractive apt-get -y update && _messagePlain_bad 'fail: update' && _messageFAIL
5453654543
_chroot env DEBIAN_FRONTEND=noninteractive apt-get --install-recommends -y upgrade
54537-
_chroot env DEBIAN_FRONTEND=noninteractive apt --install-recommends -y upgrade
54538-
_chroot env DEBIAN_FRONTEND=noninteractive apt --install-recommends -y full-upgrade
54544+
! _chroot env DEBIAN_FRONTEND=noninteractive apt --install-recommends -y upgrade && _messagePlain_bad 'fail: upgrade' && _messageFAIL
54545+
! _chroot env DEBIAN_FRONTEND=noninteractive apt --install-recommends -y full-upgrade && _messagePlain_bad 'fail: full-upgrade' && _messageFAIL
5453954546

5454054547

5454154548

0 commit comments

Comments
 (0)