mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-03-13 08:56:29 -04:00
update pkg_installed function
This commit is contained in:
parent
ac1493fcfc
commit
041caf286b
8
debian/security-misc.config
vendored
8
debian/security-misc.config
vendored
@ -33,13 +33,13 @@ pkg_installed() {
|
||||
package_name="$1"
|
||||
## Cannot use '&>' because it is a bashism.
|
||||
dpkg_query_output="$(dpkg-query --show --showformat='${Status}' "$package_name" 2>/dev/null)" || true
|
||||
## dpkg_query_output Exampels:
|
||||
## dpkg_query_output Examples:
|
||||
## install ok half-configured
|
||||
## install ok installed
|
||||
|
||||
requested_action=$(echo "$dpkg_query_output" | awk '{print $1}')
|
||||
status=$(echo "$dpkg_query_output" | awk '{print $2}')
|
||||
error_state=$(echo "$dpkg_query_output" | awk '{print $3}')
|
||||
requested_action=$(printf '%s' "$dpkg_query_output" | awk '{print $1}')
|
||||
status=$(printf '%s' "$dpkg_query_output" | awk '{print $2}')
|
||||
error_state=$(printf '%s' "$dpkg_query_output" | awk '{print $3}')
|
||||
|
||||
if [ "$requested_action" = 'install' ]; then
|
||||
true "$0: INFO: $package_name is installed, ok."
|
||||
|
Loading…
x
Reference in New Issue
Block a user