conan-io / python-patch-ng

Library to parse and apply unified diffs
https://pypi.org/project/patch-ng
Other
19 stars 8 forks source link

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

Closed derived-coder closed 4 years ago

derived-coder commented 4 years ago

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.

memsharded commented 4 years ago

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.

derived-coder commented 4 years ago

uploaded patch, which was used

derived-coder commented 4 years ago

please close, I forgot to add the basepath to the yml file :cry: