Skip to content

Commit b8fec54

Browse files
committed
build
1 parent 9e47c24 commit b8fec54

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

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

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -554,15 +554,15 @@ get_installer_package_version() {
554554
return 0
555555
fi
556556
## Do not use commit-hash replace-me as search string to avoid replacement script replacing this.
557-
if ! printf '%s' "${version}" | grep --quiet --fixed-strings "replace-me" ; then
557+
if ! printf '%s' "${version}" | grep --quiet --fixed-strings -- "replace-me" ; then
558558
true "INFO: version variable does not match replace-me string."
559559
return 0
560560
fi
561-
if ! printf '%s' "${0}" | grep --quiet '^/usr/bin' ; then
561+
if ! printf '%s' "${0}" | grep --quiet -- '^/usr/bin' ; then
562562
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."
563563
return 0
564564
fi
565-
if ! printf '%s' "${me}" | grep --quiet --fixed-strings "installer-cli" ; then
565+
if ! printf '%s' "${me}" | grep --quiet --fixed-strings -- "installer-cli" ; then
566566
true "INFO: program name variable does not match installer-cli string."
567567
return 0
568568
fi
@@ -1104,7 +1104,7 @@ secure_boot_test() {
11041104
local mokutil_output_sb_state
11051105
secure_boot_dkms_key_enrolled=""
11061106
if mokutil_output_sb_state=$(root_cmd mokutil --sb-state 2>&1) ; then
1107-
if printf '%s' "$mokutil_output_sb_state" | grep --quiet --ignore-case --fixed-strings enabled ; then
1107+
if printf '%s' "$mokutil_output_sb_state" | grep --quiet --ignore-case --fixed-strings -- "enabled" ; then
11081108
secure_boot_status_pretty="'enabled' (mokutil_output_sb_state: '$mokutil_output_sb_state')"
11091109
secure_boot_status_short=true
11101110
## sudo mokutil --test-key /var/lib/dkms/mok.pub
@@ -1114,10 +1114,10 @@ secure_boot_test() {
11141114
## Redirection '2>&1' not necessary yet but that could be considered a minor bug in mokutil to write to stdout instead
11151115
## of writing to stderr.
11161116
secure_boot_mokutil_dkms_test_key="$(root_cmd mokutil --test-key "/var/lib/dkms/mok.pub" 2>&1)" || true
1117-
if printf '%s' "$secure_boot_mokutil_dkms_test_key" | grep --quiet --ignore-case --fixed-strings "already enrolled" ; then
1117+
if printf '%s' "$secure_boot_mokutil_dkms_test_key" | grep --quiet --ignore-case --fixed-strings -- "already enrolled" ; then
11181118
secure_boot_dkms_key_enrolled=true
11191119
fi
1120-
elif printf '%s' "$mokutil_output_sb_state" | grep --quiet --ignore-case --fixed-strings disabled ; then
1120+
elif printf '%s' "$mokutil_output_sb_state" | grep --quiet --ignore-case --fixed-strings -- "disabled" ; then
11211121
secure_boot_status_short=false
11221122
secure_boot_status_pretty="'disabled' (mokutil_output_sb_state: '$mokutil_output_sb_state')"
11231123
else
@@ -1296,10 +1296,10 @@ update_sources() {
12961296

12971297
if update_output=$(root_cmd_loglevel=notice root_cmd "${update_cmd[@]}" 2>&1 | "${console_write_command[@]}") ; then
12981298
true "INFO: Exit code is zero but that does not guarantee in case of dnf that there is no error."
1299-
if printf '%s' "$update_output" | grep --quiet --ignore-case "Error:" ; then
1299+
if printf '%s' "$update_output" | grep --quiet --ignore-case -- "Error:" ; then
13001300
log error "${underline}Package List Update:${nounderline} Exit code was 0 but 'Error:' found in output."
1301-
if printf '%s' "$update_output" | grep --quiet --ignore-case "GPG signature verification error: Signing key not"; then
1302-
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"
1301+
if printf '%s' "$update_output" | grep --quiet --ignore-case -- "GPG signature verification error: Signing key not"; then
1302+
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."
13031303
return 0
13041304
fi
13051305
update_sources_error
@@ -1343,7 +1343,7 @@ check_upgrades_simulation() {
13431343
&& upgrade_simulate_cmd+=( "${#install_pkg_fasttrack_extra_args_maybe[@]}" )
13441344
if upgrade_simulate_output=$(root_cmd_loglevel=notice root_cmd "${upgrade_simulate_cmd[@]}" 2>&1 | "${console_write_command[@]}") ; then
13451345
true "INFO: Exit code is zero but that does not guarantee in case of dnf that there is no error."
1346-
if printf '%s' "$upgrade_simulate_output" | grep --quiet --ignore-case "Error:" ; then
1346+
if printf '%s' "$upgrade_simulate_output" | grep --quiet --ignore-case -- "Error:" ; then
13471347
log error "${underline}Package Upgrade Simulation:${nounderline} Exit code was 0 but 'Error:' found in output."
13481348
upgrade_simulate_sources_error
13491349
fi
@@ -1440,7 +1440,7 @@ install_pkg() {
14401440
log info "special_args: '${special_args[*]}'"
14411441

14421442
if ! root_cmd "${pkg_mngr_install[@]}" "${special_args[@]}" "${pkg_not_installed[@]}"; then
1443-
if printf '%s' "${pkg_not_installed[*]}" | grep --quiet --ignore-case virtualbox ; then
1443+
if printf '%s' "${pkg_not_installed[*]}" | grep --quiet --ignore-case -- "virtualbox" ; then
14441444
virtualbox_installation_failure_debug
14451445
fi
14461446
die 1 "${underline}Package Installation:${nounderline} Failed to install package: '${pkg_not_installed[*]}'"
@@ -1500,9 +1500,9 @@ check_vm_running_virtualbox() {
15001500
vm="${1}"
15011501
## Paused state should be considered as running. Instead of grepping
15021502
## possible states, grep VM from list of running VMs.
1503-
# vboxmanage list runningvms | grep -q "^\"${vm}\" "
1503+
# vboxmanage list runningvms | grep -q -- "^\"${vm}\" "
15041504
if run_as_target_user "${vboxmanage_locale_english[@]}" showvminfo "${vm}" 2>&1 | \
1505-
grep -qE "^State:[[:space:]]+(running|paused)"
1505+
grep -qE -- "^State:[[:space:]]+(running|paused)"
15061506
then
15071507
log error "Cannot proceed. You have the following VM running: ${vm}"
15081508
die 1 "${underline}VM Running Check:${nounderline} Please turn it off before re-running this installer."
@@ -1866,9 +1866,9 @@ extract_vm_name_from_virtualbox_ova() {
18661866
local output="$1"
18671867
local system_number="$2"
18681868
local a b c d
1869-
a=$(printf '%s' "$output" | grep --max-count=1 --after-context=4 "Virtual system $system_number:")
1870-
b=$(printf '%s' "$a" | grep "Suggested VM name")
1871-
c=$(printf '%s' "$b" | grep -oP '"\K[^"]+')
1869+
a=$(printf '%s' "$output" | grep --max-count=1 --after-context=4 -- "Virtual system $system_number:")
1870+
b=$(printf '%s' "$a" | grep -- "Suggested VM name")
1871+
c=$(printf '%s' "$b" | grep -oP -- '"\K[^"]+')
18721872
## Take first word only because VirtualBox would suggest name "Whonix-Gateway-Xfce 1" in case,
18731873
## a VM "Whonix-Gateway-Xfce" is already registered in VirtualBox.
18741874
d=$(printf '%s' "$c" | awk '{print $1}')
@@ -2022,7 +2022,7 @@ start_virtualbox_vm() {
20222022

20232023

20242024
start_virtualbox_gui() {
2025-
if pgrep 'VirtualBox$' >/dev/null ; then
2025+
if pgrep -- 'VirtualBox$' >/dev/null ; then
20262026
log notice "VirtualBox Manager Startup Result: Not starting duplicate VirtualBox GUI because already running."
20272027
return 0
20282028
fi
@@ -2059,7 +2059,7 @@ get_pattern_sources_debian() {
20592059

20602060
file="${1}"
20612061
pattern="${2}"
2062-
grep -v "^\s*#" -- "${file}" | grep -q -E "${pattern}" || return 1
2062+
grep -v "^\s*#" -- "${file}" | grep -q -E -- "${pattern}" || return 1
20632063
}
20642064

20652065
write_sources_debian() {
@@ -2212,7 +2212,7 @@ add_user_to_vbox_group() {
22122212
local id_of_user
22132213

22142214
id_of_user="$(id --name --user)" || die 1 "${underline}Linux user ID check:${nounderline} Failed to run: 'id --name --user'"
2215-
if id -nG "${id_of_user}" | grep -qw "${virtualbox_linux_user_group}\$"; then
2215+
if id -nG "${id_of_user}" | grep -qw -- "${virtualbox_linux_user_group}\$"; then
22162216
log info "Linux Group Configuration: Account '${id_of_user}' is already a member of the Linux group 'vboxusers'."
22172217
return 0
22182218
fi
@@ -2315,7 +2315,7 @@ install_repositories_for_virtualbox_on_debian() {
23152315
distro_codename_real=$(lsb_release --short --codename)
23162316
distro_codename_common_use="${distro_codename_real}"
23172317
if [ "${ubuntu_derivative_detected}" = "1" ]; then
2318-
if grep -q "^UBUNTU_CODENAME=\S\+=" -- /etc/os-release; then
2318+
if grep -q -- "^UBUNTU_CODENAME=\S\+=" -- /etc/os-release; then
23192319
distro_codename_ubuntu="$(awk -F'=' '/^UBUNTU_CODENAME=/{print $2}' /etc/os-release)"
23202320
else
23212321
distro_codename_ubuntu="noble"
@@ -2512,7 +2512,7 @@ install_repositories_for_virtualbox_on_debian() {
25122512
else
25132513
kali_domain_debsource="${kali_clearnet}"
25142514
oracle_domain_debsource="${oracle_clearnet}"
2515-
log warn "Fallback Fasttrack repository to clearnet"
2515+
log warn "Fallback FastTrack repository to clearnet."
25162516
fasttrack_domain_debsource="${fasttrack_clearnet}"
25172517
fi
25182518
kicksecure_domain_debsource="${kicksecure_onion}"
@@ -2579,10 +2579,10 @@ install_repositories_for_virtualbox_on_debian() {
25792579

25802580
install_oracle_repository_fedora() {
25812581
oracle_found=""
2582-
if dnf repolist --all virtualbox | grep -q "."; then
2582+
if dnf repolist --all virtualbox | grep -q -- "."; then
25832583
oracle_found="1"
25842584
fi
2585-
if dnf repolist --disabled virtualbox | grep -q "."; then
2585+
if dnf repolist --disabled virtualbox | grep -q -- "."; then
25862586
dnf config-manager --set-enabled virtualbox
25872587
fi
25882588
if [ "${oracle_found}" = "1" ]; then
@@ -2802,7 +2802,7 @@ install_virtualbox_fedora() {
28022802
# ## --cacheonly does not work.
28032803
# ## Maybe dnf would need to be run with root_cmd.
28042804
# virtualbox_version=$(dnf search "VirtualBox-*")
2805-
# virtualbox_version=$(printf '%s' "$virtualbox_version" | grep "^VirtualBox-[[:digit:]]\{1,2\}\.[[:digit:]]\{1,2\}\.")
2805+
# virtualbox_version=$(printf '%s' "$virtualbox_version" | grep -- "^VirtualBox-[[:digit:]]\{1,2\}\.[[:digit:]]\{1,2\}\.")
28062806
# virtualbox_version=$(printf '%s' "$virtualbox_version" | tail -1)
28072807
# virtualbox_version=$(printf '%s' "$virtualbox_version" | cut -d " " -f1)
28082808
# virtualbox_version=$(printf '%s' "$virtualbox_version" | cut -d "-" -f2-)
@@ -2895,7 +2895,7 @@ install_virtualbox_debian_common_begin() {
28952895
done
28962896
fi
28972897
if has vboxmanage && ! dpkg --search "$(command -v vboxmanage)"; then
2898-
die 109 "Found Oracle VirtualBox installed from tarball/source, using a package manager can conflict with yourinstalled program. Uninstall VirtualBox first and then rerun this script. Use the option '--oracle-repo' if you want to keep close to upstream releases."
2898+
die 109 "Found Oracle VirtualBox installed from tarball/source. Using a package manager can conflict with your already manually installed VirtualBox. Uninstall VirtualBox first and then rerun this script. Use the option '--oracle-repo' if you want to install from the Oracle repository."
28992899
fi
29002900

29012901
install_repositories_for_virtualbox_on_debian
@@ -3571,7 +3571,7 @@ get_virtualization() {
35713571

35723572
## Check if virtualization is enabled.
35733573
## Check CPU flags for capability
3574-
virt_flag="$(root_cmd grep -m1 -w '^flags[[:blank:]]*:' /proc/cpuinfo | grep -wo -E '(vmx|svm)' || true)"
3574+
virt_flag="$(root_cmd grep -m1 -w -- '^flags[[:blank:]]*:' /proc/cpuinfo | grep -wo -E -- '(vmx|svm)' || true)"
35753575

35763576
case "${virt_flag:=none}" in
35773577
vmx) brand=intel;;
@@ -3673,8 +3673,8 @@ get_virtualization() {
36733673
}
36743674

36753675
## Check CPU flags for capability
3676-
virt=$(root_cmd grep -m1 -w '^flags[[:blank:]]*:' /proc/cpuinfo |
3677-
grep -wo -E '(vmx|svm)') || true
3676+
virt=$(root_cmd grep -m1 -w -- '^flags[[:blank:]]*:' /proc/cpuinfo |
3677+
grep -wo -E -- '(vmx|svm)') || true
36783678
if [ -z "${virt}" ]; then
36793679
log error "Your CPU does not support Virtualization."
36803680
verdict 1

0 commit comments

Comments
 (0)