Description of Problem: while trying to compare the package set between the re0417.1 tree and the 7.2 distro, I received some unexpected diff results. Occasionally, diff fails to properly handle the case where file A contains lines that are absent from file B (and vice versa). Version-Release number of selected component (if applicable): diffutils-2.7.2-5 tree: re0417.1 How Reproducible: 100% -- see below (Additional Information) Steps to Reproduce: 1. diff new.txt 7.2-rhnlist.txt --side-by-side Actual Results: <snip> FreeWnn-libs-1.11-20 | FreeWnn-libs-1.11-19 GConf-1.0.9-4 | GConf-1.0.4-3 GConf-devel-1.0.9-4 | GConf-devel-1.0.4-3 Glide3-20010520-13 | Gtk-Perl-0.7008-3 Glide3-devel-20010520-13 | Guppi-0.35.5-7 Gtk-Perl-0.7008-13 | Guppi-devel-0.35.5-7 Guppi-0.40.3-5 | ImageMagick-5.3.8-3 Guppi-devel-0.40.3-5 | ImageMagick-c++-5.3.8-3 <snip> Expected Results: <snip> FreeWnn-libs-1.11-20 | FreeWnn-libs-1.11-19 GConf-1.0.9-4 | GConf-1.0.4-3 GConf-devel-1.0.9-4 | GConf-devel-1.0.4-3 Glide3-20010520-13 < Glide3-devel-20010520-13 < Gtk-Perl-0.7008-13 | Gtk-Perl-0.7008-3 Guppi-0.40.3-5 | Guppi-0.35.5-7 Guppi-devel-0.40.3-5 | Guppi-devel-0.35.5-7 <snip> Additional Information: This failure @ the Glide3 difference generates a huge diff stanza. This is 100% reproducible with the 2 text files I'm diff'ing, but it does behave as expected at other difference points: <snip> anaconda-7.3-5 | anaconda-7.2-7 anaconda-help-7.3-1 | anaconda-runtime-7.2-7 anaconda-images-7.3-5 < anaconda-runtime-7.3-5 < anacron-2.3-17 anacron-2.3-17 <snip> Full diff output to follow.
Created attachment 54424 [details] diff output
Please attach the diff inputs. (If you can find minimal inputs that trigger this, even better.) Thanks.
Created attachment 54464 [details] short file A
Created attachment 54465 [details] short file B
Since all the lines here are different, the output is correct: FreeWnn-libs-1.11-20 | FreeWnn-libs-1.11-19 GConf-1.0.9-4 | GConf-1.0.4-3 GConf-devel-1.0.9-4 | GConf-devel-1.0.4-3 Glide3-20010520-13 | Gtk-Perl-0.7008-3 Glide3-devel-20010520-13 | Guppi-0.35.5-7 Gtk-Perl-0.7008-13 | Guppi-devel-0.35.5-7 Guppi-0.40.3-5 | ImageMagick-5.3.8-3 Guppi-devel-0.40.3-5 | ImageMagick-c++-5.3.8-3 The reason other sections of the output match your expectations is the presence of identical lines in the input.
What you might want to try instead is this kind of thing: #!/bin/bash A=$1 B=$2 rm -rf .A mkdir .A while read line; do echo ${line#${line%-*-*}-} > .A/${line%-*-*}; done < $A rm -rf .B mkdir .B while read line; do echo ${line#${line%-*-*}-} > .B/${line%-*-*}; done < $B diff -du .A .B rm -rf .A .B