[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New method for Packages/Sources file updates

Goswin von Brederlow wrote:
Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:
Goswin von Brederlow wrote:
very hard (figure out how to make a minimal diff
from the daylies) or you need every days Packages file (apt-dupdate
does that).
Is there any program in Debian to do this for ed script style diffs?
patch -e
That tells patch that the input is an ed script patch file and needs
to be piped to ed. This does not create a cummulative diff from two ed
script patches unless I'm very mistaken.

I was thinking the same, but actually, he might be right. The following should work for --ed style diffs, though it wouldn't for normal diffs:

  yes $(date | md5sum) | head -n $MAXLINES | grep -n ^ > file
  cp file file.new
  cat patch.1 | patch -e file.new
  cat patch.2 | patch -e file.new
  diff --ed file file.new > patch.cumulative

The first command needs to produce a file with each line being different, and no line being the same as any line in the original files, and having at least as many lines as the original file.

Weirdly, for the quick test I did (i386/main Packages files for woody, sarge and sid), the resulting patch isn't just smaller than the combined woody->sarge, sarge->sid patches, but also smaller than the woody->sid patch.

There may be other caveats. I don't see why the resulting patches would be different -- it's presumably something to do with the fact that Packages files have lots of repeated lines, but I don't see how.


Reply to: