Skip to content

Commit cf30f84

Browse files
committed
build
1 parent ed47da0 commit cf30f84

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

usr/share/usability-misc/dist-installer-cli-standalone

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ get_distro() {
719719
##### END pasted by build-dist-installer-cli from file /usr/libexec/helper-scripts/get_os.sh
720720

721721
get_specifics() {
722-
distro_codename_real=$(lsb_release --short --codename)
722+
distro_codename_real="$(lsb_release --short --codename)"
723723
distro_codename_common_use="${distro_codename_real}"
724724

725725
## TODO: How to handle the default value for use_deb822_sources? If we
@@ -1542,18 +1542,6 @@ Debugging information: needs-restarting reported that a reboot is required."
15421542
update_sources() {
15431543
local update_output update_cmd
15441544

1545-
log notice "Updating package list..."
1546-
1547-
## global console_write_command
1548-
if tty >/dev/null >&1 ; then
1549-
console_write_command=( 'tee' '/dev/tty' )
1550-
else
1551-
## github actions CI issue:
1552-
## tee: /dev/tty: No such device or address
1553-
## https://github.com/actions/runner/issues/241
1554-
console_write_command=( 'cat' )
1555-
fi
1556-
15571545
#root_cmd "${pkg_mngr_update[@]}" 2>&1 || true
15581546
#update_sources_error
15591547
## result: OK: command_without_extraneous_spaces="sudo -- apt-get update --yes --error-on=any"
@@ -1563,23 +1551,26 @@ update_sources() {
15631551
if [ "${noupdate}" = "1" ]; then
15641552
## Too slow to run over and over again during testing.
15651553
update_cmd=( 'true' "${pkg_mngr_update[@]}" )
1566-
log warn "Package List Update: Simulate only, via '--noupdate' option."
1554+
log warn "Package List Update: Simulate only, via '--noupdate' option..."
15671555
else
1556+
log notice "Package List Update: Updating package list..."
15681557
update_cmd=( "${pkg_mngr_update[@]}" )
15691558
fi
15701559

1560+
log info "update_cmd: '${update_cmd[*]}'"
1561+
15711562
if update_output=$(root_cmd_loglevel=notice root_cmd "${update_cmd[@]}" 2>&1 | "${console_write_command[@]}") ; then
1563+
log info "Package List Update: exit code '0' (OK)"
15721564
true "INFO: Exit code is zero but that does not guarantee in case of dnf that there is no error."
15731565
if printf '%s' "$update_output" | grep --ignore-case -- "Error:" >/dev/null ; then
1574-
log error "${underline}Package List Update:${nounderline} Exit code was 0 but 'Error:' found in output."
1566+
log error "${underline}Package List Update:${nounderline} Exit code was '0' but 'Error:' found in output."
15751567
if printf '%s' "$update_output" | grep --ignore-case -- "GPG signature verification error: Signing key not" >/dev/null; then
15761568
log warn "${underline}Package List Update:${nounderline} Signing key not found. Skipping due to 'rpm --import' failing to import keys, but '--assumeyes' being used will import keys."
15771569
return 0
15781570
fi
15791571
update_sources_error
15801572
else
1581-
true "INFO: No error found in update output, ok."
1582-
return 0
1573+
log info "Package List Update: Success."
15831574
fi
15841575
else
15851576
log error "${underline}Package List Update:${nounderline} Non-zero exit code. Stop."
@@ -5203,14 +5194,14 @@ parse_opt() {
52035194
if [ "${dev}" = "1" ]; then
52045195
if [ -z "${guest_version}" ]; then
52055196
log notice "Version Detection: Setting development testing empty software version via '--dev' option."
5206-
guest_version="17.0.3.4"
5197+
guest_version="18.0.9.5"
52075198
fi
52085199
fi
52095200
if [ "${dry_run}" = "1" ]; then
52105201
if [ -z "${guest_version}" ]; then
52115202
log notice "Simulation: commands will be printed but not executed via '--dry-run' option."
52125203
log notice "Version Detection: Using simulated software version via '--dry-run' option."
5213-
guest_version="17.0.3.4"
5204+
guest_version="18.0.9.5"
52145205
fi
52155206
fi
52165207
if [ "${allow_errors}" = "1" ]; then
@@ -5238,13 +5229,27 @@ parse_opt() {
52385229
## Bash supports process substitution and saving xtrace to a file, which is a
52395230
## simpler way to log to file and console.
52405231
log_term_and_file() {
5241-
local temp_folder xtrace_fifo
5232+
local temp_folder xtrace_fifo tty_output
5233+
5234+
tty_output=''
5235+
## global console_write_command
5236+
if tty_output="$(tty 2>&1)" ; then
5237+
console_write_command=( 'tee' '--' '/dev/tty' )
5238+
log info "Terminal: 'tty' connected: 'yes' (console_write_command: '${console_write_command[*]}')"
5239+
else
5240+
## github actions CI issue:
5241+
## tee: /dev/tty: No such device or address
5242+
## https://github.com/actions/runner/issues/241
5243+
console_write_command=( 'cat' '--' )
5244+
log info "Terminal: 'tty' connected: 'no' (tty_output: '${tty_output}' | console_write_command: '${console_write_command[*]}')"
5245+
fi
52425246

5243-
## Discover if terminal is attached to stdout
5247+
## Discover if terminal is attached to 'stdout'.
52445248
if [ ! -t 1 ]; then
5245-
log warn "Terminal: Output is not being sent to the terminal because terminal is not connected to stdout."
5249+
log info "Terminal: 'stdout' connected: 'no' - Output is not being sent to the terminal because terminal is not connected to 'stdout'."
52465250
return 0
52475251
fi
5252+
log info "Terminal: 'stdout' connected: 'yes'"
52485253

52495254
run_as_target_user touch -- "${log_file_user}"
52505255
run_as_target_user touch -- "${log_file_debug}"

0 commit comments

Comments
 (0)