Не могу применить патч

500
New Face

Я распаковал исходный код efivar-0.23.tar.gz и пытаюсь применить следующий патч: http://patchwork.openembedded.org/patch/117073/, чтобы иметь возможность его скомпилировать.

Я вошел в распакованный каталог и выдал следующую команду:, patch -Np1 ../efivar.patchно ничего не происходит. Он просто ждет ( как будто он что-то делает, но ничего не происходит ).

Как можно применить этот патч? Я просматривал различные статьи в сети, но результат, кажется, тот же самый ..

3

2 ответа на вопрос

6
x539

The patch command expects the Patch at stdin. So either pipe the patch into the command:

patch -Np1 < ../efivar.patch 

or specify the input file with the -i argument.

patch -Np1 -i ../efivar.patch 

As you can see, the first diff is from file a/meta-oe/recipes-extended/efivar/efivar/0001-efivar-fix-for-cross-compile.patch. Let's assume the actual relativ-file path is efivar/0001-efivar-fix-for-cross-compile.patch from your current working directory. Then you have to tell patch to ignore the first 4 directory levels, so it can find the files to patch. You do this by saying p4 instead of p1.

0
Steven Penny

Alternatively, since the patch in question was created with Git, you could use Git to apply it:

curl patchwork.openembedded.org/patch/117073/mbox/ | git am 

Or:

curl patchwork.openembedded.org/patch/117073/raw/ | git apply 

How do patches work in Git?

Похожие вопросы