diff --git a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh index 15a6aae305..b92b36e37e 100644 --- a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh +++ b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh @@ -143,6 +143,12 @@ _EOF echo "export info_files=\"${info_files}\"" >> $tmpf fi fi + # + # Handle files in hwdb directory + # + if [ -d "${PKGDESTDIR}/usr/lib/udev/hwdb.d" ]; then + _add_trigger hwdb.d-dir + fi # # (Un)Register a shell in /etc/shells. # diff --git a/srcpkgs/xbps-triggers/files/hwdb.d-dir b/srcpkgs/xbps-triggers/files/hwdb.d-dir new file mode 100755 index 0000000000..aa25a31061 --- /dev/null +++ b/srcpkgs/xbps-triggers/files/hwdb.d-dir @@ -0,0 +1,29 @@ +#!/bin/sh +# +# Updates hardware database +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +case "$ACTION" in +targets) + echo "post-install pre-remove" + ;; +run) + usr/bin/udevadm hwdb --root=. --update + ;; +*) + exit 1 + ;; +esac + +exit 0