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

Re: New method for Packages/Sources file updates

Eduard, I put you in the TO because this should improve your
apt-dupdate nightly runs:

Anthony Towns <aj@azure.humbug.org.au> writes:

> 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

Intresting idea, should work well.

> 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.

Maybe because your lines are shorter than the average line in the real
Packages file the diff works with a greater (more lines) search window
and creates a more optimal patch?

> Cheers,
> aj


Reply to: