View Single Post
pichlo's Avatar
Posts: 6,453 | Thanked: 20,983 times | Joined on Sep 2012 @ UK
#1594
Originally Posted by Markkyboy View Post
Taken from Schturman's post, somewhere on this thread and modified a little.



Name: sailfishos-remove-overlay-colour-camera-settings
Version: 0.1
Release: 1
Summary: Removes the ambient colour from the overlay in camera settings.
Group: System/Tools
Vendor: Markkyboy
Distribution: SailfishOS
Packager: Markkyboy
URL: https://www.facebook.com/JollaUK
Requires: jolla-camera >= 0.2.12.2-10.45.1, patchmanager

License: GPL

%description
Jolla-camera - removes ambient colour from camera settings overlay.

%files
/usr/share/patchmanager/patches/sailfishos-remove-overlay-colour-camera-settings/*
Dunno if I was doing something wrong but to make my RPMs work, I had to do:

%files
%defattr(644,root,root,-)
%{_datadir}/patchmanager/patches/sailfishos-remove-overlay-colour-camera-settings

(Note no /* at the end.)

%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-remove-overlay-colour-camera-settings
fi
fi
You can avoid double fi at the end by using

if [...]; then
. blabla
elif [...]; then
. blabla
else
. blabla
fi


Pardon the silly question, but what does the $1 = 1 do?

Last edited by pichlo; 2015-09-22 at 16:38. Reason: Cleaned up formatting