bash-completion: various bash fixes

-d tests the folder which is existing but with .in file, so I prefered
the -f to test if the gst file was available which is not the case, so
it fallbacks on the pkg-config

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/766>
This commit is contained in:
Stéphane Cerveau 2021-02-26 10:47:38 +01:00
parent a4b5d8bb60
commit d093b2894b
3 changed files with 3 additions and 3 deletions

View file

@ -20,7 +20,7 @@
_GST_HELPERDIR="${BASH_SOURCE[0]%/*}/../helpers" _GST_HELPERDIR="${BASH_SOURCE[0]%/*}/../helpers"
if [[ ! -d "$_GST_HELPERDIR" ]]; then if [[ ! -f $_GST_HELPERDIR/gst ]]; then
_GST_HELPERDIR="$(pkg-config --variable=bashhelpersdir gstreamer-1.0)" _GST_HELPERDIR="$(pkg-config --variable=bashhelpersdir gstreamer-1.0)"
else else
_GST_HELPERDIR=`cd "$_GST_HELPERDIR"; pwd` _GST_HELPERDIR=`cd "$_GST_HELPERDIR"; pwd`

View file

@ -20,7 +20,7 @@
_GST_HELPERDIR="${BASH_SOURCE[0]%/*}/../helpers" _GST_HELPERDIR="${BASH_SOURCE[0]%/*}/../helpers"
if [[ ! -d "$_GST_HELPERDIR" ]]; then if [[ ! -f $_GST_HELPERDIR/gst ]]; then
_GST_HELPERDIR="$(pkg-config --variable=bashhelpersdir gstreamer-1.0)" _GST_HELPERDIR="$(pkg-config --variable=bashhelpersdir gstreamer-1.0)"
else else
_GST_HELPERDIR=`cd "$_GST_HELPERDIR"; pwd` _GST_HELPERDIR=`cd "$_GST_HELPERDIR"; pwd`

View file

@ -23,7 +23,7 @@ if [[ ! -x "$_GST_HELPER" ]]
then then
helper="$(pkg-config --variable=helpersdir gstreamer-@GST_API_VERSION@)/gst-completion-helper" helper="$(pkg-config --variable=helpersdir gstreamer-@GST_API_VERSION@)/gst-completion-helper"
if [ -x "$helper" ] if [ -x "$helper" ]
then then
_GST_HELPER=$helper _GST_HELPER=$helper
fi fi