maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   [WIP] App / Tweak: patchmanager a system-wide patching system + homescreen tweak (https://talk.maemo.org/showthread.php?t=92935)

Kabouik 2016-03-25 16:28

Re: [WIP] App / Tweak: patchmanager a system-wide patching system + homescreen tweak
 
After a week of use, I'm starting to like the quick gesture to close covers. It helps closing them without having to reach the top of the screen with your thumb, which is usually inconvenient.

The question about the notifications hiding the status bar is still open!

Markkyboy 2016-03-25 21:48

Re: [WIP] App / Tweak: patchmanager a system-wide patching system + homescreen tweak
 
Hey guys, I wonder if anyone can shed some light on a weird but not so troubling problem.

I've made a patch (RPM), the app installs to patchmanager, but patchmanager can't apply and an error message just says 'failed to install'.

My patch makes some very minor changes in 'compositor.qml' and 'VolumeControl.qml'.
I am able to make my changes manually to the device and they work, even after a reboot.

So, why can I not apply the patch? - now, as the changes work when done manually, I'm going to assume that my spec file is the problem, as I get an error when uninstalling the patch.rpm; something like ("// error: line 2: is a directory) with a message about the %preun section - but the thing is, all my other patches are structured in the same way and they all install/patch/work/unapply/uninstall - but not this one.

Here's the spec contents; (shortened)

Code:

%description
Control the volume with 2 fingers portrait or both thumbs in landscape mode

%files
/usr/share/patchmanager/patches/sailfishos-patch-two-fingers-volume-control/*

%pre
if [ $1 = 1 ]; then
    // Do stuff specific for first install
echo "It's first time install"
else
if [ $1 = 2 ]; then
    // Do stuff specific to upgrades
echo "It's just upgrade"
/usr/sbin/patchmanager -u sailfishos-patch-two-fingers-volume-control
fi
fi

%preun
if [ $1 = 0 ]; then
    // Do stuff specific to uninstalls
/usr/sbin/patchmanager -u sailfishos-patch-two-fingers-volume-control
else
if [ $1 = 1 ]; then
    // Do stuff specific to upgrades
echo "It's just upgrade"
fi
fi

%postun
if [ $1 = 0 ]; then
    // Do stuff specific to uninstalls
rm -rf /usr/share/patchmanager/patches/sailfishos-patch-two-fingers-volume-control
else
if [ $1 = 1 ]; then
    // Do stuff specific to upgrades
echo "It's just upgrade"
fi
fi

%changelog

Any information gratefully received :)

Regards,

Schturman 2016-03-26 00:43

Re: [WIP] App / Tweak: patchmanager a system-wide patching system + homescreen tweak
 
Quote:

Originally Posted by Markkyboy (Post 1502137)
Hey guys, I wonder if anyone can shed some light on a weird but not so troubling problem.

I've made a patch (RPM), the app installs to patchmanager, but patchmanager can't apply and an error message just says 'failed to install'.

My patch makes some very minor changes in 'compositor.qml' and 'VolumeControl.qml'.
I am able to make my changes manually to the device and they work, even after a reboot.

So, why can I not apply the patch? - now, as the changes work when done manually, I'm going to assume that my spec file is the problem, as I get an error when uninstalling the patch.rpm; something like ("// error: line 2: is a directory) with a message about the %preun section - but the thing is, all my other patches are structured in the same way and they all install/patch/work/unapply/uninstall - but not this one.

Here's the spec contents; (shortened)

Code:

%description
Control the volume with 2 fingers portrait or both thumbs in landscape mode

%files
/usr/share/patchmanager/patches/sailfishos-patch-two-fingers-volume-control/*

%pre
if [ $1 = 1 ]; then
    // Do stuff specific for first install
echo "It's first time install"
else
if [ $1 = 2 ]; then
    // Do stuff specific to upgrades
echo "It's just upgrade"
/usr/sbin/patchmanager -u sailfishos-patch-two-fingers-volume-control
fi
fi

%preun
if [ $1 = 0 ]; then
    // Do stuff specific to uninstalls
/usr/sbin/patchmanager -u sailfishos-patch-two-fingers-volume-control
else
if [ $1 = 1 ]; then
    // Do stuff specific to upgrades
echo "It's just upgrade"
fi
fi

%postun
if [ $1 = 0 ]; then
    // Do stuff specific to uninstalls
rm -rf /usr/share/patchmanager/patches/sailfishos-patch-two-fingers-volume-control
else
if [ $1 = 1 ]; then
    // Do stuff specific to upgrades
echo "It's just upgrade"
fi
fi

%changelog

Any information gratefully received :)

Regards,

Maybe problem not your .spec, may one or both files already patched by another patch and this is a reason that patchmanger can't apply your patch.

P.S. Also check if you created patch file correctly...

coderus 2016-03-26 03:02

Re: [WIP] App / Tweak: patchmanager a system-wide patching system + homescreen tweak
 
if you cant apply patch its 100% problem in patch :D
spec file is for building and installing package

Markkyboy 2016-03-26 11:45

Re: [WIP] App / Tweak: patchmanager a system-wide patching system + homescreen tweak
 
Quote:

Originally Posted by coderus (Post 1502144)
if you cant apply patch its 100% problem in patch :D
spec file is for building and installing package

Thanks coderus, you may laugh, but there are no other patches installed. In fact a fresh install of patchmanager after installing lipstick-jolla-home-qt5 DIR again. I appreciate what you are saying and I know you know your stuff. But there are no other patches installed. So, if it is not to do with the spec file, why th error warning about Line 2: in %preun section..??

Also, @schturman - how do I check that I created the patch correctly? - I have altered my unified_diff.patch several times, putting voljmecontrol qml diff first then compositor.qml and vice versa.........if I make the alterations manually, the idea works, but trying to patch it, it fails. Weird.

Schturman 2016-03-26 12:06

Re: [WIP] App / Tweak: patchmanager a system-wide patching system + homescreen tweak
 
Quote:

Originally Posted by Markkyboy (Post 1502162)
Thanks coderus, you may laugh, but there are no other patches installed. In fact a fresh install of patchmanager after installing lipstick-jolla-home-qt5 DIR again. I appreciate what you are saying and I know you know your stuff. But there are no other patches installed. So, if it is not to do with the spec file, why th error warning about Line 2: in %preun section..??

Also, @schturman - how do I check that I created the patch correctly? - I have altered my unified_diff.patch several times, putting voljmecontrol qml diff first then compositor.qml and vice versa.........if I make the alterations manually, the idea works, but trying to patch it, it fails. Weird.

Error on uninstallation because patchmanager can't UNapply your patch. Problem in your patch file...

coderus 2016-03-26 12:51

Re: [WIP] App / Tweak: patchmanager a system-wide patching system + homescreen tweak
 
for example you can post your patch here and someone can show where is your fault.
and you should never alter patch file by hand, you should use git or diff tool instead.

Markkyboy 2016-03-26 17:00

Re: [WIP] App / Tweak: patchmanager a system-wide patching system + homescreen tweak
 
Quote:

Originally Posted by coderus (Post 1502168)
for example you can post your patch here and someone can show where is your fault.
and you should never alter patch file by hand, you should use git or diff tool instead.

Okay, I hear you, thanks, I understand altering diff after output is not the way - it was a way of trying to find the problem.

I would also like to say; the file shown below does indeed, take a cue from Virgi's Three Finger Volume Control patch. I don't intend, as yet, to upload the patch, certainly not without contacting Virgi first.

Here's the patch code;

Code:

--- /usr/share/lipstick-jolla-home-qt5/volumecontrol/VolumeControl.qml  2016-03-25 00:55:30.75196045$
+++ /home/nemo/usr/share/lipstick-jolla-home-qt5/volumecontrol/VolumeControl.qml        2016-03-25 2$
@@ -250,7 +250,7 @@
            extend: "showBar"
            PropertyChanges {
                target: volumeBar
-                showContinuousVolume: Screen.sizeCategory >= Screen.Large
+                showContinuousVolume: Screen.sizeCategory >= Screen.Small
            }
        }
    ]

--- /usr/share/lipstick-jolla-home-qt5/compositor.qml  2016-03-25 00:46:03.301257118 +0000
+++ /home/nemo/usr/share/lipstick-jolla-home-qt5/compositor.qml 2016-03-25 23:30:50.841993709 +0000
@@ -222,10 +222,10 @@
    MultiPointTouchDrag {
        id: globalVolumeGestureItem

-        enabled: !systemGesturesDisabled && SS.Screen.sizeCategory >= SS.Screen.Large
+        enabled: !systemGesturesDisabled && SS.Screen.sizeCategory >= SS.Screen.Small
        orientation: Lipstick.compositor.topmostWindowOrientation
-        fingers: 3
-        direction: MultiPointTouchDrag.Vertical
+        fingers: 2
+        direction: MultiPointTouchDrag.Horizontal
    }

    function updateScreenOrientation() {

As stated previously, applying the changes to the files manually works, I get the result I would like. So I believe my patch should do the same.

coderus 2016-03-26 17:10

Re: [WIP] App / Tweak: patchmanager a system-wide patching system + homescreen tweak
 
i see wrong filenames for both blocks and unwanted whitespace line after first block

Markkyboy 2016-03-26 17:23

Re: [WIP] App / Tweak: patchmanager a system-wide patching system + homescreen tweak
 
Quote:

Originally Posted by coderus (Post 1502182)
i see wrong filenames for both blocks and unwanted whitespace line after first block

Okay, when I said I had made alterations to diff file - one of them was closing that white space (which by the way is apparent in other working patches) but it makes no difference, the patch still fails to apply.

wrong filenames?, so you are saying I am editing the wrong files?, as I see no mistakes in paths or their names - please elaborate, I don't fully understand what you mean..?, thanks.


All times are GMT. The time now is 18:36.

vBulletin® Version 3.8.8