From 97b6e243b89d01f4ad6e7368ca774cc9300a4cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 21 Jan 2021 19:50:24 +0100 Subject: [PATCH] debian/update-udev-triggers.sh: Use perl to replace file content envsubst is nice but may be not installed and can be confusing, so let's use perl (+ printenv) to replace our file content. --- debian/libfprint-2-2.postinst | 1 + debian/libfprint-2-2.postinst.in | 2 +- debian/update-udev-triggers.sh | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/libfprint-2-2.postinst b/debian/libfprint-2-2.postinst index e28cf04f..7ec3d5aa 100644 --- a/debian/libfprint-2-2.postinst +++ b/debian/libfprint-2-2.postinst @@ -209,6 +209,7 @@ if [ "$1" = "configure" -o "$1" = "upgrade" ] && command -V udevadm >/dev/null 2 udevadm trigger --action=add --attr-match=idVendor=2808 --attr-match=idProduct=9338 udevadm trigger --action=add --attr-match=idVendor=298d --attr-match=idProduct=2033 udevadm trigger --action=add --attr-match=idVendor=3538 --attr-match=idProduct=0930 + fi exit 0 diff --git a/debian/libfprint-2-2.postinst.in b/debian/libfprint-2-2.postinst.in index 480a21c0..83398aa8 100644 --- a/debian/libfprint-2-2.postinst.in +++ b/debian/libfprint-2-2.postinst.in @@ -11,7 +11,7 @@ if [ "$1" = "configure" -o "$1" = "upgrade" ] && command -V udevadm >/dev/null 2 # adds stuff there # The devices ID list is auto-generated using the gbp postimport hook # see debian/README.sources for more details. -${UDEVADM_TRIGGERS} +@UDEVADM_TRIGGERS@ fi exit 0 diff --git a/debian/update-udev-triggers.sh b/debian/update-udev-triggers.sh index f86f05ec..4ddb35dc 100755 --- a/debian/update-udev-triggers.sh +++ b/debian/update-udev-triggers.sh @@ -3,7 +3,7 @@ set -e srcdir="${GBP_SOURCES_DIR:-.}" debpath="$(dirname "$0")" -autosuspend_file="$srcdir/data/autosuspend.hwdb" +autosuspend_file="/tmp/autosuspend.hwdb" commands_lines=() while IFS= read -r line; do @@ -18,7 +18,7 @@ export UDEVADM_TRIGGERS=$( IFS=$'\n'; echo -e "${commands_lines[*]}" ) for i in $debpath/libfprint-*.post*.in; do out="${i%.in}" - envsubst < "$i" > "$out" + perl -pe 's/\@UDEVADM_TRIGGERS\@/`printenv UDEVADM_TRIGGERS`/e' "$i" > "$out" if [ -n "$GBP_BRANCH" ]; then if ! git diff-index --quiet HEAD -- "$out"; then