conan-io / python-patch-ng

Library to parse and apply unified diffs

Home Page:https://pypi.org/project/patch-ng

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

failed to apply patch 'source/target file does not exist'

derived-coder opened this issue · comments

conan version: 1.21.1
OS: Linux Ubuntu 18.04

download the tar archive from: https://github.com/GENIVI/capicxx-core-runtime/releases/tag/3.1.12.6
Apply following patch: 0001-cmake-Modernize-exported-CMake-config-files.zip

I get following message:

patches/0001-cmake-Modernize-exported-CMake-config-files.patch: premature end of source file b'CMakeLists.txt' at hunk 1
patches/0001-cmake-Modernize-exported-CMake-config-files.patch: source file is different - b'CMakeLists.txt'
patches/0001-cmake-Modernize-exported-CMake-config-files.patch: source/target file does not exist:
  --- b'cmake/CommonAPIConfig.cmake.in'
  +++ b'cmake/CommonAPIConfig.cmake.in'

patch should be applied without any error, the PR can be merged without any problem.

commented

It worked fine here.

I downloaded the repo. Checkout tag 3.1.12.6.
Then run python patch_ng.py 10.patch with the downloaded file.

It patched successfully the code.

Worked also downloading the zip file and uncompressing.

uploaded patch, which was used

please close, I forgot to add the basepath to the yml file 😢