diff --git a/contrib/ci/dependencies.xml b/contrib/ci/dependencies.xml
index a302261ef..83e18380e 100644
--- a/contrib/ci/dependencies.xml
+++ b/contrib/ci/dependencies.xml
@@ -609,6 +609,10 @@
+
+
+
+
diff --git a/contrib/debian/control.in b/contrib/debian/control.in
index 4c53208e4..9a0f3b1a5 100644
--- a/contrib/debian/control.in
+++ b/contrib/debian/control.in
@@ -54,7 +54,8 @@ Recommends: python3,
secureboot-db,
udisks2,
fwupd-unsigned,
- fwupd-signed
+ fwupd-signed,
+ jq
Suggests: gir1.2-fwupd-2.0
Provides: fwupdate
Conflicts: fwupdate-amd64-signed,
diff --git a/contrib/fwupd.spec.in b/contrib/fwupd.spec.in
index 24e755a38..b8ef3288a 100644
--- a/contrib/fwupd.spec.in
+++ b/contrib/fwupd.spec.in
@@ -137,6 +137,7 @@ Provides: fwupdate-efi
# optional, but a really good idea
Recommends: udisks2
Recommends: bluez
+Recommends: jq
%if 0%{?have_modem_manager}
Recommends: %{name}-plugin-modem-manager
diff --git a/data/bash-completion/fwupdmgr.in b/data/bash-completion/fwupdmgr
similarity index 90%
rename from data/bash-completion/fwupdmgr.in
rename to data/bash-completion/fwupdmgr
index fce126b39..94428cc10 100644
--- a/data/bash-completion/fwupdmgr.in
+++ b/data/bash-completion/fwupdmgr
@@ -65,7 +65,7 @@ _fwupdmgr_opts=(
_show_filters()
{
local flags
- flags="$(command @libexecdir@/fwupdtool get-device-flags 2>/dev/null)"
+ flags="$(command fwupdtool get-device-flags 2>/dev/null)"
COMPREPLY+=( $(compgen -W "${flags}" -- "$cur") )
}
@@ -76,12 +76,12 @@ _show_modifiers()
_show_device_ids()
{
+ if ! command -v jq &> /dev/null; then
+ return 0
+ fi
local description
- OLDIFS=$IFS
- IFS=$'\n'
- description="$(command fwupdagent get-devices 2>/dev/null | sed -e 's,"Name" :,,; s,",,g; s,\,,,g; s,[[:space:]]\+,,' | command awk '!/DeviceId/ { line = $0 }; /DeviceId/ { print $3 " { "line" }"}')"
+ description="$(command fwupdmgr get-devices --json 2>/dev/null | jq '.Devices | .[] | .DeviceId')"
COMPREPLY+=( $(compgen -W "${description}" -- "$cur") )
- IFS=$OLDIFS
}
_show_remotes()
@@ -107,7 +107,7 @@ _fwupdmgr()
esac
case $command in
- activate|clear-results|downgrade|get-releases|get-results|unlock|verify|verify-update|get-updates|switch-branch)
+ activate|clear-results|downgrade|get-releases|get-results|unlock|verify|verify-update|get-updates|switch-branch|update|upgrade)
if [[ "$prev" = "$command" ]]; then
_show_device_ids
else
diff --git a/data/bash-completion/fwupdtool.in b/data/bash-completion/fwupdtool
similarity index 91%
rename from data/bash-completion/fwupdtool.in
rename to data/bash-completion/fwupdtool
index b75177f8c..28597d210 100644
--- a/data/bash-completion/fwupdtool.in
+++ b/data/bash-completion/fwupdtool
@@ -64,22 +64,25 @@ _fwupdtool_opts=(
_show_filters()
{
local flags
- flags="$(command @libexecdir@/fwupdtool get-device-flags 2>/dev/null)"
+ flags="$(command fwupdtool get-device-flags 2>/dev/null)"
COMPREPLY+=( $(compgen -W "${flags}" -- "$cur") )
}
_show_firmware_types()
{
local firmware_types
- firmware_types="$(command @libexecdir@/fwupdtool get-firmware-types 2>/dev/null)"
+ firmware_types="$(command fwupdtool get-firmware-types 2>/dev/null)"
COMPREPLY+=( $(compgen -W "${firmware_types}" -- "$cur") )
}
_show_plugins()
{
+ if ! command -v jq &> /dev/null; then
+ return 0
+ fi
local plugins
- plugins="$(command @libexecdir@/fwupdtool get-plugins 2>/dev/null)"
+ plugins="$(command fwupdtool get-plugins --json 2>/dev/null | jq '.Plugins | .[] | .Name')"
COMPREPLY+=( $(compgen -W "${plugins}" -- "$cur") )
}
diff --git a/data/bash-completion/meson.build b/data/bash-completion/meson.build
index 3fab7d457..ae17f0e24 100644
--- a/data/bash-completion/meson.build
+++ b/data/bash-completion/meson.build
@@ -3,27 +3,14 @@ if bashcomp.found()
define_variable: bashcomp.version().version_compare('>= 2.10') ? ['datadir', datadir] : ['prefix', prefix],
)
-# replace @libexecdir@
-fwupdtool_path = join_paths(libexecdir, 'fwupd')
-con2 = configuration_data()
-con2.set('libexecdir', fwupdtool_path)
-configure_file(
- input : 'fwupdtool.in',
- output : 'fwupdtool',
- configuration : con2,
- install: true,
- install_dir: completions_dir)
+ install_data(['fwupdtool'],
+ install_dir : completions_dir,
+ )
-if build_daemon
-install_data(['fwupdagent'],
- install_dir : completions_dir,
-)
-configure_file(
- input : 'fwupdmgr.in',
- output : 'fwupdmgr',
- configuration : con2,
- install: true,
- install_dir: completions_dir)
-endif # build_daemon
+ if build_daemon
+ install_data(['fwupdagent', 'fwupdmgr'],
+ install_dir : completions_dir,
+ )
+ endif # build_daemon
endif # bashcomp.found()