FS#70268 - [joyutils] Wrong paths in jscal-{store,restore}

Attached to Project: Community Packages
Opened by Krzysztof Nazarewski (nazarewk) - Friday, 02 April 2021, 18:19 GMT
Last edited by Alexander F. Rødseth (xyproto) - Friday, 09 April 2021, 10:50 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Alexander F. Rødseth (xyproto)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The package stores files in /usr/share/joystick, but jscal-{store,restore} expect them to be in /usr/local/share/joystick.
Works just fine after i linked /usr/share/joystick to /usr/local/share/joystick:

e-kfni@nazarewk-portable ~ % ls -la /usr/local/share/joystick
lrwxrwxrwx 1 root root 19 Apr 2 20:05 /usr/local/share/joystick -> /usr/share/joystick
e-kfni@nazarewk-portable ~ % ls -la /usr/share/joystick
total 28
drwxr-xr-x 2 root root 4096 Apr 2 20:03 .
drwxr-xr-x 327 root root 12288 Mar 27 10:35 ..
-rwxr-xr-x 1 root root 1215 Mar 15 11:44 extract
-rwxr-xr-x 1 root root 1649 Mar 15 11:44 filter
-rwxr-xr-x 1 root root 1342 Mar 15 11:44 ident


Additional info:
* package version(s)
* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:

1. Install joyutils
2. Connect joystick
2. run sudo jscal-store /dev/input/js0

e-kfni@nazarewk-portable ~ % grep /joystick/ /usr/bin/jscal-*
/usr/bin/jscal-restore:STORE=/var/lib/joystick/joystick.state
/usr/bin/jscal-restore:# Set $IFS to newline only as output from /usr/local/share/joystick/ident might contain spaces
/usr/bin/jscal-restore:for ATTRIBUTE in $( udevadm info -a -n $1 | /usr/local/share/joystick/ident ); do
/usr/bin/jscal-restore: cat $STORE | /usr/local/share/joystick/extract kernel="$DEVICE" | while read COMMAND; do
/usr/bin/jscal-restore: cat $STORE | /usr/local/share/joystick/extract name="$NAME" serial="$SERIAL" vendor="$VENDOR" product="$PRODUCT" | while read COMMAND; do
/usr/bin/jscal-store:udevadm info -a -n $1 | /usr/local/share/joystick/ident > $ident
/usr/bin/jscal-store:STORE=/var/lib/joystick/joystick.state
/usr/bin/jscal-store: /usr/local/share/joystick/filter kernel="$DEVICE" < $STORE > $STORE.new
/usr/bin/jscal-store: /usr/local/share/joystick/filter name="$NAME" serial="$SERIAL" vendor="$VENDOR" product="$PRODUCT" < $STORE > $STORE.new

This task depends upon

Closed by  Alexander F. Rødseth (xyproto)
Friday, 09 April 2021, 10:50 GMT
Reason for closing:  Fixed
Comment by loqs (loqs) - Friday, 02 April 2021, 18:44 GMT
Please try rebuilding the package with the attached diff applied.
jscal-restore and jscal-store have the prefix set during build() so set PREFIX there as well as in package().
Comment by Krzysztof Nazarewski (nazarewk) - Friday, 02 April 2021, 20:04 GMT
The patch above fixes the issue. Since i didn't package much yet, i'm posting the steps taken to test the patch:

$ mkdir -p /tmp/joyutils-test
$ curl 'https://bugs.archlinux.org/task/70268?getfile=19969' -o PKGBUILD.diff
$ curl https://raw.githubusercontent.com/archlinux/svntogit-community/packages/joyutils/trunk/PKGBUILD
$ patch < PKGBUILD.diff
$ makepkg
$ sudo rm /usr/local/share/joystick
$ sudo pacman -U joyutils-1.7.1-1-x86_64.pkg.tar
$ sudo jscal-restore /dev/input/js0
Comment by Krzysztof Nazarewski (nazarewk) - Saturday, 03 April 2021, 18:33 GMT
The patch above fixes the issue. Since i didn't package much yet, i'm posting the steps taken to test the patch:

$ mkdir -p /tmp/joyutils-test
$ curl 'https://bugs.archlinux.org/task/70268?getfile=19969' -o PKGBUILD.diff
$ curl https://raw.githubusercontent.com/archlinux/svntogit-community/packages/joyutils/trunk/PKGBUILD
$ patch < PKGBUILD.diff
$ makepkg
$ sudo rm /usr/local/share/joystick
$ sudo pacman -U joyutils-1.7.1-1-x86_64.pkg.tar
$ sudo jscal-restore /dev/input/js0
Comment by Alexander F. Rødseth (xyproto) - Thursday, 08 April 2021, 18:02 GMT
Thanks for reporting, I'll look into this.
Comment by Alexander F. Rødseth (xyproto) - Friday, 09 April 2021, 10:50 GMT
Added PREFIX=/usr. The updated package will appear in [community] shortly. Thanks for the patch and the testing.

Loading...