That would be great help. Hopefully it wont take too long for me to work out how to do this correctly.
Hi,
I didn’t look at the ‘rbp’ patch series, just the ‘all’ patch series as that’s most likely to break. Let me walk you through an example.
I have cloned Kodi master:
git clone https://github.com/xbmc/xbmc --depth 1 -b master
cd xbmc
I copied all my ‘all’ patches across, and tried to apply the first one:
git am all-001-system-info-display.patch
I got the following:
sam@sam-laptop:/tmp/xbmc$ git am all-001-system-info-display.patch
Applying: Cosmetic changes to the System Information dialog
error: patch failed: xbmc/windows/GUIWindowSystemInfo.cpp:56
error: xbmc/windows/GUIWindowSystemInfo.cpp: patch does not apply
So I need to update this patch. I now run:
git apply all-001-system-info-display.patch --reject
This will give me a xbmc/windows/GUIWindowSystemInfo.cpp.rej file. I can then open this to look for myself what hunks of the patch were rejected. Let’s look at a rejected hunk:
@@ -100,7 +99,6 @@ void CGUIWindowSystemInfo::FrameMove()
#endif
SetControlLabel(i++, "%s: %s", 12390, SYSTEM_UPTIME);
SetControlLabel(i++, "%s: %s", 12394, SYSTEM_TOTALUPTIME);
- SetControlLabel(i++, "%s: %s", 12395, SYSTEM_BATTERY_LEVEL);
Do you see the small ‘-’ at the beginning of the line? This means that in my patch I was removing this line. That’s because I don’t want OSMC showing battery status, when it’s often irrelevant (Pi, Vero, etc). But the position in xbmc/windows/GUIWindowSystemInfo.cpp has changed due to updates to the codebase since 15.0, so we must update the patch. So we edit xbmc/windows/GUIWindowSystemInfo.cpp and remove the line which sets SYSTEM_BATTERY_LEVEL
.
Let’s look at another hunk:
- SET_CONTROL_LABEL(52, CSysInfo::GetAppName() + " " + g_infoManager.GetLabel(SYSTEM_BUILD_VERSION).c_str() +
- " (Compiled: " + g_infoManager.GetLabel(SYSTEM_BUILD_DATE).c_str() +")");
+ SET_CONTROL_LABEL(52, "Open Source Media Center running " + CSysInfo::GetAppName() + " " + g_infoManager.GetLabel(SYSTEM_BUILD_VERSION).substr(0,4).c_str() + " (Compiled: " + g_infoManager.GetLabel(SYSTEM_BUILD_DATE).c_str() +")");
Here, you can see in my original patch I have removed two lines and added one. This is a cosmetic change and makes sure OSMC is displayed under the System Info dialog. The easiest way to fix the patch is to check for one of the lines I am deleting in the original file. Once you find it, you just need to remove it and add my line back in.
But you won’t find that line. It has changed to:
SET_CONTROL_LABEL(52, CSysInfo::GetAppName() + " " + CSysInfo::GetVersion());
I found that line by searching for ‘52’, which is the label ID in the new file. So you can change that line above to the one in the patch and that is again, another hunk resolved.
Eventually, you will resolve all of the issues. You can now run
git add xbmc/windowing/GUIWindowSystemInfo.cpp
git am --continue
This will now commit your changes, and retain the original commit message and author, which is great! To get that updated patch, you can run:
git format-patch HEAD~1..HEAD --stdout > all-001-system-info-display.patch
Copy that back in to your patches/ folder.
Well done – you just rebased a patch against the latest version of Kodi
Sam
Awesome - thanks very much. Great explanation of the steps. I was originally trying to hack the patch file to get it to work.
Busy going through all the patches - 3 fixed so far
Just one point (I think)
git am --fixed
Should this be:
git am --continue
Update: I’ve gone through all the patches and fixed 7 of them. Another 3 patches I had to remove as they point to files/procedures that no longer exist.
I have now also removed the isengard patch and added in newclock5 and getting a few critical errors. How do I go about fixing these from newclock5 patch?
Applying patch rbp-006-newclock5.patch
Installing package git...
Package already installed.
error: patch failed: package/mediacenter-next-osmc/src/xbmc-6fce7c0a89e15d5fa227f60b42654b63247d9a02/system/peripherals.xml:31
error: package/mediacenter-next-osmc/src/xbmc-6fce7c0a89e15d5fa227f60b42654b63247d9a02/system/peripherals.xml: patch does not apply
error: patch failed: package/mediacenter-next-osmc/src/xbmc-6fce7c0a89e15d5fa227f60b42654b63247d9a02/xbmc/windowing/egl/EGLNat iveTypeRaspberryPI.cpp:28
error: package/mediacenter-next-osmc/src/xbmc-6fce7c0a89e15d5fa227f60b42654b63247d9a02/xbmc/windowing/egl/EGLNativeTypeRaspber ryPI.cpp: patch does not apply
error: patch failed: package/mediacenter-next-osmc/src/xbmc-6fce7c0a89e15d5fa227f60b42654b63247d9a02/system/peripherals.xml:16
error: package/mediacenter-next-osmc/src/xbmc-6fce7c0a89e15d5fa227f60b42654b63247d9a02/system/peripherals.xml: patch does not apply
error: patch failed: package/mediacenter-next-osmc/src/xbmc-6fce7c0a89e15d5fa227f60b42654b63247d9a02/xbmc/input/linux/LinuxInp utDevices.cpp:279
error: package/mediacenter-next-osmc/src/xbmc-6fce7c0a89e15d5fa227f60b42654b63247d9a02/xbmc/input/linux/LinuxInputDevices.cpp: patch does not apply
Exiting build
Makefile:8: recipe for target 'rbp2' failed
The newclock5 patch I have is around 12M so I dont even know where to begin.
Which ones? They will still serve some purpose, so we need to find out what needs changing.
That will work. I was a little tired when I wrote the post
You speak with @popcornmix. I’ll ask him if newclock5 can be applied to Kodi’s latest master. Remember ‘all’ patch series is applied against Kodi master before ‘rbp’ patches. It’s possible an OSMC patch is breaking things. The quickest way to check is to always clone Kodi master and try and apply the RBP patches directly. If that works, then an OSMC patch is the culprit, and we can extend the conversation from there.
I sent you a PM
Sam
I removed the following patches.
all-027, 030, 035, 038.
They either pointed to files that no longer exist or to procedures that I could not find. Will need further looking into.
Will try apply the rbp patches directly and see how that goes.
For all-027
, the SCM revision moved to CSystemInfo
From cef6a88d621fd2efa29a0101614e4ed2556fdd9d Mon Sep 17 00:00:00 2001
From: Sam Nazarko <email@samnazarko.co.uk>
Date: Tue, 20 Oct 2015 18:44:05 +0100
Subject: [PATCH] Do not return SCM revision in version
Signed-off-by: Sam Nazarko <email@samnazarko.co.uk>
---
xbmc/utils/SystemInfo.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xbmc/utils/SystemInfo.cpp b/xbmc/utils/SystemInfo.cpp
index d38502c..f0a6ac5 100644
--- a/xbmc/utils/SystemInfo.cpp
+++ b/xbmc/utils/SystemInfo.cpp
@@ -1249,7 +1249,7 @@ std::string CSysInfo::GetVersionShort()
std::string CSysInfo::GetVersion()
{
- return GetVersionShort() + " Git:" + CCompileInfo::GetSCMID();
+ return GetVersionShort();
}
std::string CSysInfo::GetBuildDate()
--
2.1.0
all-030 needs updating. ApplicationMessenger moved to xbmc/messaging.
all-035 needs updating, but not necessarily trivial. You can omit it for now, as anyone using a nightly will have used the tutorial.
all-038 can be ripped.
Sam