rpms/monotone-viz/EL-6 monotone-viz-1.0.2-dot.patch, NONE, 1.1 monotone-viz-1.0.2-new-stdio.patch, NONE, 1.1 .cvsignore, 1.2, 1.3 import.log, 1.1, 1.2 monotone-viz.spec, 1.6, 1.7 sources, 1.2, 1.3 monotone-viz-1.0.1-gio.patch, 1.1, NONE

Thomas Moschny thm at fedoraproject.org
Thu Jul 8 05:52:17 UTC 2010


Author: thm

Update of /cvs/pkgs/rpms/monotone-viz/EL-6
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv12744/EL-6

Modified Files:
	.cvsignore import.log monotone-viz.spec sources 
Added Files:
	monotone-viz-1.0.2-dot.patch 
	monotone-viz-1.0.2-new-stdio.patch 
Removed Files:
	monotone-viz-1.0.1-gio.patch 
Log Message:
- Update to 1.0.2.
  - Patch to avoid name clash with ocaml-lablgtk is no longer necessary.
  - Add patch to support monotone-0.46 and later.
  - Add patch to workaround broken dot "-y" option.
- Minor specfile cleanups.


monotone-viz-1.0.2-dot.patch:
 agraph.ml |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

--- NEW FILE monotone-viz-1.0.2-dot.patch ---
#
#
# patch "agraph.ml"
#  from [8ae6c9bb70bbf9fd80e4e62d9f162ac581619b9e]
#    to [05aa88921481ac9bfe238daeb4374fbc9993caaa]
#
============================================================
--- agraph.ml	8ae6c9bb70bbf9fd80e4e62d9f162ac581619b9e
+++ agraph.ml	05aa88921481ac9bfe238daeb4374fbc9993caaa
@@ -50,8 +50,9 @@ let dot_format params agraph =
       agraph.nodes in
 
   !+ "digraph \"monotone-viz\"\n{\n" ;
-  if params.lr_layout then
-    !+ "  graph [rankdir=LR] ;\n" ;
+  if params.lr_layout
+  then  !+ "  graph [rankdir=LR] ;\n"
+  else  !+ "  graph [rankdir=BT] ;\n" ;
   !+ "  graph [ranksep=\"0.25\"] ;\n" ;
   !+ "  node [label=\"\"] ;\n" ;
   
@@ -222,11 +223,11 @@ let spawn_dot graph status done_cb =
   let dot_prg = graph.layout_params.dot_program in
   let cmd = 
     if Viz_misc.debug "dot"
