X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Ffg_init.cxx;h=699765c32d3dabf6a282d014514260b63121dfa1;hb=76a94d8f0278eeddf692850918526df84a73429c;hp=5f72d1930511779760a30b3af547d7dae8af3516;hpb=c5c5a83ab200a99060a3595a464f84792e8a595e;p=flightgear.git diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 5f72d1930..699765c32 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -181,6 +181,30 @@ bool fgInitFGRoot ( int argc, char **argv ) { } +// Return the current base package version +string fgBasePackageVersion() { + SGPath base_path( globals->get_fg_root() ); + base_path.append("version"); + + sg_gzifstream in( base_path.str() ); + if ( !in.is_open() ) { + SGPath old_path( globals->get_fg_root() ); + old_path.append( "Thanks" ); + sg_gzifstream old( old_path.str() ); + if ( !old.is_open() ) { + return "[none]"; + } else { + return "[old version]"; + } + } + + string version; + in >> version; + + return version; +} + + // Read in configuration (file and command line) bool fgInitConfig ( int argc, char **argv ) {