all filenames must be quote, to handle filenames with spaces.
dispatch-conf is not written in bash
kyoto etc # touch "bob .conf" kyoto etc # touch "/etc/._cfg0000_bob .conf" kyoto etc # dispatch-conf diff: extra operand `/etc/._cfg0000_bob' diff: Try `diff --help' for more information. >> (1 of 1) -- /etc/bob .conf >> q quit, h help, n next, e edit-new, z zap-new, u use-new m merge, t toggle-merge, l look-merge: diff: extra operand `/etc/. _mrg0000_bob' diff: Try `diff --help' for more information. >> (1 of 1) -- /etc/bob .conf >> q quit, h help, n next, e edit-new, z zap-new, u use-new m merge, t toggle-merge, l look-merge: Language shouldn't matter, just file-name processing seems to be invalid when files have spaces.
In line 23 of /usr/bin/dispatch.conf, it should be: DIFF_CONTENTS = 'diff -Nu "%s" "%s"' And in line 22 of /usr/lib/portage/pym/dispatch_conf.py, it should be: DIFF3_MERGE = 'diff3 -mE "%s" "%s" "%s" >"%s"' Even better would be a filename wrapper function to replace %s, which encloses the filename in double quotes, and backlashes ("\") the following suspicious filename characters: \"`!?$
I think it is more appropriate to add the quotes to the relevant lines in dispatch-conf.conf (and not do auto-addition of quotes), because when one of the variables that uses '%s' is extremely complex, a double quote may not be appropriate. For example, in my MERGE variable, I have a statement that calls emacs and runs ediff. It needs double escaped quotes (\\"%s\\"), so I put these in the variable. It would be bad to prevent users from being able to do this.
Created attachment 131811 [details, diff] quote all file paths inside dispatch-conf shell commands (In reply to comment #4) > I think it is more appropriate to add the quotes to the relevant lines in > dispatch-conf.conf (and not do auto-addition of quotes) Yes, that's what this patch does (some of the relevant lines are hard coded rather than in the config file). This is in svn r7803.
This has been released in 2.1.3.10.