Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling patch fails with "Unreversed patch detected" #20

Open
porw opened this issue Jul 4, 2020 · 3 comments
Open

Enabling patch fails with "Unreversed patch detected" #20

porw opened this issue Jul 4, 2020 · 3 comments

Comments

@porw
Copy link

porw commented Jul 4, 2020

On fresh install of Sailfish Rokua 3.3.0.16 after Patchmanager fails to enable the patch with "unreversed patch detected" for both files. According to diff /usr/share/maliit/plugins/com/jolla/KeyboardBase.qml and /usr/share/jolla-settings/pages/text_input/textinput.qml match the ones in diff/original/ but for some reason, the patch succeeds only after I copy the files from diff/original/ over the default ones.

[root@Xperia10-DualSIM]# patch -p 1 -d / -i /usr/share/patchmanager/patches/jolla-kbd-flick-jp/unified_diff.patch --verbose
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- original/usr/share/jolla-settings/pages/text_input/textinput.qml
|+++ patched/usr/share/jolla-settings/pages/text_input/textinput.qml
--------------------------
patching file usr/share/jolla-settings/pages/text_input/textinput.qml
Using Plan A...
Hunk #1 succeeded at 362 (offset 26 lines).
Hunk #2 FAILED at 406.
1 out of 2 hunks FAILED -- saving rejects to file usr/share/jolla-settings/pages/text_input/textinput.qml.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- original/usr/share/maliit/plugins/com/jolla/KeyboardBase.qml
|+++ patched/usr/share/maliit/plugins/com/jolla/KeyboardBase.qml
--------------------------
patching file usr/share/maliit/plugins/com/jolla/KeyboardBase.qml
Using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
Hunk #1 ignored at 100.
Hunk #2 ignored at 232.
Hunk #3 ignored at 255.
Hunk #4 ignored at 329.
4 out of 4 hunks ignored -- saving rejects to file usr/share/maliit/plugins/com/jolla/KeyboardBase.qml.rej
done

After

[root@Xperia10-DualSIM]# cp diff/original/usr/share/maliit/plugins/com/jolla/KeyboardBase.qml /usr/share/maliit/plugins/com/jolla/KeyboardBase.qml
[root@Xperia10-DualSIM]# cp diff/original/usr/share/jolla-settings/pages/text_input/textinput.qml /usr/share/jolla-settings/pages/text_input/textinput.qml
[root@Xperia10-DualSIM]# systemctl --user restart maliit-server

patch can be applied and it works as expected and in keyboard settings one can enable the assist labels.

@sleepsounds
Copy link

I also faced similar issue with newly installed Sailfish X 3.3.0.16 with patchmanager3.
At least I can confirmed:

  • There are differences on /usr/share/jolla-settings/pages/text_input/textinput.qml from the one patch premised.
  • But after I changed patch to match the system file, it still cannot be installed.
  • I removed the setting part from the patch, then patch can be installed.

So it maybe some problem with modification of setting files.

@sleepsounds
Copy link

I forgot to mention my hardware last time...
It's Xperia 10 Dual SIM.
So I tested to original patch and got the error log.

----------------------------------
PM APPLY Fri Nov 6 17:50:35 JST 2020
----------------------------------

jolla-kbd-flick-jp
  contains text patch


----------------------------------
Test if already applied patch
----------------------------------

can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- original/usr/share/jolla-settings/pages/text_input/textinput.qml
|+++ patched/usr/share/jolla-settings/pages/text_input/textinput.qml
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
2 out of 2 hunks ignored
checking file usr/share/maliit/plugins/com/jolla/KeyboardBase.qml
Unreversed patch detected! Ignore -R? [n] 
Apply anyway? [n] 
Skipping patch.
4 out of 4 hunks ignored

----------------------------------
Dry running patch
----------------------------------

can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- original/usr/share/jolla-settings/pages/text_input/textinput.qml
|+++ patched/usr/share/jolla-settings/pages/text_input/textinput.qml
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
2 out of 2 hunks ignored
checking file usr/share/maliit/plugins/com/jolla/KeyboardBase.qml

*** FAILED ***

I also confirmed the source of /usr/share/jolla-settings/pages/text_input/textinput.qml differ from that of src folder on the repository.
So tried to install the patch after some modification to suit the new file but it still got same error.
/usr/share/jolla-settings/pages/text_input/textinput.qml is still there so it's really weird....

@porw
Copy link
Author

porw commented Apr 3, 2022

On 4.4.0.58 Vanha Rauma on Xperia 10 II Dual Sim this seems to be working a bit better.
with patchmanager-3.2.2-1.1.1.jolla.aarch64 and jolla-kbd-flick-jp-1.0.0-1.noarch installed (apparently patchmanager is a dependency for the patch) everything worked except assist labels and flick popper.
This happened without touching PatchManager or any settings (except enabling the keyboard in settings).
After enabling the patch from cli,

