Der Patch kann nicht angewendet werden

599
New Face

Ich habe den Quellcode von efivar-0.23.tar.gz entpackt und versucht, den folgenden Patch anzuwenden: http://patchwork.openembedded.org/patch/117073/, um ihn kompilieren zu können.

Ich habe das entpackte Verzeichnis eingegeben und den folgenden Befehl ausgegeben:, patch -Np1 ../efivar.patchaber es passiert nichts. Es wartet nur (als ob es etwas tut, aber es passiert nichts ).

Wie ist es möglich, diesen Patch anzuwenden? Ich habe verschiedene Artikel im Netz durchgesehen, aber das Ergebnis scheint das gleiche zu sein.

3

2 Antworten auf die Frage

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?