[Bug 735675] Re: bzdiff does not pass -I option to diff
Ben Hutchings
ben at decadent.org.uk
Sun Jan 29 18:29:57 UTC 2017
This patch is broken:
1. $OPTIONS is used (unquoted) in 4 different places but this patch only updates one of them
2. Quoting $OPTIONS prevents use of multiple options
Unfortunately I don't see a reasonable way to fix this while using only
POSIX shell features.
- If bzdiff is changed to use bash then the options can be accumulated into an array variable. This would be fine in Debian and Ubuntu, but not upstream.
- POSIX allows positional arguments to be used in an array-like way, but we already use them for the filenames.
- This could be done by escaping, quoting and concatenating the options and then using eval to expand to multiple arguments. But this is not what I would consider reasonable!
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bzip2 in Ubuntu.
https://bugs.launchpad.net/bugs/735675
Title:
bzdiff does not pass -I option to diff
Status in bzip2 package in Ubuntu:
New
Bug description:
Binary package hint: bzip2
When trying to use bzdiff with the -I option (ignore regex), the
options are not properly passed to diff. I have 2 files (MySQL dumps)
that differ in only one line:
$ bzdiff tmp1.bz2 tmp2.bz2
9c9
< -- Dump completed on 2011-03-11 1:06:50
---
> -- Dump completed on 2011-03-11 0:40:11
However, when trying to avoid that line from matching a problem
arises:
$ ./bzdiff_orig -I'Dump completed' tmp1.bz2 tmp2.bz2
diff: extra operand `/tmp/bzdiff.JnwGRlHnMM'
diff: Try `diff --help' for more information.
After some attempts at quoting and unquoting, I solved the problem by
modifying the bzdiff shell script at /bin/bzdiff.
The issues were 2: i) the options were not correctly parsed, a space
was added before the first option, and ii) the options were not passed
quoted to diff, therefore they were incorrectly interpreted as a file
and not an option. Will include a patch.
Version info:
$ lsb_release -rd
Description: Ubuntu 10.10
$ apt-cache policy bzip2
bzip2:
Installed: 1.0.5-4ubuntu1
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bzip2/+bug/735675/+subscriptions
More information about the foundations-bugs
mailing list