You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/games-util/joystick/files/joystick-1.4.8-udev.patch

53 lines
1.7 KiB

diff -ru linuxconsoletools-1.4.8.orig/utils/jscal-restore.in linuxconsoletools-1.4.8/utils/jscal-restore.in
--- linuxconsoletools-1.4.8.orig/utils/jscal-restore.in 2011-12-15 10:49:01.000000000 -0500
+++ linuxconsoletools-1.4.8/utils/jscal-restore.in 2015-05-16 01:54:00.799168225 -0400
@@ -6,8 +6,13 @@
exit 1
fi
-if [ ! -x /sbin/udevadm ]; then
- echo Restoring joystick configuration requires udev! >&2
+for f in /sbin/udevadm /bin/udevadm ;
+do
+ [ -x $f ] && UDEVADM=$f
+done
+
+if [ -z "$UDEVADM" ] ; then
+ echo Storing joystick configuration requires udev! >&2
exit 1
fi
@@ -30,7 +35,7 @@
# in the NAME value
IFS=$'\x0A'
-for ATTRIBUTE in $( /sbin/udevadm info -a -n $1 | @@PREFIX@@/share/joystick/ident ); do
+for ATTRIBUTE in $( ${UDEVADM} info -a -n $1 | @@PREFIX@@/share/joystick/ident ); do
ID=$( echo "$ATTRIBUTE" | cut -f 1 -d = )
VALUE=$( echo "$ATTRIBUTE" | cut -f 2 -d \" )
case $ID in
diff -ru linuxconsoletools-1.4.8.orig/utils/jscal-store.in linuxconsoletools-1.4.8/utils/jscal-store.in
--- linuxconsoletools-1.4.8.orig/utils/jscal-store.in 2011-12-15 10:49:01.000000000 -0500
+++ linuxconsoletools-1.4.8/utils/jscal-store.in 2015-05-16 01:53:18.725607838 -0400
@@ -11,14 +11,18 @@
echo "Stores the device's calibration for future use."
exit 1
fi
+for f in /sbin/udevadm /bin/udevadm ;
+do
+ [ -x $f ] && UDEVADM=$f
+done
-if [ ! -x /sbin/udevadm ]; then
+if [ -z "$UDEVADM" ] ; then
echo Storing joystick configuration requires udev! >&2
exit 1
fi
ident=$(mktemp)
-/sbin/udevadm info -a -n $1 | @@PREFIX@@/share/joystick/ident > $ident
+${UDEVADM} info -a -n $1 | @@PREFIX@@/share/joystick/ident > $ident
. $ident
rm $ident