Skip to content

applyPatches don't use offsets #84

Closed
@piranna

Description

@piranna

(Related to #82)

While processing https://raw.githubusercontent.com/GregorR/musl-cross/master/patches/gcc-4.7.3-musl.diff with my pull-request I get some index that couldn't be applied, getting patched() callback content equals to false. After processing the same file with patch --verbose -Np1, it show that this entries are correctly applied but with an offset:

Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|# HG changeset patch
|# Parent f50bb54f331f73405131a30b4f353cfda1c70304
|Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one.
|
|diff -r f50bb54f331f libstdc++-v3/configure.host
|--- a/libstdc++-v3/configure.host  Fri Mar 29 16:38:52 2013 -0400
|+++ b/libstdc++-v3/configure.host  Fri Mar 29 16:41:10 2013 -0400
--------------------------
patching file libstdc++-v3/configure.host
Using Plan A...
Hunk #1 succeeded at 243 (offset -21 lines).
Hunk #2 succeeded at 258 (offset -21 lines).

Seems applyPatches() should try to find the place where the context fit and apply that offset to the patched content, isn't it?

P.D.: don't know if it's related, but at the end of processing the patch file, I get one call to loadFile() with undefined as index, but ignoring it don't make problems, so maybe it's an extra call that should not be there...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions