[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Switch to iceweasel as the default browser?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Jul 26, 2008 at 01:45:27PM +0200, Petter Reinholdtsen wrote:
>+DPkg
>+{
>+Post-Invoke {"if [ -x /usr/sbin/update-alternatives ] && [ -x /usr/bin/iceweasel ]; then /usr/sbin/update-alternatives --set x-www-browser /usr/bin/iceweasel; else exit 0; fi";};
>+};

This provoked me to finally look deeper into the need of that long line.  
Yes, it does have to be one single line. But update-alternatives is part 
of dpkg so should be safe to expect exists. On the other hand it is 
probably not safe to expect it to always succeed.

All in all - here is an improved APT snippet - shorter (but still 
annoyingly long), and safer (only noisy if things go wrong, not breaking 
APT):


DPkg
{
Post-Invoke {
"x=/usr/bin/iceweasel;[ -x $x ]&&/usr/sbin/update-alternatives --set x-www-browser $x||true";
};
};


  - Jonas

- -- 
* Jonas Smedegaard - idealist og Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

  - Enden er nær: http://www.shibumi.org/eoti.htm
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkiLN4UACgkQn7DbMsAkQLh4VACfZ55uMIT4J4WyPofSkuYCmtoQ
JI4An3L11ON8Q8tnNEfzzVu4G3z3vhDs
=oaBq
-----END PGP SIGNATURE-----


Reply to: