#! /bin/sh /usr/share/dpatch/dpatch-run ## 30_fix-infinite-loop.dpatch by Lorenzo Milesi ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Fix F-spot getting stuck in a loop if there's an exception on start ## DP: (upstream SVN 3484) @DPATCH@ --- trunk/src/main.cs 2007/12/04 20:39:52 3467 +++ trunk/src/main.cs 2007/12/08 08:29:01 3484 @@ -130,6 +130,7 @@ setupService.Repositories.RegisterRepository (null, "http://addins.f-spot.org", false); bool create = true; + int retry_count = 0; while (control == null) { try { control = Core.FindInstance (); @@ -170,8 +171,13 @@ if (core != null) core.UnregisterServer (); } - if (control == null) + if (control == null) { System.Console.WriteLine ("Can't get a connection to the dbus. Trying again..."); + if (++ retry_count > 5) { + System.Console.WriteLine ("Sorry, couldn't start F-Spot"); + System.Environment.Exit (1); + } + } }