Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package unison for openSUSE:Factory checked 
in at 2024-05-07 18:04:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/unison (Old)
 and      /work/SRC/openSUSE:Factory/.unison.new.1880 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "unison"

Tue May  7 18:04:01 2024 rev:48 rq:1172306 version:2.53.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/unison/unison.changes    2024-02-21 
17:57:29.125622744 +0100
+++ /work/SRC/openSUSE:Factory/.unison.new.1880/unison.changes  2024-05-07 
18:04:36.977152318 +0200
@@ -1,0 +2,8 @@
+Tue May  7 07:07:07 UTC 2024 - oher...@suse.de
+
+- Update to version 2.53.5
+  * Various minor bugfixes.
+  * Recovery from errors during repeat mode (enabled in 2.53.1)
+    is disabled for time being.
+
+-------------------------------------------------------------------

Old:
----
  unison-2.53.4.tar.xz

New:
----
  unison-2.53.5.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ unison.spec ++++++
--- /var/tmp/diff_new_pack.NOMB42/_old  2024-05-07 18:04:40.769290205 +0200
+++ /var/tmp/diff_new_pack.NOMB42/_new  2024-05-07 18:04:40.769290205 +0200
@@ -24,7 +24,7 @@
 
 %define     pkg unison
 Name:           %pkg%nsuffix
-Version:        2.53.4
+Version:        2.53.5
 Release:        0
 %{?ocaml_preserve_bytecode}
 Summary:        File synchronization tool
@@ -37,10 +37,8 @@
 BuildRequires:  ocaml(ocaml_base_version) >= 4.08
 BuildRequires:  ocaml-rpm-macros >= 20231101
 %if "%build_flavor" == "doc"
-%if 0%?suse_version > 1500 || 0%?sle_version > 150300
 BuildRequires:  hevea
 BuildRequires:  lynx
-%endif
 BuildRequires:  texlive-collection-latex
 BuildRequires:  texlive-metafont
 %else
@@ -79,7 +77,6 @@
 %build
 %if "%build_flavor" == "doc"
 %make_build docs
-ls -lart doc man
 %else
 %make_build PREFIX=%_prefix
 %endif
@@ -95,7 +92,21 @@
   echo "%%doc %_defaultdocdir/%pkg/unison-manual.$ext" >> files
 done
 %else