[root@Xperia10II-DualSIM defaultuser]# patch -p 1 -d / -i /usr/share/patchmanager/patches/jolla-kbd-flick-jp/unified_diff.patch --verbose
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- original/usr/share/jolla-settings/pages/text_input/textinput.qml
|+++ patched/usr/share/jolla-settings/pages/text_input/textinput.qml
--------------------------
patching file usr/share/jolla-settings/pages/text_input/textinput.qml
Using Plan A...
Hunk #1 succeeded at 198 (offset -138 lines).
Hunk #2 FAILED at 406.
1 out of 2 hunks FAILED -- saving rejects to file usr/share/jolla-settings/pages/text_input/textinput.qml.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- original/usr/share/maliit/plugins/com/jolla/KeyboardBase.qml
|+++ patched/usr/share/maliit/plugins/com/jolla/KeyboardBase.qml
--------------------------
patching file usr/share/maliit/plugins/com/jolla/KeyboardBase.qml
Using Plan A...
Hunk #1 succeeded at 157 with fuzz 2 (offset 57 lines).
Hunk #2 succeeded at 332 (offset 80 lines).
Hunk #3 succeeded at 359 (offset 84 lines).
Hunk #4 succeeded at 435 (offset 84 lines).
done
[root@Xperia10II-DualSIM defaultuser]# cat /usr/share/jolla-settings/pages/text_input/textinput.qml.rej
--- usr/share/jolla-settings/pages/text_input/textinput.qml
+++ usr/share/jolla-settings/pages/text_input/textinput.qml
@@ -406,6 +425,20 @@
         id: mohuConfig
 
         key: "/sailfish/text_input/mohu_enabled"
+        defaultValue: false
+    }
+
+    ConfigurationValue {
+        id: flickAssistConfig
+
+        key: "/sailfish/text_input/flick_assist_label_enabled"
+        defaultValue: false
+    }
+
+    ConfigurationValue {
+        id: flickPopperConfig
+
+        key: "/sailfish/text_input/flick_popper_enabled"
         defaultValue: false
     }
 

[root@Xperia10II-DualSIM defaultuser]# systemctl --user restart maliit-server

Nothing was changed, although after some messing up by including the config lines into textinput.qml the keyboard disappeared alltogether.
After copying these files from emulator (4.3.0.12 Suomenlinna) and applying the patch from cli both assist labels and flick popper worked, although they cannot be enabled/disabled from settings.

[root@Xperia10II-DualSIM text_input]# patch -p 1 -d / -i /usr/share/patchmanager/patches/jolla-kbd-flick-jp/unified_diff.patch --verbose
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- original/usr/share/jolla-settings/pages/text_input/textinput.qml
|+++ patched/usr/share/jolla-settings/pages/text_input/textinput.qml
--------------------------
patching file usr/share/jolla-settings/pages/text_input/textinput.qml
Using Plan A...
Hunk #1 succeeded at 198 (offset -138 lines).
Hunk #2 FAILED at 406.
1 out of 2 hunks FAILED -- saving rejects to file usr/share/jolla-settings/pages/text_input/textinput.qml.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- original/usr/share/maliit/plugins/com/jolla/KeyboardBase.qml
|+++ patched/usr/share/maliit/plugins/com/jolla/KeyboardBase.qml
--------------------------
patching file usr/share/maliit/plugins/com/jolla/KeyboardBase.qml
Using Plan A...
Hunk #1 succeeded at 157 with fuzz 2 (offset 57 lines).
Hunk #2 succeeded at 332 (offset 80 lines).
Hunk #3 succeeded at 359 (offset 84 lines).
Hunk #4 succeeded at 435 (offset 84 lines).
done
[root@Xperia10II-DualSIM text_input]# systemctl --user restart maliit-server
[root@Xperia10II-DualSIM text_input]# cat /usr/share/jolla-settings/pages/text_input/textinput.qml.rej
--- usr/share/jolla-settings/pages/text_input/textinput.qml
+++ usr/share/jolla-settings/pages/text_input/textinput.qml
@@ -406,6 +425,20 @@
         id: mohuConfig
 
         key: "/sailfish/text_input/mohu_enabled"
+        defaultValue: false
+    }
+
+    ConfigurationValue {
+        id: flickAssistConfig
+
+        key: "/sailfish/text_input/flick_assist_label_enabled"
+        defaultValue: false
+    }
+
+    ConfigurationValue {
+        id: flickPopperConfig
+
+        key: "/sailfish/text_input/flick_popper_enabled"
         defaultValue: false
     }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants