Reply
Thread Tools
Posts: 1,335 | Thanked: 3,931 times | Joined on Jul 2010 @ Brittany, France
#1871
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's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#1872
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,
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#1873
Originally Posted by Markkyboy View Post
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...

Last edited by Schturman; 2016-03-26 at 01:01.
 

The Following User Says Thank You to Schturman For This Useful Post:
coderus's Avatar
Posts: 6,436 | Thanked: 12,701 times | Joined on Nov 2011 @ Ängelholm, Sweden
#1874
if you cant apply patch its 100% problem in patch
spec file is for building and installing package
__________________
Telegram | Openrepos | GitHub | Revolut donations
 
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#1875
Originally Posted by coderus View Post
if you cant apply patch its 100% problem in patch
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.
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#1876
Originally Posted by Markkyboy View Post
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...
 

The Following User Says Thank You to Schturman For This Useful Post:
coderus's Avatar
Posts: 6,436 | Thanked: 12,701 times | Joined on Nov 2011 @ Ängelholm, Sweden
#1877
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.
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following 2 Users Say Thank You to coderus For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#1878
Originally Posted by coderus View Post
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.
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 
coderus's Avatar
Posts: 6,436 | Thanked: 12,701 times | Joined on Nov 2011 @ Ängelholm, Sweden
#1879
i see wrong filenames for both blocks and unwanted whitespace line after first block
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following 2 Users Say Thank You to coderus For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#1880
Originally Posted by coderus View Post
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.
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 
Reply

Tags
patchmanager, sailfish os

Thread Tools

 
Forum Jump


All times are GMT. The time now is 05:12.