[erlang-questions] Specify version in release using woldcards?

Dale Harvey harveyd@REDACTED
Tue Oct 14 15:36:05 CEST 2008


might not be the best solution, but I just build the spec file dynamically
before building the boot script

get_vsn(Module) ->
    AppFile = code:lib_dir(Module)++"/ebin/"++atom_to_list(Module)++".app",
    {ok,[{application,_App,Attrs}]} = file:consult(AppFile),
    {value,{vsn,Vsn}} = lists:keysearch(vsn,1,Attrs),
    Vsn

get_vsn(crypto) will then get you the installed version of crypto

use get_vsn and erlang:system_info(version) to build the spec file,
write it, and then call make_script

2008/10/14 C. Florian Ebeling <florian.ebeling@REDACTED>

> Hi,
>
> we have an application on which two people are working
> using defferent kinds of unix/linux distributions (Mac and Suse).
>
> So they have deferent releases of erlang installed. When
> I use this release spec, I get warnings from make_script/2.
>
> {release, {"adrecord_rel","1.0"}, {erts, "5.6.3"},
>  [{kernel,"2.12.3"},
>  {stdlib,"1.15.3"},
>  {sasl, "2.1.5.3"},
>  {crypto, "1.5.2"},
>  {adrecord, "0.1"}]}
>
> which look like this:
>
> erl -noshell -pa ebin -eval 'systools:make_script("adrecord",
> [local])' -s init stop
> crypto: No valid version ("1.5.2") of .app file found. Found file
> "/opt/local/lib/erlang/lib/crypto-1.5.2.1/ebin/crypto.app" with
> version "1.5.2.1"
>
> Is there some elegant way to deal with this? Can I maybe
> specify some wildcards or only the more major part of versions?
>
> Florian
>
>
> --
> Florian Ebeling
> Twitter: febeling
> florian.ebeling@REDACTED
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081014/09796132/attachment.htm>


More information about the erlang-questions mailing list