I am trying to manually apply some patches, and wonder if I am interpreting the last few lines correctly. Here they are:
patching file frameworks/opt/telephony/tests/telephonytests/src/com/android/internal /telephony/gsm/UsimDataDownloadCommands.java
Hunk #1 succeeded at 651 with fuzz 2 (offset 21 lines).
can't find file to patch at input line 404
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/packages/apps/Phone/src/com/android/phone/PhoneInterfaceManager.java b/packages/apps/Phone/src/com/android/phone/PhoneInterfaceMan
ager.java
|index 6600ae5..2ae6739 100644
|--- a/packages/apps/Phone/src/com/android/phone/PhoneInterfaceManager.java
|+++ b/packages/apps/Phone/src/com/android/phone/PhoneInterfaceManager.java
--------------------------
File to patch: smartcard-api.patch
was UsimDataDownloadCommands.java file patched ok? Fuzz means, the patch utility found the match for target string, but it was at a different line. Right?
What about PhoneInterfaceManager.java file? I do have this file in my directory. But I am not sure what to do with it as there is not associated reject file for me to use? What is the reference to line 404? Is that the line number in my patch?
Thanks
Related
I'm trying to build a image for IMX8MP SolidRun board (Hummingboard Mate board) but I'm going crazy with this. I'm using this git page:
https://github.com/SolidRun/meta-solidrun-arm-imx8
With this repo:
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-hardknott -m imx-5.10.72-2.2.0.xml
But I have tried with this repo too:
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-hardknott -m imx-5.10.72-2.2.2.xml
These are the errors I get with different configurations:
FIRST ONE:
ERROR: tinycompress-1.1.6-r0 do_fetch: Fetcher failure for URL:
'git://git.alsa-project.org/tinycompress.git;protocol=git;branch=master'.
Unable to fetch URL from any source. ERROR: Logfile of failure stored
in:
/home/holoh/yocto/build-xwayland-imx8mpsolidrun/tmp/work/cortexa53-crypto-poky-linux/tinycompress/1.1.6-r0/temp/log.do_fetch.21811
ERROR: Task
(/home/holoh/yocto/sources/meta-imx/meta-sdk/recipes-multimedia/tinycompress/tinycompress_1.1.6.bb:do_fetch)
failed with exit code '1'
CHANGING URL configuration on yocto/sources/meta-imx/meta-sdk/recipes-multimedia/tinycompress/tinycompress_1.1.6.bb because firewall could be acting.( to https://github.com/alsa-project/tinycompress.git adding protocol=https), the error I have received is this:
ERROR: tinycompress-1.1.6-r0 do_fetch: Fetcher failure for URL:
'https://github.com/alsa-project/tinycompress.git;protocol=https;branch=master'.
Missing SRC_URI checksum ERROR: Logfile of failure stored in:
/home/holoh/yocto/build-xwayland-imx8mpsolidrun/tmp/work/cortexa53-crypto-poky-linux/tinycompress/1.1.6-r0/temp/log.do_fetch.10927
ERROR: Task
(/home/holoh/yocto/sources/meta-imx/meta-sdk/recipes-multimedia/tinycompress/tinycompress_1.1.6.bb:do_fetch)
failed with exit code '1'
I add checksum line as I can read here (Turn off Source Checksum Check Yocto). Two solutions tried, same result:
ERROR: tinycompress-1.1.6-r0 do_patch: Command Error: 'quilt --quiltrc
/home/holoh/yocto/build-xwayland-imx8mpsolidrun/tmp/work/cortexa53-crypto-poky-linux/tinycompress/1.1.6-r0/recipe-sysroot-native/etc/quiltrc
push' exited with 0 Output: stdout: Applying patch
0001-tinycompress-Add-id3-decoding.patch patching file
include/tinycompress/id3_tag_decode.h can't find file to patch at
input line 224 Perhaps you used the wrong -p or --strip option? The
text leading up to this was:
-------------------------- |diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am |index 1b996d4..e813689 100644 |---
a/src/utils/Makefile.am |+++ b/src/utils/Makefile.am
-------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 236 Perhaps you
used the wrong -p or --strip option? The text leading up to this was:
-------------------------- |diff --git a/src/utils/cplay.c b/src/utils/cplay.c |index 87863a3..2a52b52 100644 |---
a/src/utils/cplay.c |+++ b/src/utils/cplay.c
-------------------------- No file to patch. Skipping patch. 3 out of 3 hunks ignored patching file src/utils/id3_tag_decode.c Patch
0001-tinycompress-Add-id3-decoding.patch does not apply (enforce with
-f)
stderr: ERROR: Logfile of failure stored in:
/home/holoh/yocto/build-xwayland-imx8mpsolidrun/tmp/work/cortexa53-crypto-poky-linux/tinycompress/1.1.6-r0/temp/log.do_patch.22146
ERROR: Task
(/home/holoh/yocto/sources/meta-imx/meta-sdk/recipes-multimedia/tinycompress/tinycompress_1.1.6.bb:do_patch)
failed with exit code '1'
What is going on here? I don't understand why It doesn't work, I'm following only the steps and this sh*t is impossible.
You have a proxy i guess. Try to disable it.
I tested it works fine.
I have download two PRODSECBUG-2233 patch for different Magento version from magento official site.
1) Magento 2.3.0 (PRODSECBUG-2233-2.3.x-2019-07-26-08-35-12.patch)
2) Magento 2.2.3 (PRODSECBUG-2233-2.2.x-2019-07-26-08-35-48.patch)
I have installed PRODSECBUG-2233 patch in Magento 2.3.0 version successfully using below command.
patch -p1 < PRODSECBUG-2233-2.3.x-2019-07-26-08-35-12.patch
But when i have try to use same command in Magento 2.2.3, it's not working and show me FAILED in terminal. Please check below.
patch -p1 < PRODSECBUG-2233-2.2.x-2019-07-26-08-35-48.patch
...
....
File to patch: vendor/magento/module-sales/Helper/Admin.php
patching file vendor/magento/module-sales/Helper/Admin.php
Hunk #1 FAILED at 6 (different line endings).
Hunk #2 FAILED at 31 (different line endings).
Hunk #3 FAILED at 149 (different line endings).
Hunk #4 FAILED at 186 (different line endings).
4 out of 4 hunks FAILED -- saving rejects to file vendor/magento/module-sales/Helper/Admin.php.rej
How can i solve this ? Is this problem in magento .patch file ?
Please help me.
Thanks
I'm working in a project that uses buildroot-2012.11 to generate a Linux image for an embedded system.
I need to configure openocd for a JTAG debugger that uses an FTDI chip (FT2232D).
I realized that this buildroot version integrate openocd-0.5.0 and the latest openocd release is 0.9.0. I'm interested in updating to this version since I want to use ftdi interface driver instead of ft2232 (deprecated).
I tried to accomplish that by modifying /package/openocd/openocd.mk on the lines:
OPENOCD_VERSION:=0.9.0
OPENOCD_CONF_OPT += --enable-ftdi
The new openocd files where downloaded successfully but when it tries to install it and apply openocd-0001-fix-cross-compilation-host-libsub-was-used-before.patch I got:
Applying openocd-0001-fix-cross-compilation-host-libsub-was-used-before.patch using patch:
can't find file to patch at input line 17
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 3728c4af7f6303ccedab56ec220797f8f290580e Mon Sep 17 00:00:00 2001
|From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj#jcrosoft.com>
|Date: Wed, 10 Aug 2011 00:17:29 +0800
|Subject: [PATCH] fix cross compilation: host libsub was used before
|
|tested in buildroot
|
|Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj#jcrosoft.com>
|---
| configure.in | 7 +++++--
| 1 files changed, 5 insertions(+), 2 deletions(-)
|
|diff --git a/configure.in b/configure.in
|index dfa1e8f..cfe2218 100644
|--- a/configure.in
|+++ b/configure.in
--------------------------
File to patch: configure.in
configure.in: No such file or directory
If I skipped the patch the building process stop and I'm not able to generate the images.
I've doing some research on the internet and I couldn't find how to do this correctly.
Maybe one obvious solution could be updating the buildroot version but since there is a lot of other people development with the current version I'm not in a position of taking that decision right now.
I'll do appreciate any help.
Upgrade your Buildroot release. 2015.08 already has OpenOCD 0.8.0 and it should be trivial to update to 0.9.0. Plus you will benefit from the numerous improvements and updates that have been made between 2012.11 and 2015.08.
I have some text files where I need to add 1 character to the beginning of every line of the file.
In windows, I found that a quick way to do this was by installing Cygwin and using the following command, which prepends the letter N to every line of the file:
$ sed 's/^/N/' inputFile.txt > outputFile.txt
What I found strange, was that after I added a new character to the front of each line, the file size was almost completely unchanged. I tested this further, to see if I could recreate the problem with the following steps:
Created a text file called "Test.txt", which had 10,000 lines with the word "TEST" on each line.
Created a text file called "TestWithNPrefix.txt" which had 10,000 lines with the word "NTEST" on each line.
Executed the following command to create another file which had 10,000 lines of "NTEST"
$ sed 's/^/N/' Test.txt > "SEDTest.txt"
Results
"Test" and "SEDTest" were almost the exact same size, while "TestWithNPrefix" was 10KB larger.
Test = 59,998 Bytes; SEDTest = 59,999 Bytes; TestWithNPrefix = 69,998 Bytes
When I ran the "fc" command in Command Prompt, it returned that there were no differences between "SEDTest" and "TestWithNPrefix". "FC" between "SEDTest" and "Test" returned "Resync Filed. Files are too different".
Can someone please help me understand what is causing these file size discrepancies?
EDIT: I created the files "Test.txt" and "TestWithNPrefix.txt" in UltraEdit. I just typed out the word "TEST"/"NTEST", then copied and pasted it 10,000 times.
Not an answer, but a comment with formatting:
You seem to be running into some odd situation with DOS versus Unix line endings. I have to ask: How are you creating the files? I would expect 10,000 lines of "TEST\r\n" would be exactly 60,000 bytes in size, not 59,999
On Linux (I don't have access to a cygwin environment at the moment):'
$ yes $'TEST\r' | head -n 10000 > Test
$ ll Test
-rw-r--r-- 1 jackman jackman 60000 Jan 8 13:06 Test
$ sed 's/^/N/' Test > SEDTest
$ ll *Test
-rw-r--r-- 1 jackman jackman 70000 Jan 8 13:06 SEDTest
-rw-r--r-- 1 jackman jackman 60000 Jan 8 13:06 Test
For example, if I have two files:
file1:
This is file 1
and file2:
This is file 2
and create patch with the following command:
diff -u file1 file2 > files.patch
result is:
--- file1 Fri Aug 13 17:53:28 2010
+++ file2 Fri Aug 13 17:53:38 2010
## -1,1 +1,1 ##
-This is file 1
+This is file 2
Then if I try to apply this patch on Solaris with patch command:
patch -u -i files.patch
it hangs on:
Looks like a unified context diff.
File to patch:
1. Is there a way to use Solaris native patch command with unified diffs?
2. Which diff format is considered most portable if it's not possible to apply unified format?
Update:
I've found answer on the first part of my question. Seems that patch on Solaris hangs if the second file (file2 in this case) exists in the same folder as the first one (file1). For example, the following quite common diff:
--- a/src/file.src Sat Aug 14 23:07:29 2010
+++ b/src/file.src Sat Aug 14 23:07:37 2010
## -1,2 +1,1 ##
-1
-
+2
will not work with quite common patch command:
patch -p1 -u -d a < file.patch
while the following diff (note second file is renamed):
--- a/src/file.src Sat Aug 14 23:07:29 2010
+++ b/src/file_new.src Sat Aug 14 23:07:37 2010
## -1,2 +1,1 ##
-1
-
+2
will work perfectly.
For the second part of my question see accepted answer below.
On Solaris /usr/bin/patch is an old version required to comply with some ancient standards.
A modern version of GNU patch is provided as /usr/bin/gpatch on Solaris 8 and later.
diff -cr old.new new.txt > patch.txt
gpatch -p0 < patch.txt
Works perfectly for me (using gpatch)
Single Unix v2 and v3 both support context diffs but not unified diffs, so for better portability you should use context diffs (-c option to diff and patch).
On older Solaris releases (pre-10, I think), you need to make sure that /usr/xpg4/bin is before /usr/bin in your $PATH, otherwise you may get compatibility versions of some utilities instead of standard ones.