Skip to content

tools.patch cant create files #5320

Closed
@nolange

Description

@nolange

To help us debug your issue please explain:

  • I've read the CONTRIBUTING guide.
  • I've specified the Conan version, operating system version and any tool that can be relevant.
  • I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

Hello,

I am trying to apply some out-of-tree git patches, some of them create new files.
Some of them contain new files, and the tools.patch utility will then compail that absolute filepaths are not allowed (/dev/null).

Lacking this support, its cumbersome to add bugfixes and git commits in general.

Example patch (created with git format-patch):

From d0807313143bb35da65c2b858a2d9e17fd3fbf9e Mon Sep 17 00:00:00 2001
From: Norbert Lange <[email protected]>
Date: Fri, 7 Jun 2019 21:49:19 +0200
Subject: [PATCH] add and remove file

---
 newfile | 1 +
 oldfile | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
 create mode 100644 newfile
 delete mode 100644 oldfile

diff --git a/newfile b/newfile
new file mode 100644
index 0000000..fdedddf
--- /dev/null
+++ b/newfile
@@ -0,0 +1 @@
+Hello mean world
diff --git a/oldfile b/oldfile
deleted file mode 100644
index 32332e1..0000000
--- a/oldfile
+++ /dev/null
@@ -1 +0,0 @@
-Old litter
-- 
2.20.1

My environment is:

Debian Buster x64
Conan version 1.16.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions