Skip to content

Commit 8021e94

Browse files
committed
build
1 parent 6a5cad5 commit 8021e94

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -595,15 +595,15 @@ get_installer_package_version() {
595595
return 0
596596
fi
597597
## Do not use commit-hash replace-me as search string to avoid replacement script replacing this.
598-
if ! printf '%s' "${version}" | grep --quiet --fixed-strings -- "replace-me" ; then
598+
if ! printf '%s' "${version}" | grep --fixed-strings -- "replace-me" >/dev/null ; then
599599
true "INFO: version variable does not match replace-me string."
600600
return 0
601601
fi
602-
if ! printf '%s' "${0}" | grep --quiet -- '^/usr/bin' ; then
602+
if ! printf '%s' "${0}" | grep -- '^/usr/bin' >/dev/null ; then
603603
true "INFO: variable 0 does not match ^/usr/bin string. This means not for example /usr/bin/dist-installer-cli. So not packages dist-installer-cli version."
604604
return 0
605605
fi
606-
if ! printf '%s' "${me}" | grep --quiet --fixed-strings -- "installer-cli" ; then
606+
if ! printf '%s' "${me}" | grep --fixed-strings -- "installer-cli" >/dev/null ; then
607607
true "INFO: program name variable does not match installer-cli string."
608608
return 0
609609
fi
@@ -1164,7 +1164,7 @@ secure_boot_test() {
11641164
local mokutil_output_sb_state
11651165
secure_boot_dkms_key_enrolled=""
11661166
if mokutil_output_sb_state=$(root_cmd mokutil --sb-state 2>&1) ; then
1167-
if printf '%s' "$mokutil_output_sb_state" | grep --quiet --ignore-case --fixed-strings -- "enabled" ; then
1167+
if printf '%s' "$mokutil_output_sb_state" | grep --ignore-case --fixed-strings -- "enabled" >/dev/null; then
11681168
secure_boot_status_pretty="'enabled' (mokutil_output_sb_state: '$mokutil_output_sb_state')"
11691169
secure_boot_status_short=true
11701170
## sudo mokutil --test-key /var/lib/dkms/mok.pub
@@ -1174,10 +1174,10 @@ secure_boot_test() {
11741174
## Redirection '2>&1' not necessary yet but that could be considered a minor bug in mokutil to write to stdout instead
11751175
## of writing to stderr.
11761176
secure_boot_mokutil_dkms_test_key="$(root_cmd mokutil --test-key "/var/lib/dkms/mok.pub" 2>&1)" || true
1177-
if printf '%s' "$secure_boot_mokutil_dkms_test_key" | grep --quiet --ignore-case --fixed-strings -- "already enrolled" ; then
1177+
if printf '%s' "$secure_boot_mokutil_dkms_test_key" | grep --ignore-case --fixed-strings -- "already enrolled" >/dev/null ; then
11781178
secure_boot_dkms_key_enrolled=true
11791179
fi
1180-
elif printf '%s' "$mokutil_output_sb_state" | grep --quiet --ignore-case --fixed-strings -- "disabled" ; then
1180+
elif printf '%s' "$mokutil_output_sb_state" | grep --ignore-case --fixed-strings -- "disabled" >/dev/null ; then
11811181
secure_boot_status_short=false
11821182
secure_boot_status_pretty="'disabled' (mokutil_output_sb_state: '$mokutil_output_sb_state')"
11831183
else
@@ -1356,9 +1356,9 @@ update_sources() {
13561356

13571357
if update_output=$(root_cmd_loglevel=notice root_cmd "${update_cmd[@]}" 2>&1 | "${console_write_command[@]}") ; then
13581358
true "INFO: Exit code is zero but that does not guarantee in case of dnf that there is no error."
1359-
if printf '%s' "$update_output" | grep --quiet --ignore-case -- "Error:" ; then
1359+
if printf '%s' "$update_output" | grep --ignore-case -- "Error:" >/dev/null ; then
13601360
log error "${underline}Package List Update:${nounderline} Exit code was 0 but 'Error:' found in output."
1361-
if printf '%s' "$update_output" | grep --quiet --ignore-case -- "GPG signature verification error: Signing key not"; then
1361+
if printf '%s' "$update_output" | grep --ignore-case -- "GPG signature verification error: Signing key not" >/dev/null; then
13621362
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."
13631363
return 0
13641364
fi
@@ -1402,7 +1402,7 @@ check_upgrades_simulation() {
14021402
&& upgrade_simulate_cmd+=( "${install_pkg_fasttrack_extra_args_maybe[@]}" )
14031403
if upgrade_simulate_output=$(root_cmd_loglevel=notice root_cmd "${upgrade_simulate_cmd[@]}" 2>&1 | "${console_write_command[@]}") ; then
14041404
true "INFO: Exit code is zero but that does not guarantee in case of dnf that there is no error."
1405-
if printf '%s' "$upgrade_simulate_output" | grep --quiet --ignore-case -- "Error:" ; then
1405+
if printf '%s' "$upgrade_simulate_output" | grep --ignore-case -- "Error:" >/dev/null ; then
14061406
log error "${underline}Package Upgrade Simulation:${nounderline} Exit code was 0 but 'Error:' found in output."
14071407
upgrade_simulate_sources_error
14081408
fi
@@ -1502,7 +1502,7 @@ install_pkg() {
15021502
log info "special_args: '${special_args[*]}'"
15031503

15041504
if ! root_cmd "${pkg_mngr_install[@]}" "${special_args[@]}" "${pkg_not_installed[@]}"; then
1505-
if printf '%s' "${pkg_not_installed[*]}" | grep --quiet --ignore-case -- "virtualbox" ; then
1505+
if printf '%s' "${pkg_not_installed[*]}" | grep --ignore-case -- "virtualbox" >/dev/null; then
15061506
virtualbox_installation_failure_debug
15071507
fi
15081508
die 1 "${underline}Package Installation:${nounderline} Failed to install package: '${pkg_not_installed[*]}'"
@@ -1562,9 +1562,9 @@ check_vm_running_virtualbox() {
15621562
vm="${1}"
15631563
## Paused state should be considered as running. Instead of grepping
15641564
## possible states, grep VM from list of running VMs.
1565-
# vboxmanage list runningvms | grep -q -- "^\"${vm}\" "
1565+
# vboxmanage list runningvms | grep -- "^\"${vm}\" " >/dev/null
15661566
if run_as_target_user "${vboxmanage_locale_english[@]}" showvminfo "${vm}" 2>&1 | \
1567-
grep -qE -- "^State:[[:space:]]+(running|paused)"
1567+
grep -E -- "^State:[[:space:]]+(running|paused)" >/dev/null
15681568
then
15691569
log error "Cannot proceed. You have the following VM running: ${vm}"
15701570
die 1 "${underline}VM Running Check:${nounderline} Please turn it off before re-running this installer."
@@ -2126,7 +2126,7 @@ get_pattern_sources_debian() {
21262126

21272127
file="${1}"
21282128
pattern="${2}"
2129-
grep -v "^\s*#" -- "${file}" | grep -q -E -- "${pattern}" || return 1
2129+
grep -v "^\s*#" -- "${file}" | grep -E -- "${pattern}" >/dev/null || return 1
21302130
}
21312131

21322132
write_sources_debian() {
@@ -2296,7 +2296,7 @@ add_user_to_vbox_group() {
22962296
local id_of_user
22972297

22982298
id_of_user="$(id --name --user)" || die 1 "${underline}Linux user ID check:${nounderline} Failed to run: 'id --name --user'"
2299-
if id -nG "${id_of_user}" | grep -qw -- "${virtualbox_linux_user_group}\$"; then
2299+
if id -nG "${id_of_user}" | grep -w -- "${virtualbox_linux_user_group}\$" >/dev/null; then
23002300
log info "Linux Group Configuration: Account '${id_of_user}' is already a member of the Linux group 'vboxusers'."
23012301
return 0
23022302
fi
@@ -2399,7 +2399,7 @@ install_repositories_for_virtualbox_on_debian() {
23992399
distro_codename_real=$(lsb_release --short --codename)
24002400
distro_codename_common_use="${distro_codename_real}"
24012401
if [ "${ubuntu_derivative_detected}" = "1" ]; then
2402-
if grep -q -- "^UBUNTU_CODENAME=\S\+=" -- /etc/os-release; then
2402+
if grep --quiet -- "^UBUNTU_CODENAME=\S\+=" -- /etc/os-release; then
24032403
distro_codename_ubuntu="$(awk -F'=' '/^UBUNTU_CODENAME=/{print $2}' /etc/os-release)"
24042404
else
24052405
distro_codename_ubuntu="noble"
@@ -2663,10 +2663,10 @@ install_repositories_for_virtualbox_on_debian() {
26632663

26642664
install_oracle_repository_fedora() {
26652665
oracle_found=""
2666-
if dnf repolist --all virtualbox | grep -q -- "."; then
2666+
if dnf repolist --all virtualbox | grep -- "." >/dev/null; then
26672667
oracle_found="1"
26682668
fi
2669-
if dnf repolist --disabled virtualbox | grep -q -- "."; then
2669+
if dnf repolist --disabled virtualbox | grep -- "." >/dev/null; then
26702670
dnf config-manager --set-enabled virtualbox
26712671
fi
26722672
if [ "${oracle_found}" = "1" ]; then

0 commit comments

Comments
 (0)