-    then [ "/bin/sh" ; "-c" ; 
+    then [ "/bin/bash" ; "-c" ; 
 	   Printf.sprintf 
 	     "set -o pipefail ; \
-              tee agraph.in.dot | %s -q -y -s%.0f | tee agraph.out.dot" dot_prg ppi ]
-    else [ dot_prg ; "-q" ; "-y" ; Printf.sprintf "-s%.0f" ppi ] in
+              tee agraph.in.dot | %s -q -s%.0f | tee agraph.out.dot" dot_prg ppi ]
+    else [ dot_prg ; "-q" ; Printf.sprintf "-s%.0f" ppi ] in
   let error fmt =
     Printf.kprintf (fun s -> done_cb (`LAYOUT_ERROR s)) fmt in
   try

monotone-viz-1.0.2-new-stdio.patch:
 automate.ml |   52 ++++++++++++++++++++++++++++++++--------------------
 1 file changed, 32 insertions(+), 20 deletions(-)

--- NEW FILE monotone-viz-1.0.2-new-stdio.patch ---
#
#
# patch "automate.ml"
#  from [bc697ff6c3768259b1838e5638552f448433b53a]
#    to [81cd3139b4ac5a13091737bf47b0c2e1b62eea62]
#
============================================================
--- automate.ml	bc697ff6c3768259b1838e5638552f448433b53a
+++ automate.ml	81cd3139b4ac5a13091737bf47b0c2e1b62eea62
@@ -44,7 +44,7 @@ type output = [
   | `OUTPUT       of string
   | `ERROR        of string
   | `SYNTAX_ERROR of string]
-type chunk = command_id * int * bool * string
+type chunk = command_id * bool * string
 type process = {
     p_in  :  in_watch ;
     p_out : out_watch ;
@@ -152,7 +152,7 @@ let _read_cb w conditions =
     try 
       match Giochannel.read_chars w.out_w.w_chan w.out_sb with
       | `NORMAL read ->
-	  if debug then log "%s cb: read %d" w.out_w.w_name read ;
+	  if debug then log "%s cb: read %d" w.out_w.w_name read;
 	  Buffer.add_substring w.out_buffer w.out_sb 0 read ;
 	  w.out_cb w.out_buffer
       | `EOF ->
@@ -258,8 +258,8 @@ let encode_stdio cmd =
 
 
 
-let find_four_colon b =
-  let to_find = ref 4 in
+let find_three_colon b =
+  let to_find = ref 3 in
   let i = ref 0 in
   while !to_find > 0 do
     let c = Buffer.nth b !i in
@@ -277,22 +277,20 @@ let decode_stdio_chunk b =
 
 let decode_stdio_chunk b =
   try
-    let header_len = find_four_colon b in
+    let header_len = find_three_colon b in
     let h = Buffer.sub b 0 header_len in
     let c1 = String.index_from h 0 ':' in
     let number = int_of_string (string_slice ~e:c1 h) in
-    let code   = int_of_char h.[c1 + 1] - int_of_char '0' in
     let c2 = String.index_from h (c1 + 1) ':' in
-    let last   = h.[c2 + 1] in
+    let last   = h.[c1 + 1] in
     let c3 = String.index_from h (c2 + 1) ':' in
-    let c4 = String.index_from h (c3 + 1) ':' in
-    let len   = int_of_string (string_slice ~s:(c3 + 1) ~e:c4 h) in
+    let len   = int_of_string (string_slice ~s:(c2 + 1) ~e:c3 h) in
     if Buffer.length b < header_len + len
     then
       `INCOMPLETE
     else
       let data = truncate_buffer b header_len len in
-      `CHUNK (number, code, last = 'l', data)
+      `CHUNK (number, last = 'l', data)
   with Invalid_argument _ ->
     `INCOMPLETE
 
@@ -305,11 +303,11 @@ let rec out_cb p b =
   | `INCOMPLETE ->
       ()
 
-  | `CHUNK (nb, _, _, _) when aborted_cmd p nb ->
+  | `CHUNK (nb, _, _) when aborted_cmd p nb ->
       p.chunks <- List.remove_assoc nb p.chunks ;
       out_cb p b
 
-  | `CHUNK ((nb, code, false, data) as chunk) ->
+  | `CHUNK ((nb, false, data) as chunk) ->
       if debug then log "decoded a chunk" ;
       let previous_chunks =
 	try List.assoc nb p.chunks
@@ -320,7 +318,7 @@ let rec out_cb p b =
       previous_chunks := chunk :: !previous_chunks ;
       out_cb p b
 
-  | `CHUNK ((nb, code, true, data) as chunk) ->
+  | `CHUNK ((nb, true, data) as chunk) ->
       if debug then log "decoded last chunk" ;
       let chunks =
 	try 
@@ -333,14 +331,14 @@ let rec out_cb p b =
       p.callbacks <- List.remove_assoc nb p.callbacks ;
       let msg = 
 	String.concat ""
-	  (List.map (fun (_, _, _, d) -> d) chunks) in
-      let data =
-	match code with
-	| 0 -> `OUTPUT msg
-	| 1 -> `SYNTAX_ERROR msg
-	| 2 -> `ERROR msg
+	  (List.map (function (_, false, d) -> d | (_, true, d) -> "") chunks) in
+      let code =
+	match data with
+	| "0" -> `OUTPUT msg
+	| "1" -> `SYNTAX_ERROR msg
+	| "2" -> `ERROR msg
 	| _ -> failwith "invalid_code in automate stdio output" in
-      ignore (Glib.Idle.add ~prio:0 (fun () -> cb data ; false)) ;
+      ignore (Glib.Idle.add ~prio:0 (fun () -> cb code ; false)) ;
       out_cb p b
 
 
@@ -409,6 +407,20 @@ let spawn mtn db = 
       chunks = [] ;
       exit_cb = (fun _ -> assert false)
     } in
+  let rec check_version buf =
+    if String.contains buf '\n' then
+      String.length buf >= 18 && String.sub buf 0 18 = "format-version: 2\n"
+    else
+      match Giochannel.read_chars p.p_out.out_w.w_chan p.p_out.out_sb  with
+      | `NORMAL read -> check_version (buf ^ String.sub p.p_out.out_sb 0 read)
+      | `EOF ->
+	  Giochannel.shutdown p.p_out.out_w.w_chan false;
+	  Giochannel.shutdown p.p_err.out_w.w_chan false;
+	  failwith "mtn version 0.46 or above is required";
+      | `AGAIN -> check_version buf
+  in
+  if not (check_version "")
+  then failwith "mtn stdio uses an unknown format-version";
   let pid = some child.Gspawn.pid in
   ignore (Gspawn.add_child_watch ~prio:50 pid (reap_cb p pid)) ;
   p.p_out.out_cb <- out_cb p ;


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/monotone-viz/EL-6/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- .cvsignore	23 Jan 2008 20:34:09 -0000	1.2
+++ .cvsignore	8 Jul 2010 05:52:16 -0000	1.3
@@ -1 +1 @@
-monotone-viz-1.0.1-nolablgtk.tar.gz
+monotone-viz-1.0.2-nolablgtk.tar.gz


Index: import.log
===================================================================
RCS file: /cvs/pkgs/rpms/monotone-viz/EL-6/import.log,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- import.log	26 Feb 2009 23:54:49 -0000	1.1
+++ import.log	8 Jul 2010 05:52:16 -0000	1.2
@@ -1 +1,2 @@
 monotone-viz-1_0_1-4_fc10:HEAD:monotone-viz-1.0.1-4.fc10.src.rpm:1235692446
+monotone-viz-1_0_2-3_fc13:EL-6:monotone-viz-1.0.2-3.fc13.src.rpm:1278568011


Index: monotone-viz.spec
===================================================================
RCS file: /cvs/pkgs/rpms/monotone-viz/EL-6/monotone-viz.spec,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- monotone-viz.spec	25 Jul 2009 15:04:37 -0000	1.6
+++ monotone-viz.spec	8 Jul 2010 05:52:17 -0000	1.7
@@ -1,16 +1,14 @@
 Name:           monotone-viz
-Version:        1.0.1
-Release:        5%{?dist}
-
+Version:        1.0.2
+Release:        3%{?dist}
 Summary:        GNOME application that visualizes Monotone ancestry graphs
 Group:          Development/Tools
 License:        GPLv2+
-
 URL:            http://oandrieu.nerim.net/monotone-viz/
 Source0:        %{url}/%{name}-%{version}-nolablgtk.tar.gz
 Source1:        monotone-viz.desktop
-Patch0:         monotone-viz-1.0.1-gio.patch
-
+Patch0:         monotone-viz-1.0.2-new-stdio.patch
+Patch1:         monotone-viz-1.0.2-dot.patch
 BuildRequires:  ocaml
 BuildRequires:  ocaml-camlp4-devel
 BuildRequires:  ocaml-lablgtk-devel
@@ -18,22 +16,24 @@ BuildRequires:  gtk2-devel
 BuildRequires:  libgnomecanvas-devel
 BuildRequires:  desktop-file-utils
 BuildRequires:  ImageMagick
-Requires:       monotone
+Requires:       monotone >= 0.46
 Requires:       graphviz
-
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 ExcludeArch:    sparc64 s390 s390x
 
 # Apparently necessary exclusion for ocaml packages.
 ExcludeArch:    ppc64
 
+
 %description
 This is a small GNOME application to visualize Monotone ancestry graphs.
 
 
 %prep
 %setup0 -q
-%patch0 -p1 -b .gio
+%patch0 -p0 -b .new-stdio
+%patch1 -p0 -b .dot
+
 
 %build
 %configure --without-local-lablgtk
@@ -41,21 +41,22 @@ make %{?_smp_mflags}
 
 convert icon.ml %{name}.png
 
-%{__cp} -f %{SOURCE1} %{name}.desktop
+%{__cp} -a %{SOURCE1} %{name}.desktop
+
 
 %install
-rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
+rm -rf %{buildroot}
+make install DESTDIR=%{buildroot}
 
 %{__install} -m 644 -D -p %{name}.png \
-             $RPM_BUILD_ROOT/%{_datadir}/pixmaps/%{name}.png
-desktop-file-install --dir $RPM_BUILD_ROOT/%{_datadir}/applications \
+             %{buildroot}%{_datadir}/pixmaps/%{name}.png
+desktop-file-install --dir %{buildroot}%{_datadir}/applications \
                      --vendor="" \
                      %{name}.desktop
 
 
 %clean
-rm -rf $RPM_BUILD_ROOT
+rm -rf %{buildroot}
 
 
 %files
@@ -67,6 +68,18 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Tue Jul  6 2010 Thomas Moschny <thomas.moschny at gmx.de> - 1.0.2-3
+- Update patch to better support monotone-0.46 and later.
+- Add patch to workaround broken dot "-y" option.
+
+* Fri Jan 29 2010 Thomas Moschny <thomas.moschny at gmx.de> - 1.0.2-2
+- Add patch from Stéphane Gimenez for monotone >= 0.46.
+
+* Thu Jan 21 2010 Thomas Moschny <thomas.moschny at gmx.de> - 1.0.2-1
+- Update to 1.0.2.
+- Patch to avoid name clash with ocaml-lablgtk is no longer necessary.
+- Minor specfile cleanups.
+
 * Sat Jul 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.0.1-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/monotone-viz/EL-6/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- sources	23 Jan 2008 20:34:09 -0000	1.2
+++ sources	8 Jul 2010 05:52:17 -0000	1.3
@@ -1 +1 @@
-b6996c0360f0b897ee73c9f881763571  monotone-viz-1.0.1-nolablgtk.tar.gz
+fd08341b456c80d03d7d21c989a1e813  monotone-viz-1.0.2-nolablgtk.tar.gz


--- monotone-viz-1.0.1-gio.patch DELETED ---



More information about the scm-commits mailing list