View Single Post
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: