import time
import platform
import string
+import commands
from sets import Set
import SCons.Node.FS
# note: requires that DOMAIN, MAJOR, MINOR, MICRO are set in the construction environment
# note: assumes one source files, the header that declares the version variables
#
+#def version_builder (target, source, env):
+# text = "int " + env['DOMAIN'] + "_major_version = " + str (env['MAJOR']) + ";\n"
+# text += "int " + env['DOMAIN'] + "_minor_version = " + str (env['MINOR']) + ";\n"
+# text += "int " + env['DOMAIN'] + "_micro_version = " + str (env['MICRO']) + ";\n"
+#
+# try:
+# o = file (target[0].get_path(), 'w')
+# o.write (text)
+# o.close ()
+# except IOError:
+# print "Could not open", target[0].get_path(), " for writing\n"
+# sys.exit (-1)
+#
+# text = "#ifndef __" + env['DOMAIN'] + "_version_h__\n"
+# text += "#define __" + env['DOMAIN'] + "_version_h__\n"
+# text += "extern int " + env['DOMAIN'] + "_major_version;\n"
+# text += "extern int " + env['DOMAIN'] + "_minor_version;\n"
+# text += "extern int " + env['DOMAIN'] + "_micro_version;\n"
+# text += "#endif /* __" + env['DOMAIN'] + "_version_h__ */\n"
+#
+# try:
+# o = file (target[1].get_path(), 'w')
+# o.write (text)
+# o.close ();
+# except IOError:
+# print "Could not open", target[1].get_path(), " for writing\n"
+# sys.exit (-1)
+#
+# return None
+
def version_builder (target, source, env):
- text = "int " + env['DOMAIN'] + "_major_version = " + str (env['MAJOR']) + ";\n"
- text += "int " + env['DOMAIN'] + "_minor_version = " + str (env['MINOR']) + ";\n"
- text += "int " + env['DOMAIN'] + "_micro_version = " + str (env['MICRO']) + ";\n"
-
- try:
- o = file (target[0].get_path(), 'w')
- o.write (text)
- o.close ()
- except IOError:
- print "Could not open", target[0].get_path(), " for writing\n"
- sys.exit (-1)
-
- text = "#ifndef __" + env['DOMAIN'] + "_version_h__\n"
- text += "#define __" + env['DOMAIN'] + "_version_h__\n"
- text += "extern int " + env['DOMAIN'] + "_major_version;\n"
- text += "extern int " + env['DOMAIN'] + "_minor_version;\n"
- text += "extern int " + env['DOMAIN'] + "_micro_version;\n"
- text += "#endif /* __" + env['DOMAIN'] + "_version_h__ */\n"
-
- try:
- o = file (target[1].get_path(), 'w')
- o.write (text)
- o.close ();
- except IOError:
- print "Could not open", target[1].get_path(), " for writing\n"
- sys.exit (-1)
-
- return None
+ cmd = "svn info "
+ cmd += source[0].get_path()
+ cmd += " | awk '/^Revision:/ { print $2}'"
+
+ rev = commands.getoutput (cmd)
+
+ text = "const char* " + env['DOMAIN'] + "_revision = \"" + rev + "\";\n"
+ text += "int " + env['DOMAIN'] + "_major_version = " + str (env['MAJOR']) + ";\n"
+ text += "int " + env['DOMAIN'] + "_minor_version = " + str (env['MINOR']) + ";\n"
+ text += "int " + env['DOMAIN'] + "_micro_version = " + str (env['MICRO']) + ";\n"
+
+ try:
+ o = file (target[0].get_path(), 'w')
+ o.write (text)
+ o.close ()
+ except IOError:
+ print "Could not open", target[0].get_path(), " for writing\n"
+ sys.exit (-1)
+
+ text = "#ifndef __" + env['DOMAIN'] + "_version_h__\n"
+ text += "#define __" + env['DOMAIN'] + "_version_h__\n"
+ text += "extern const char* " + env['DOMAIN'] + "_revision;\n"
+ text += "extern int " + env['DOMAIN'] + "_major_version;\n"
+ text += "extern int " + env['DOMAIN'] + "_minor_version;\n"
+ text += "extern int " + env['DOMAIN'] + "_micro_version;\n"
+ text += "#endif /* __" + env['DOMAIN'] + "_version_h__ */\n"
+
+ try:
+ o = file (target[1].get_path(), 'w')
+ o.write (text)
+ o.close ();
+ except IOError:
+ print "Could not open", target[1].get_path(), " for writing\n"
+ sys.exit (-1)
+
+ return None
version_bld = Builder (action = version_builder)
env.Append (BUILDERS = {'VersionBuild' : version_bld})
ARDOUR_UI * ui = (ARDOUR_UI *) arg;
ui->hide_splash();
- ui->show ();
return FALSE;
}
win.set_position (Gtk::WIN_POS_CENTER);
if (!no_splash) {
- ui->hide_splash ();
+ ui->hide_splash ();
}
/* we just don't care about the result, but we want to block */
ui->load_session (path, name);
} else {
- /* TODO: This bit of code doesn't work properly yet
- Glib::signal_idle().connect (bind (mem_fun (*ui, &ARDOUR_UI::cmdline_new_session), path));
- ui->set_will_create_new_session_automatically (true); */
+ /* TODO: This bit of code doesn't work properly yet
+ Glib::signal_idle().connect (bind (mem_fun (*ui, &ARDOUR_UI::cmdline_new_session), path));
+ ui->set_will_create_new_session_automatically (true);
+ */
+
/* Show the NSD */
ui->hide_splash ();
if (!Config->get_no_new_session_dialog()) {
cout << _("Ardour/GTK ")
<< VERSIONSTRING
<< _("\n (built using ")
- << ARDOUR::get_ardour_revision ()
+ << gtk_ardour_revision
#ifdef __GNUC__
<< _(" and GCC version ") << __VERSION__
#endif