Skip to content
Eric Pailleau edited this page Mar 14, 2018 · 5 revisions

API

geas give below informations on an Erlang project repository content or from .beam files :

  • name
  • version
  • description
  • type [lib | otp | app | esc] for respectively application library, plain OTP application, non OTP application, escript.
  • datetime
  • native [true | false] true if at least one module compiled native.
  • arch [x86 | x86_64 | arm | powerpc | ppc64 | ultrasparc ] Architecture of native beam, otherwise local architecture.
  • os Local OS
  • word [32 | 64] OS' Word length
  • compile module version string
  • erlang {Min, Recommanded, Max} Erlang version strings (Recommanded version is the highest non candidate version), guessed from compiler version
  • compat (version >= 2.0) {MinDbRel, MinRel, MaxRel, MaxDbRel} Compatibility of code with official releases (without dependancies !). First and last value of tuple are the lowest and highest reference of geas database. Second value is the lowest official Erlang release where the beam(s) can run, while third value is the highest release where the beam(s) can run. Note that if first and second values are the same, it may imply that beam(s) file could run, possibly, on older official release, or not. As well if third and fourth value are the same, be sure that your geas database is up to date with the last official release.
  • author (from beam content)
  • vcs information tuple
  • maintainer (from vcs infos)
  • changelog Changelog filename if any found
  • releasenotes Releasenotes filename if any found
  • driver (boolean) Project need to compile C code for a driver or a port
  • patches (version >= 2.0.14) List of patches detected

See API changelog for detailed informations on API evolution.

Example

1> geas:info(".").
{ok,[{name,geas},
     {version,"2.0.14"},
     {description,"Guess Erlang Application Scattering"},
     {type,lib},
     {datetime,undefined},
     {native,false},
     {arch,x86},
     {os,{unix,linux,"4.4.0"}},
     {word,32},
     {compile,"7.1.5"},
     {erlang,{"20.3","20.3","20.3"}},
     {compat,{"R15","R15","20.3","20.3"}},
     {author,"Eric Pailleau <geas@crownedgrouse.com>"},
     {vcs,{git,"dee94b64286709dd1b87b2ee7cfa42ef6b4c1e18",
               "https://github.com:crownedgrouse/geas.git"}},
     {maintainer,"crownedgrouse  <hidden@hidden>"},
     {changelog,undefined},
     {releasenotes,undefined},
     {driver,false},
     {patches,[]}]}

2> geas:what("ebin").
{ok,[{name,geas},
     {version,"2.0.14"},
     {description,"Guess Erlang Application Scattering"},
     {type,lib},
     {datetime,undefined},
     {native,false},
     {arch,x86},
     {os,{unix,linux,"4.4.0"}},
     {word,32},
     {compile,"7.1.5"},
     {erlang,{"20.3","20.3","20.3"}},
     {compat,{"R15","R15","20.3","20.3"}},
     {author,"Eric Pailleau <geas@crownedgrouse.com>"},
     {patches,[]}]}

3> geas:what("ebin/geas.beam").
{ok,[{name,geas},
     {version,287286685447451634473503522901465731730},
     {type,lib},
     {datetime,undefined},
     {native,false},
     {arch,x86},
     {os,{unix,linux,"4.4.0"}},
     {word,32},
     {compile,"7.1.5"},
     {erlang,{"20.3","20.3","20.3"}},
     {compat,{"R15","R15","20.3","20.3"}},
     {author,"Eric Pailleau <geas@crownedgrouse.com>"},
     {patches,[]}]}

4> geas:offending("test.beam").
{ok,{[{"R16B01",[{application,ensure_all_started,1}]}],[]}}

5> geas:compat(".", global).
{"R15","R15B03-1","18.2","18.2"}

6> geas:w2l(geas:compat(".", global)).
["R15B03-1","R16B","R16B01","R16B02","R16B03-1","17.0",
 "17.1","17.3","17.4","17.5","18.0","18.1","18.2"]

7>geas:highest_version("R15B03","18.2.1").
"18.2.1"

8> geas:lowest_version("R15B03","18.2.1").
"R15B03"

9> geas:git_tag("R16B03").
"OTP_R16B03"
10> geas:git_tag("19.3").
"OTP-19.3"
Clone this wiki locally