-echo '%%doc src/COPYING' > files
+# The presence of _defaultlicensedir is no inidicator for a usable %%license 
macro
+# If it is defined, but rpm is still too old, it will default to the last 
License: line.
+if bash -x -c 'read a b c < <(rpm --version)
+set -- ${c//./ }
+test $1 -lt 4 && exit 1
+if test $1 -eq 4 && test $2 -lt 14
+then
+       exit 1
+fi
+exit 0'
+then
+       echo '%%license src/COPYING' > files
+else
+       echo '%%doc src/COPYING' > files
+fi
 %make_install PREFIX=%_prefix
 
 mv %buildroot%_bindir/%name %buildroot%_bindir/%name-text

++++++ _service ++++++
--- /var/tmp/diff_new_pack.NOMB42/_old  2024-05-07 18:04:40.813291805 +0200
+++ /var/tmp/diff_new_pack.NOMB42/_new  2024-05-07 18:04:40.817291950 +0200
@@ -53,7 +53,7 @@
     <param name="exclude">unison-gui.opam</param>
     <param name="exclude">unison.opam</param>
     <param name="filename">unison</param>
-    <param name="revision">f6e8bea5d9e5a5282904fdf644ed4d7ee9b9b2ad</param>
+    <param name="revision">060f54b0ec95e26df8725d699ef7b4cab23e0d68</param>
     <param name="scm">git</param>
     <param name="submodules">disable</param>
     <param name="url">https://github.com/bcpierce00/unison.git</param>

++++++ unison-2.53.4.tar.xz -> unison-2.53.5.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unison-2.53.4/src/Makefile.OCaml 
new/unison-2.53.5/src/Makefile.OCaml
--- old/unison-2.53.4/src/Makefile.OCaml        2024-02-18 16:03:04.000000000 
+0100
+++ new/unison-2.53.5/src/Makefile.OCaml        2024-05-02 01:10:39.000000000 
+0200
@@ -59,11 +59,6 @@
   LABLGTK3LIB=$(OCAMLLIBDIR)/lablgtk3
   ifeq ($(wildcard $(LABLGTK3LIB)),$(LABLGTK3LIB))
     HAS_LABLGTK3=true
-  else
-    LABLGTK3LIB=$(abspath $(OCAMLLIBDIR)/../lablgtk3)
-    ifeq ($(wildcard $(LABLGTK3LIB)),$(LABLGTK3LIB))
-      HAS_LABLGTK3=true
-    endif
   endif
 endif
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unison-2.53.4/src/Makefile.ProjectInfo 
new/unison-2.53.5/src/Makefile.ProjectInfo
--- old/unison-2.53.4/src/Makefile.ProjectInfo  2024-02-18 16:03:04.000000000 
+0100
+++ new/unison-2.53.5/src/Makefile.ProjectInfo  2024-05-02 01:10:39.000000000 
+0200
@@ -1,5 +1,5 @@
 MAJORVERSION=2.53
 
-VERSION=2.53.4
+VERSION=2.53.5
 
 NAME=unison
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unison-2.53.4/src/files.ml 
new/unison-2.53.5/src/files.ml
--- old/unison-2.53.4/src/files.ml      2024-02-18 16:03:04.000000000 +0100
+++ new/unison-2.53.5/src/files.ml      2024-05-02 01:10:39.000000000 +0200
@@ -841,13 +841,13 @@
         (fun () ->
            let path1 = Update.translatePathLocal fspath1 path1 in
            let (workingDir, realPath) = Fspath.findWorkingDir fspath1 path1 in
-           let tmppath =
-             Path.addSuffixToFinalName realPath (tempName "diff-") in
+           let tmppath = Os.tempPath ~fresh:false workingDir
+             (Path.addSuffixToFinalName realPath "-diff") in
            Os.delete workingDir tmppath;
            Lwt_unix.run
              (Update.translatePath root2 path2 >>= (fun path2 ->
               Copy.file root2 path2 root1 workingDir tmppath realPath
-                `Copy (Props.setLength Props.fileSafe (Props.length desc2))
+                `Copy (Props.setLength desc1 (Props.length desc2))
                  fp2 None ress2 id) >>= fun info ->
               Lwt.return ());
            displayDiff
@@ -860,13 +860,13 @@
         (fun () ->
            let path2 = Update.translatePathLocal fspath2 path2 in
            let (workingDir, realPath) = Fspath.findWorkingDir fspath2 path2 in
-           let tmppath =
-             Path.addSuffixToFinalName realPath "#unisondiff-" in
+           let tmppath = Os.tempPath ~fresh:false workingDir
+             (Path.addSuffixToFinalName realPath "-diff") in
            Lwt_unix.run
              (Update.translatePath root1 path1 >>= (fun path1 ->
               (* Note that we don't need the resource fork *)
               Copy.file root1 path1 root2 workingDir tmppath realPath
-                `Copy (Props.setLength Props.fileSafe (Props.length desc1))
+                `Copy (Props.setLength desc2 (Props.length desc1))
                  fp1 None ress1 id >>= fun info ->
               Lwt.return ()));
            displayDiff
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unison-2.53.4/src/fsmonitor/inotify/watcher.ml 
new/unison-2.53.5/src/fsmonitor/inotify/watcher.ml
--- old/unison-2.53.4/src/fsmonitor/inotify/watcher.ml  2024-02-18 
16:03:04.000000000 +0100
+++ new/unison-2.53.5/src/fsmonitor/inotify/watcher.ml  2024-05-02 
01:10:39.000000000 +0200
@@ -120,7 +120,12 @@
 let event_is_creation (_, evl, _, _) = List.exists is_creation evl
 let event_is_deletion (_, evl, _, _) = List.exists is_deletion evl
 
-let st = Lwt_inotify.init ()
+let st =
+  try Lwt_inotify.init () with
+  | Unix.Unix_error ((EMFILE | EBADF), _, _) ->
+      Watchercommon.error "unable to start inotify: system limit reached \
+        (you can do a web search for \"inotify max_user_instances\" \
+        to understand the reasons and mitigations for this error)"
 
 module IntSet =
   Set.Make
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unison-2.53.4/src/fsmonitor.py 
new/unison-2.53.5/src/fsmonitor.py
--- old/unison-2.53.4/src/fsmonitor.py  2024-02-18 16:03:04.000000000 +0100
+++ new/unison-2.53.5/src/fsmonitor.py  2024-05-02 01:10:39.000000000 +0200
@@ -561,7 +561,7 @@
         parser.add_option("-w", "--sinceWhen", dest="sinceWhen",
                       help="""starting point for filesystem updates to be 
captured
                                           Defaults to 'now' in the first run
-                                          or the last caputured 
change""",default = 'now', metavar="SINCEWHEN")
+                                          or the last captured 
change""",default = 'now', metavar="SINCEWHEN")
         parser.add_option("-l", "--latency", dest="latency",
                       help="set notification LATENCY in seconds. default 
5",default = 5, metavar="LATENCY")
         parser.add_option("-f", "--flags", dest="flags",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unison-2.53.4/src/main.ml 
new/unison-2.53.5/src/main.ml
--- old/unison-2.53.4/src/main.ml       2024-02-18 16:03:04.000000000 +0100
+++ new/unison-2.53.5/src/main.ml       2024-05-02 01:10:39.000000000 +0200
@@ -236,7 +236,18 @@
               Uutil.myName)
     end;
     exit 0
-  with Not_found -> () end;
+  with
+  | Not_found -> ()
+  | Sys_error _ (* Broken pipe *) ->
+      (* A broken pipe (when stdout is piped to pager, for example) will cause
+         all output functions, including flush, to raise an exception. Catching
+         the exception here is not sufficient because stdout is implicitly
+         flushed on exit, which will again raise a broken pipe exception. The
+         only way to avoid [exit] raising a broken pipe exception is to close
+         [stdout] beforehand. *)
+      close_out_noerr stdout;
+      exit 0
+  end;
 
   (* Start a server if requested *)
   if Util.StringMap.mem serverPrefName argv then begin
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unison-2.53.4/src/props_xattr.c 
new/unison-2.53.5/src/props_xattr.c
--- old/unison-2.53.4/src/props_xattr.c 2024-02-18 16:03:04.000000000 +0100
+++ new/unison-2.53.5/src/props_xattr.c 2024-05-02 01:10:39.000000000 +0200
@@ -227,6 +227,9 @@
 
 
 #if defined(__Solaris__)
+#ifndef _ATFILE_SOURCE
+#define _ATFILE_SOURCE 1
+#endif
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unison-2.53.4/src/remote.ml 
new/unison-2.53.5/src/remote.ml
--- old/unison-2.53.4/src/remote.ml     2024-02-18 16:03:04.000000000 +0100
+++ new/unison-2.53.5/src/remote.ml     2024-05-02 01:10:39.000000000 +0200
@@ -705,7 +705,7 @@
 type 'a marshalingFunctions = 'a marshalFunction * 'a unmarshalFunction
 
 type 'a convV0Fun =
-  V0 : ('a -> 'compat) * ('compat -> 'a) -> 'a convV0Fun [@unboxed]
+  V0 : ('a -> 'compat) * ('compat -> 'a) -> 'a convV0Fun
 
 external id : 'a -> 'a = "%identity"
 let convV0_id = V0 (id, id)
@@ -1880,6 +1880,9 @@
 
            Don't let these signals reach ssh by blocking them.
 
+           Unfortunately, a bug introduced in OpenSSH 9.6 (also present in 9.7)
+           breaks this workaround by unblocking SIGINT in the ssh process.
+
            The signals could be ignored instead of being blocked because ssh
            does not set handlers for SIGINT and SIGQUIT if they've been ignored
            at startup. But this triggers an error in ssh. The interactive
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unison-2.53.4/src/strings.ml 
new/unison-2.53.5/src/strings.ml
--- old/unison-2.53.4/src/strings.ml    2024-02-18 16:03:04.000000000 +0100
+++ new/unison-2.53.5/src/strings.ml    2024-05-02 01:10:39.000000000 +0200
@@ -4,7 +4,7 @@
 let docs =
     ("about", ("About Unison", 
      "Unison File Synchronizer\n\
-      Version 2.53.4\n\
+      Version 2.53.5\n\
       \n\
       "))
 ::
@@ -1919,7 +1919,7 @@
       \032         watch, Unison relies on an external file monitoring process 
to\n\
       \032         synchronize whenever a change happens. You can combine the 
two\n\
       \032         with a + character to use file monitoring and also do a 
full\n\
-      \032         scan every specificed number of seconds. For example, 
watch+3600\n\
+      \032         scan every specified number of seconds. For example, 
watch+3600\n\
       \032         will react to changes immediately and additionally do a 
full\n\
       \032         scan every hour.\n\
       \n\
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unison-2.53.4/src/terminal.ml 
new/unison-2.53.5/src/terminal.ml
--- old/unison-2.53.4/src/terminal.ml   2024-02-18 16:03:04.000000000 +0100
+++ new/unison-2.53.5/src/terminal.ml   2024-05-02 01:10:39.000000000 +0200
@@ -336,7 +336,7 @@
         begin
           match ch with
           | '\024' | '\026' -> state No (* CAN, SUB *)
-          | '\000'..'\025' -> add_char ch (* Control charaters (roughly) *)
+          | '\000'..'\025' -> add_char ch (* Control characters (roughly) *)
           | '\027' -> state Escape
           | '\048'..'\126' -> state No (* Final *)
           | '\127'..'\255' -> state No (* Invalid *)
@@ -346,7 +346,7 @@
         begin
           match ch with
           | '\024' | '\026' -> state No (* CAN, SUB *)
-          | '\000'..'\025' -> add_char ch (* Control charaters (roughly) *)
+          | '\000'..'\025' -> add_char ch (* Control characters (roughly) *)
           | '\027' -> state Escape
           | '\064'..'\126' -> (* Final *)
               begin
@@ -367,7 +367,7 @@
           match ch with
           | '\024' | '\026' -> state No (* CAN, SUB *)
           | '\007' -> state No (* BEL *)
-          | '\000'..'\025' -> add_char ch (* Control charaters (roughly) *)
+          | '\000'..'\025' -> add_char ch (* Control characters (roughly) *)
           | '\027' -> state OSCEsc
           | _ -> ()
         end
@@ -381,7 +381,7 @@
         begin
           match ch with
           | '\024' | '\026' -> state No (* CAN, SUB *)
-          | '\000'..'\025' -> add_char ch (* Control charaters (roughly) *)
+          | '\000'..'\025' -> add_char ch (* Control characters (roughly) *)
           | '\027' -> state StringEsc
           | _ -> ()
         end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unison-2.53.4/src/transport.ml 
new/unison-2.53.5/src/transport.ml
--- old/unison-2.53.4/src/transport.ml  2024-02-18 16:03:04.000000000 +0100
+++ new/unison-2.53.5/src/transport.ml  2024-05-02 01:10:39.000000000 +0200
@@ -55,23 +55,24 @@
 
 let run dispenseTask =
   let runConcurrent limit dispenseTask =
-    let dispenseTask () = if Abort.isAll () then None else dispenseTask () in
     let avail = ref limit in
     let rec runTask thr =
       Lwt.try_bind thr
-        (fun () -> nextTask (); Lwt.return ())
-        (fun _ -> nextTask (); assert false)
+        (fun () -> nextTask ())
+        (fun _ -> assert false)
         (* It is a programming error for an exception to reach this far. *)
-      |> ignore
     and nextTask () =
        match dispenseTask () with
-       | None -> incr avail
+       | None -> Lwt.return (incr avail)
        | Some thr -> runTask thr
     in
     let rec fillPool () =
       match dispenseTask () with
       | None -> ()
-      | Some thr -> decr avail; runTask thr; if !avail > 0 then fillPool ()
+      | Some thr ->
+          decr avail;
+          let _ : unit Lwt.t = runTask thr in
+          if !avail > 0 then fillPool ()
     in
     fillPool ()
   in
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unison-2.53.4/src/uicommon.ml 
new/unison-2.53.5/src/uicommon.ml
--- old/unison-2.53.4/src/uicommon.ml   2024-02-18 16:03:04.000000000 +0100
+++ new/unison-2.53.5/src/uicommon.ml   2024-05-02 01:10:39.000000000 +0200
@@ -136,7 +136,7 @@
      ^ "beginning again. When the argument is \\verb|watch|, Unison relies on "
      ^ "an external file monitoring process to synchronize whenever a change "
      ^ "happens.  You can combine the two with a \\verb|+| character to use "
-     ^ "file monitoring and also do a full scan every specificed number of "
+     ^ "file monitoring and also do a full scan every specified number of "
      ^ "seconds.  For example, \\verb|watch+3600| will react to changes "
      ^ "immediately and additionally do a full scan every hour.")
     (fun _ -> parseRepeat)
@@ -226,7 +226,7 @@
       "absent"
   | _, `Unchanged ->
       "unchanged "
-     ^(Util.truncateString (Fileinfo.type2string rc.typ) 7)
+     ^(Util.padto 7 (Util.truncateString (Fileinfo.type2string rc.typ) 7))
      ^ sep
      ^ replicaContentDesc rc
   | `ABSENT, `Deleted -> "deleted"
@@ -353,10 +353,10 @@
 let exn2string e =
   match e with
      Sys.Break      -> "Terminated!"
-   | Util.Fatal(s)  -> Printf.sprintf "Fatal error: %s" s
-   | Util.Transient(s) -> Printf.sprintf "Error: %s" s
+   | Util.Fatal s   -> s
+   | Util.Transient s -> s
    | Unix.Unix_error (err, fun_name, arg) ->
-       Printf.sprintf "Uncaught unix error: %s failed%s: %s%s\n%s"
+       Printf.sprintf "Uncaught unix error (please report a bug): %s failed%s: 
%s%s\n%s"
          fun_name
          (if String.length arg > 0 then Format.sprintf " on \"%s\"" arg else 
"")
          (Unix.error_message err)
@@ -364,9 +364,14 @@
             Unix.EUNKNOWNERR n -> Format.sprintf " (code %d)" n
           | _                  -> "")
          (Printexc.get_backtrace ())
+   | Stack_overflow ->
+       "Stack overflow. This could indicate a programming error.\n\n\
+         Technical information in case you need to report a bug:\n"
+       ^ (Printexc.get_backtrace ())
    | Invalid_argument s ->
-       Printf.sprintf "Invalid argument: %s\n%s" s (Printexc.get_backtrace ())
-   | other -> Printf.sprintf "Uncaught exception %s\n%s"
+       Printf.sprintf "Invalid argument (please report a bug): %s\n%s"
+         s (Printexc.get_backtrace ())
+   | other -> Printf.sprintf "Uncaught exception (please report a bug): %s\n%s"
        (Printexc.to_string other) (Printexc.get_backtrace ())
 
 (* precondition: uc = File (Updates(_, ..) on both sides *)
@@ -649,12 +654,15 @@
 let transportFinish () = Transport.logFinish ()
 
 let transportItems items pRiThisRound makeAction =
+  if Abort.isAll () then () else
   let waiter = Lwt.wait () in
   let outstanding = ref 0 in
   let starting () = incr outstanding in
   let completed () =
     decr outstanding;
-    if !outstanding = 0 then begin
+    if !outstanding = 0 || (!outstanding = 1 && Abort.isAll ()) then begin
+      (* If there is a stop request then we might not get the [completed]
+         notice for the dispense loop itself, so we also stop at count 1. *)
       try Lwt.wakeup waiter () with Invalid_argument _ -> ()
     end
   in
@@ -682,7 +690,10 @@
   in
   let rec dispenseAction () =
     let i = !idx in
-    if i < im then begin
+    if Abort.isAll () then begin
+      stopDispense ();
+      dispenseDone ()
+    end else if i < im then begin
       let item = items.(i) in
       incr idx;
       if pRiThisRound item then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unison-2.53.4/src/uigtk3.ml 
new/unison-2.53.5/src/uigtk3.ml
--- old/unison-2.53.4/src/uigtk3.ml     2024-02-18 16:03:04.000000000 +0100
+++ new/unison-2.53.5/src/uigtk3.ml     2024-05-02 01:10:39.000000000 +0200
@@ -299,7 +299,7 @@
    chosen, false if the second button is chosen. *)
 let twoBox ?(kind=`DIALOG_WARNING) ~parent ~title ~astock ~bstock message =
   let t =
-    GWindow.dialog ~parent ~border_width:6 ~modal:true
+    GWindow.dialog ~parent ~title ~border_width:6 ~modal:true
       ~resizable:false () in
   t#vbox#set_spacing 12;
   let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in
@@ -345,7 +345,7 @@
   if Prefs.read Globals.batch then begin
     (* In batch mode, just pop up a window and go ahead *)
     let t =
-      GWindow.dialog ~parent
+      GWindow.dialog ~parent ~title
         ~border_width:6 ~modal:true ~resizable:false () in
     t#vbox#set_spacing 12;
     let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in
@@ -678,26 +678,28 @@
 
 (* ------ *)
 
+let globalGTKInited = ref false
+
 let gui_safe_eprintf fmt =
   Printf.ksprintf (fun s ->
     if System.has_stderr ~info:s then Printf.eprintf "%s%!" s) fmt
 
 let fatalError ?(quit=false) message =
+  let title = if quit then "Fatal error" else "Error" in
   let () =
     Trace.sendLogMsgsToStderr := false; (* We don't know if stderr is 
available *)
-    try Trace.log (message ^ "\n")
+    try Trace.log (title ^ ": " ^ message ^ "\n")
     with Util.Fatal _ -> () in (* Can't allow fatal errors in fatal error 
handler *)
-  let title = "Fatal error" in
   let toplevelWindow =
-    try toplevelWindow ()
+    try Some (toplevelWindow ())
     with Util.Fatal err ->
       begin
         gui_safe_eprintf "\n%s:\n%s\n\n%s\n\n" title err message;
-        exit 1
+        if not !globalGTKInited then exit 1 else None
       end
   in
   let t =
-    GWindow.dialog ~parent:toplevelWindow
+    GWindow.dialog ?parent:toplevelWindow ~title
       ~border_width:6 ~modal:true ~resizable:false () in
   t#vbox#set_spacing 12;
   let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in
@@ -718,6 +720,13 @@
 
 let fatalErrorHandler = ref (fatalError ~quit:true)
 
+let stackOverflowNoQuitMsg () =
+  "Stack overflow. This could indicate a programming error.\n\
+    You should be able to continue without having to quit \
+    the application but the error may repeat.\n\n\
+    Technical information in case you need to report a bug:\n"
+  ^ (Printexc.get_backtrace ())
+
 (* ------ *)
 
 let getFirstRoot () =
@@ -1648,9 +1657,9 @@
       if React.state fat then Printf.fprintf ch "fat = true\n";
       close_out ch);
       profileName := Some (React.state name)
-    with Sys_error _ as e ->
+    with Sys_error errmsg ->
       okBox ~parent:assistant ~typ:`ERROR ~title:"Could not save profile"
-        ~message:(Uicommon.exn2string e)
+        ~message:("Error when saving profile: " ^ errmsg)
     end;
     assistant#destroy ();
   in
@@ -2391,9 +2400,9 @@
              false);
         close_out ch);
         setModified false
-      with Sys_error _ as e ->
+      with Sys_error errmsg ->
         okBox ~parent:t ~typ:`ERROR ~title:"Could not save profile"
-          ~message:(Uicommon.exn2string e)
+          ~message:("Error when saving profile: " ^ errmsg)
     end
   in
   let applyButton =
@@ -2887,6 +2896,10 @@
          the user's.gtkrc, not programmatically *)
       ~orientation:`HORIZONTAL (* ~space_size:10 *)
       ~packing:(toplevelVBox#pack ~expand:false) () in
+  (* [show_arrow] is initially false to produce a better default width. *)
+  actionBar#set_show_arrow false;
+  ignore (toplevelWindow#misc#connect#show
+    ~callback:(fun () -> actionBar#set_show_arrow true));
 
   (*********************************************************************
     Create the main window
@@ -4454,6 +4467,7 @@
 
     (* Initialize the GTK library *)
     ignore (GMain.Main.init ());
+    globalGTKInited := true;
 
     Util.warnPrinter :=
       Some (fun msg -> warnBox ~parent:(toplevelWindow ()) "Warning" msg);
@@ -4461,6 +4475,7 @@
     GtkSignal.user_handler :=
       (function
        | Util.Transient s | Util.Fatal s -> !fatalErrorHandler s
+       | Stack_overflow -> !fatalErrorHandler (stackOverflowNoQuitMsg ());
        | exn -> !fatalErrorHandler (Uicommon.exn2string exn));
 
     (* Ask the Remote module to call us back at regular intervals during
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unison-2.53.4/src/uitext.ml 
new/unison-2.53.5/src/uitext.ml
--- old/unison-2.53.4/src/uitext.ml     2024-02-18 16:03:04.000000000 +0100
+++ new/unison-2.53.5/src/uitext.ml     2024-05-02 01:10:39.000000000 +0200
@@ -782,6 +782,9 @@
       true
   end
 
+let intrcount = ref 0
+let intrRequested () = !intrcount <> 0
+
 type stateItem =
   { mutable ri : reconItem;
     mutable bytesTransferred : Uutil.Filesize.t;
@@ -862,7 +865,6 @@
   in
   Uutil.setProgressPrinter showProgress;
 
-  let intrcount = ref 0 in
   let sigtermHandler _ =
     if !intrcount >= 3 then raise Sys.Break;
     Abort.all ();
@@ -1585,7 +1587,10 @@
   alwaysDisplay "\n";
   Util.set_infos "";
   restoreTerminal();
-  let msg = Uicommon.exn2string e in
+  let lbl =
+    if e = Sys.Break then ""
+    else "Error: " in
+  let msg = lbl ^ Uicommon.exn2string e in
   let () =
     try Trace.log (msg ^ "\n")
     with Util.Fatal _ -> () in (* Can't allow fatal errors in fatal error 
handler *)
@@ -1621,13 +1626,37 @@
     exit Uicommon.fatalExit
   end;
 
-  (* Uncaught exceptions up to this point are non-recoverable, treated
-     as permanent and will inevitably exit the process. Uncaught exceptions
-     from here onwards are treated as potentially temporary or recoverable.
-     The process does not have to exit if in repeat mode and can try again. *)
-  begin try
-    if Prefs.read silent then Prefs.set Trace.terse true;
+  (* Some preference settings imply others... *)
+  if Prefs.read silent then begin
+    Prefs.set Globals.batch true;
+    Prefs.set Trace.terse true;
+    Prefs.set dumbtty true;
+    Trace.sendLogMsgsToStderr := false;
+  end;
+  if Prefs.read Uicommon.repeat <> `NoRepeat then begin
+    Prefs.set Globals.batch true;
+  end;
+  setColorPreference ();
+  Trace.statusFormatter := formatStatus;
 
+  start2 ()
+
+(* Uncaught exceptions up to this point are non-recoverable, treated
+   as permanent and will inevitably exit the process. Uncaught exceptions
+   from here onwards are treated as potentially temporary or recoverable.
+   The process does not have to exit if in repeat mode and can try again. *)
+and start2 () =
+  let noRepeat =
+    true || (* Disabled by default until a better retry strategy is devised *)
+    Prefs.read Uicommon.repeat = `NoRepeat
+      || Prefs.read Uicommon.runtests
+      || Prefs.read Uicommon.testServer
+  in
+  let terminate () =
+    handleException Sys.Break;
+    exit Uicommon.fatalExit
+  in
+  begin try
     Uicommon.connectRoots ~displayWaitMessage ();
 
     if Prefs.read Uicommon.testServer then exit 0;
@@ -1638,39 +1667,21 @@
       exit 0
     end;
 
-    (* Some preference settings imply others... *)
-    if Prefs.read silent then begin
-      Prefs.set Globals.batch true;
-      Prefs.set Trace.terse true;
-      Prefs.set dumbtty true;
-      Trace.sendLogMsgsToStderr := false;
-    end;
-    if Prefs.read Uicommon.repeat <> `NoRepeat then begin
-      Prefs.set Globals.batch true;
-    end;
-    setColorPreference ();
-
     (* Tell OCaml that we want to catch Control-C ourselves, so that
        we get a chance to reset the terminal before exiting *)
     Sys.catch_break true;
     (* Put the terminal in cbreak mode if possible *)
     if not (Prefs.read Globals.batch) then setupTerminal();
     setWarnPrinter();
-    Trace.statusFormatter := formatStatus;
 
     let exitStatus = synchronizeUntilDone() in
 
     (* Put the terminal back in "sane" mode, if necessary, and quit. *)
     restoreTerminal();
     exit exitStatus
-
   with
-    Sys.Break -> begin
-      (* If we've been killed, then die *)
-      handleException Sys.Break;
-      exit Uicommon.fatalExit
-    end
-  | e when breakRepeat e -> begin
+  | Sys.Break -> terminate ()
+  | e when noRepeat || breakRepeat e || intrRequested () -> begin
       handleException e;
       exit Uicommon.fatalExit
     end
@@ -1678,13 +1689,10 @@
       (* If any other bad thing happened and the -repeat preference is
          set, then restart *)
       handleException e;
-      if Prefs.read Uicommon.repeat = `NoRepeat
-          || Prefs.read Uicommon.runtests then
-        exit Uicommon.fatalExit;
 
       Util.msg "\nRestarting in 10 seconds...\n\n";
-      begin try interruptibleSleep 10 with Sys.Break -> exit 
Uicommon.fatalExit end;
-      if safeStopRequested () then exit Uicommon.fatalExit else start interface
+      begin try interruptibleSleep 10 with Sys.Break -> terminate () end;
+      if safeStopRequested () then terminate () else start2 ()
     end
   end
 

Reply via email to