rpms/monotone-viz/devel monotone-viz-1.0.2-mtn-0.46.patch, NONE, 1.1 import.log, 1.2, 1.3 monotone-viz.spec, 1.7, 1.8
Thomas Moschny
thm at fedoraproject.org
Sat Jan 30 09:18:54 UTC 2010
Author: thm
Update of /cvs/pkgs/rpms/monotone-viz/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25135/devel
Modified Files:
import.log monotone-viz.spec
Added Files:
monotone-viz-1.0.2-mtn-0.46.patch
Log Message:
Add patch from Stéphane Gimenez for monotone >= 0.46.
monotone-viz-1.0.2-mtn-0.46.patch:
automate.ml | 50 +++++++++++++++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 19 deletions(-)
--- NEW FILE monotone-viz-1.0.2-mtn-0.46.patch ---
diff --git a/automate.ml b/automate.ml
index b2b70a2..db701a2 100644
--- a/automate.ml
+++ b/automate.ml
@@ -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 ;
@@ -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 truncate_buffer b off len =
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 head = String.create 4096 in
+ while not (String.contains head '\n') do
+ match Giochannel.read_chars p.p_out.out_w.w_chan head with
+ | `NORMAL 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 -> ()
+ done;
+ let accept =
+ String.length head > 18 && String.sub head 0 18 = "format-version: 2\n"
+ in
+ if not accept 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: import.log
===================================================================
RCS file: /cvs/pkgs/rpms/monotone-viz/devel/import.log,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- import.log 21 Jan 2010 08:21:49 -0000 1.2
+++ import.log 30 Jan 2010 09:18:54 -0000 1.3
@@ -1,2 +1,3 @@
monotone-viz-1_0_1-4_fc10:HEAD:monotone-viz-1.0.1-4.fc10.src.rpm:1235692446
monotone-viz-1_0_2-1_fc12:HEAD:monotone-viz-1.0.2-1.fc12.src.rpm:1264062047
+monotone-viz-1_0_2-2_fc12:HEAD:monotone-viz-1.0.2-2.fc12.src.rpm:1264842977
Index: monotone-viz.spec
===================================================================
RCS file: /cvs/pkgs/rpms/monotone-viz/devel/monotone-viz.spec,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- monotone-viz.spec 21 Jan 2010 08:21:50 -0000 1.7
+++ monotone-viz.spec 30 Jan 2010 09:18:54 -0000 1.8
@@ -1,12 +1,13 @@
Name: monotone-viz
Version: 1.0.2
-Release: 1%{?dist}
+Release: 2%{?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.2-mtn-0.46.patch
BuildRequires: ocaml
BuildRequires: ocaml-camlp4-devel
BuildRequires: ocaml-lablgtk-devel
@@ -14,7 +15,7 @@ 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
@@ -29,6 +30,7 @@ This is a small GNOME application to vis
%prep
%setup0 -q
+%patch0 -p1 -b .mtn-0.46
%build
@@ -64,6 +66,9 @@ rm -rf %{buildroot}
%changelog
+* 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.
More information about the scm-commits
mailing list