Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:19
rpm-build-erlang
erlang_app_req.erl
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File erlang_app_req.erl of Package rpm-build-erlang
%% Copyright (C) 2008, 2016 Led <ledest@gmail.com> %% %% This program is free software; you can redistribute it and/or modify %% it under the terms of the GNU General Public License as published by %% the Free Software Foundation; either version 3 of the License, or %% (at your option) any later version. %% %% This program is distributed in the hope that it will be useful, %% but WITHOUT ANY WARRANTY; without even the implied warranty of %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %% GNU General Public License for more details. %% %% You should have received a copy of the GNU General Public License %% along with this program; if not, write to the Free Software %% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA %% -module(erlang_app_req). -vsn('0.15.0'). -author('Led <ledest@gmail.com>'). -license('GPL v3'). -export([main/1]). -define(ERROR_UNKNOWN, 255). warning(F, A) -> io:fwrite(standard_error, "WARNING: " ++ F, A), io:nl(standard_error). consult_error({error, {_, _, _} = E}, F) -> warning("Error while processing file '~s':\t~p", [F, file:format_error(E)]); consult_error({error, E}, F) when is_atom(E) -> warning("Error while opening file '~s': ~s", [F, file:format_error(E)]); consult_error(E, F) -> warning("Unexpected error while processing file '~s': ~p", [F, E]). requires(Fs) -> lists:usort(lists:flatten(lists:zf(fun(F) -> case file:consult(F) of {ok, [{application, _, L}]} -> L =/= [] andalso {true, proplists:get_value(applications, L, [])}; E -> consult_error(E, F), false end end, Fs))). read_line(Fs) -> case io:fread('', "~s") of {ok, F} -> read_line([F|Fs]); eof -> Fs; {error, What} -> warning("~p", What), halt(?ERROR_UNKNOWN) end. write_requires(As) -> lists:foreach(fun(M) -> io:fwrite("erlang_app(~s)~n", [M]) end, case os:getenv("RPM_ERLANG_REQ_APP_SKIPLIST") of false -> As; S -> As -- lists:map(fun erlang:list_to_atom/1, lists:usort(string:tokens(S, ", "))) end). -compile([inline_list_funcs, {inline, [requires/1, write_requires/1, warning/2, consult_error/2]}]). main(_) -> write_requires(requires(read_line([]))).
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor