diff options
author | olgeni <olgeni@FreeBSD.org> | 2004-12-30 22:34:09 +0000 |
---|---|---|
committer | olgeni <olgeni@FreeBSD.org> | 2004-12-30 22:34:09 +0000 |
commit | e9a34b56c9e778b011b948c572cbdc7cb6f780b5 (patch) | |
tree | 373f98c11a6dfe2e2315806374aeeb53df533417 /lang/erlang14 | |
parent | 81043a59735322479671bd238e80035cae780395 (diff) | |
download | FreeBSD-ports-e9a34b56c9e778b011b948c572cbdc7cb6f780b5.zip FreeBSD-ports-e9a34b56c9e778b011b948c572cbdc7cb6f780b5.tar.gz |
Fix issue with rb:show/1 (could not be called twice).
Obtained from: Peter Andersson <peppe (at) erix.ericsson.se>
Diffstat (limited to 'lang/erlang14')
-rw-r--r-- | lang/erlang14/Makefile | 1 | ||||
-rw-r--r-- | lang/erlang14/files/patch-lib_sasl_src_rb.erl | 65 |
2 files changed, 66 insertions, 0 deletions
diff --git a/lang/erlang14/Makefile b/lang/erlang14/Makefile index 156b2f4..2098042 100644 --- a/lang/erlang14/Makefile +++ b/lang/erlang14/Makefile @@ -7,6 +7,7 @@ PORTNAME= erlang PORTVERSION= r10b2 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= lang parallel MASTER_SITES= http://www.erlang.org/download/ \ diff --git a/lang/erlang14/files/patch-lib_sasl_src_rb.erl b/lang/erlang14/files/patch-lib_sasl_src_rb.erl new file mode 100644 index 0000000..6fae0f4 --- /dev/null +++ b/lang/erlang14/files/patch-lib_sasl_src_rb.erl @@ -0,0 +1,65 @@ + +$FreeBSD$ + +--- lib/sasl/src/rb.erl.orig ++++ lib/sasl/src/rb.erl +@@ -177,7 +177,7 @@ + {reply, ok, State#state{device = standard_io}}; + handle_call({show_number, Number}, _From, State) -> + #state{dir = Dir, data = Data, device = Device, abort = Abort, log = Log} = State, +- NewDevice = print_report(Dir, Data, Number, Device, Abort, Log), ++ NewDevice = print_report_by_num(Dir, Data, Number, Device, Abort, Log), + {reply, ok, State#state{device = NewDevice}}; + handle_call({show_type, Type}, _From, State) -> + #state{dir = Dir, data = Data, device = Device, abort = Abort, log = Log} = State, +@@ -541,6 +541,10 @@ + io_lib:format("~s", [ShortDescr]), + Date]). + ++print_report_by_num(Dir, Data, Number, Device, Abort, Log) -> ++ {_,Device1} = print_report(Dir, Data, Number, Device, Abort, Log), ++ Device1. ++ + print_typed_reports(_Dir, [], _Type, Device, _Abort, _Log) -> + Device; + print_typed_reports(Dir, Data, Type, Device, Abort, Log) -> +@@ -569,23 +573,29 @@ + end. + + print_report(Dir, Data, Number, Device, Abort, Log) -> +- {Fname, FilePosition} = find_report(Data, Number), +- FileName = lists:concat([Dir, Fname]), +- case file:open(FileName, read) of +- {ok, Fd} -> +- read_rep(Fd, FilePosition, Device, Abort, Log); +- _ -> +- io:format("rb: can't open file ~p~n", [Fname]), ++ case find_report(Data, Number) of ++ {Fname, FilePosition} -> ++ FileName = lists:concat([Dir, Fname]), ++ case file:open(FileName, read) of ++ {ok, Fd} -> ++ read_rep(Fd, FilePosition, Device, Abort, Log); ++ _ -> ++ io:format("rb: can't open file ~p~n", [Fname]), ++ {proceed,Device} ++ end; ++ no_report -> + {proceed,Device} + end. + + find_report([{No, _Type, _Descr, _Date, Fname, FilePosition}|_T], No) -> + {Fname, FilePosition}; +-find_report([_H|T], No) -> find_report(T, No); ++find_report([_H|T], No) -> ++ find_report(T, No); + find_report([], No) -> +- io:format("There is no report with number ~p.~n", [No]). ++ io:format("There is no report with number ~p.~n", [No]), ++ no_report. + +-print_grep_reports(_Dir, [], _RegExp, Device, Abort, Log) -> ++print_grep_reports(_Dir, [], _RegExp, Device, _Abort, _Log) -> + Device; + print_grep_reports(Dir, Data, RegExp, Device, Abort, Log) -> + {Next,Device1} = print_grep_report(Dir, Data, element(1, hd(Data)), |