GNU bug report logs - #40039
'wrap-script' introduces spurious argument

Previous Next

Package: guix;

Reported by: Ludovic Courtès <ludovic.courtes <at> inria.fr>

Date: Thu, 12 Mar 2020 14:27:01 UTC

Severity: normal

Full log


Message #14 received at 40039 <at> debbugs.gnu.org (full text, mbox):

From: Brendan Tildesley <mail <at> brendan.scot>
To: 40039 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>
Cc: Ricardo Wurmus <rekado <at> elephly.net>
Subject: Re: bug#40039: 'wrap-script' introduces spurious argument
Date: Sun, 22 Mar 2020 22:42:29 +1100
[Message part 1 (text/plain, inline)]
I'm currently packaging libratbag which provides the cli interface 
ratbagctl. when launched without arguments, it normally the current devices

######################
## with wrap-program (correct):
b <at> ui ~/guix [env]$ ratbagctl
warbling-mara:       Logitech G102 Prodigy Gaming Mouse

b <at> ui ~/guix [env]$ head `which ratbagctl`
#!/gnu/store/29jhbbg1hf557x8j53f9sxd9imlmf02a-bash-minimal-5.0.7/bin/bash
export 
PYTHONPATH="/gnu/store/88v8lvs02sdqgzv7w96g19fvh8hffzzp-libratbag-0.13/lib/python3.7/site-packages/:/gnu/store/h4jkr0qg86zjn1kq6iq8v33pcadj9r13-python-evdev-1.3.0/lib/python3.7/site-packages/:/gnu/store/z5fdc5aa9hs4c3p79ajzgxhazv7702y8-python-pygobject-3.28.3/lib/python3.7/site-packages/"
exec -a "$0" 
"/gnu/store/88v8lvs02sdqgzv7w96g19fvh8hffzzp-libratbag-0.13/bin/.ratbagctl-real" 
"$@"


######################
## with wrap-script:
b <at> ui ~/guix [env]$ ratbagctl
usage: /gnu/store/754ylqjs68va7rswr3fscwa0kyazsbjq-profile/bin/ratbagctl 
<device>
       {info,name,profile,resolution,dpi,rate,button,led} ...
/gnu/store/754ylqjs68va7rswr3fscwa0kyazsbjq-profile/bin/ratbagctl 
<device>: error: invalid choice: 
'/gnu/store/754ylqjs68va7rswr3fscwa0kyazsbjq-profile/bin/ratbagctl' 
(choose from 'info', 'name', 'profile', 'resolution', 'dpi', 'rate', 
'button', 'led')

b <at> ui ~/guix [env]$ ratbagctl list
/gnu/store/754ylqjs68va7rswr3fscwa0kyazsbjq-profile/bin/ratbagctl 
<device>: error: invalid choice: 
'/gnu/store/754ylqjs68va7rswr3fscwa0kyazsbjq-profile/bin/ratbagctl' 
(choose from 'info', 'name', 'profile', 'resolution', 'dpi', 'rate', 
'button', 'led')
b <at> ui ~/guix [env]$ ratbagctl info rastkasnts atkatkaf ftbaontb 
aesbtabtowf ~5qawylftarsnvbawlpfyq
usage: /gnu/store/754ylqjs68va7rswr3fscwa0kyazsbjq-profile/bin/ratbagctl 
<device>
       {info,name,profile,resolution,dpi,rate,button,led} ...
/gnu/store/754ylqjs68va7rswr3fscwa0kyazsbjq-profile/bin/ratbagctl 
<device>: error: invalid choice: 
'/gnu/store/754ylqjs68va7rswr3fscwa0kyazsbjq-profile/bin/ratbagctl' 
(choose from 'info', 'name', 'profile', 'resolution', 'dpi', 'rate', 
'button', 'led')
b <at> ui ~/guix [env]$

b <at> ui ~/guix [env]$ head `which ratbagctl`
#!/gnu/store/0awhym5h0m890n0wq87y0dxznh14rk88-guile-next-3.0.1/bin/guile 
--no-auto-compile
#!#; Guix wrapper
#\-(begin (setenv "PYTHONPATH" 
"/gnu/store/1hcpppqc6268siki64vs1ygq1qsr8w35-libratbag-0.13/lib/python3.7/site-packages/:/gnu/store/h4jkr0qg86zjn1kq6iq8v33pcadj9r13-python-evdev-1.3.0/lib/python3.7/site-packages/:/gnu/store/z5fdc5aa9hs4c3p79ajzgxhazv7702y8-python-pygobject-3.28.3/lib/python3.7/site-packages/"))
#\-(let ((cl (command-line))) (apply execl 
"/gnu/store/608bvypsh90c58apvd2cgg3m9l2pwjqn-python-3.7.4/bin/python3" 
(car cl) (cons (car cl) (append (quote ("")) cl))))
#!/gnu/store/608bvypsh90c58apvd2cgg3m9l2pwjqn-python-3.7.4/bin/python3

####################

Here I make a copy of the guix build utils module and modify the 
wrap-script, removing #\space as suggested, so it defaults to 
char-set:graphic. This results in the above guile wrapper chaging to:

#\-(let ((cl (command-line))) (apply execl 
"/gnu/store/608bvypsh90c58apvd2cgg3m9l2pwjqn-python-3.7.4/bin/python3" 
(car cl) (cons (car cl) (append (quote ()) cl))))

The behaviour changes somewhat. Now running ratbagctl prints the 
commants list, which is what should happen when the wrong arguments are 
provided, e.g., `ratbagctl qwfqwfqf`


b <at> ui ~/guix [env]$ ratbagctl
usage: ratbagctl [OPTIONS] list
       ratbagctl [OPTIONS] <device> {COMMAND} ...


b <at> ui ~/guix [env]$ ratbagctl list
usage: /gnu/store/fgl1w0lh1pzqg8j4gi8j1yi29aa122ja-profile/bin/ratbagctl 
<device>
       {info,name,profile,resolution,dpi,rate,button,led} ...
/gnu/store/fgl1w0lh1pzqg8j4gi8j1yi29aa122ja-profile/bin/ratbagctl 
<device>: error: invalid choice: 'list' (choose from 'info', 'name', 
'profile', 'resolution', 'dpi', 'rate', 'button', 'led')

























[0001-WRAPSCRIPT.patch (text/x-patch, attachment)]

This bug report was last modified 3 years and 285 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.