summaryrefslogtreecommitdiffstats
path: root/eurephiadm/commands/buildinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'eurephiadm/commands/buildinfo.c')
-rw-r--r--eurephiadm/commands/buildinfo.c87
1 files changed, 87 insertions, 0 deletions
diff --git a/eurephiadm/commands/buildinfo.c b/eurephiadm/commands/buildinfo.c
new file mode 100644
index 0000000..57ca9b6
--- /dev/null
+++ b/eurephiadm/commands/buildinfo.c
@@ -0,0 +1,87 @@
+/* buildinfo.c -- eurephiadm buildinfo command:
+ * Shows info about the eurephia build
+ *
+ * GPLv2 only - Copyright (C) 2009 - 2010
+ * David Sommerseth <dazo@users.sourceforge.net>
+ *
+ * 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; version 2
+ * of the License.
+ *
+ * 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.
+ *
+ */
+
+/**
+ * @file eurephiadm/commands/buildinfo.c
+ * @author David Sommerseth <dazo@users.sourceforge.net>
+ * @date 2010-11-09
+ *
+ * @brief eurephiadm buildinfo command. Debug info related to the eurephia build
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#ifdef HAVE_LIBXML2
+#include <libxml/tree.h>
+#include <libxml/xpath.h>
+#endif
+
+#define MODULE "eurephia::BuildInfo" /**< Need to define the active module before including argparser.h */
+#include <eurephia_nullsafe.h>
+#include <eurephia_context.h>
+#include <eurephia_log.h>
+#include <eurephia_values_struct.h>
+#include <eurephiadb_session_struct.h>
+
+#include "../argparser.h"
+#include "../buildinfo.h"
+
+/**
+ * Help screen for the buildinfo command
+ */
+void help_BuildInfo()
+{
+ printf("eurephiadm::BuildInfo\n\n"
+ "This command will just show some basic information about the\n"
+ "current eurephia build. This is mostly useful when reporting bugs.\n\n"
+ );
+}
+
+
+/**
+ * Main function for the buildinfo command. Does the querying of the database and show the result
+ *
+ * @param ctx eurephiaCTX
+ * @param sess eurephiaSESSION of the current logged in user
+ * @param cfg eurephiaVALUES struct of the current configuration
+ * @param argc argument count for the eurephiadm command
+ * @param argv argument table for the eurephiadm command
+ *
+ * @return returns 0 on success, otherwise 1.
+ */
+int cmd_BuildInfo(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv)
+{
+ printf("** eurephia build information:\n"
+ " Version: " EUREPHIAVERSION "\n"
+ " Source base: " BUILDSOURCE "\n"
+ " Build date: " BUILDDATE "\n"
+ " Build host: " BUILDHOST "\n"
+ " System info: " BUILDSYSTEM "\n");
+#ifdef BUILDBRANCH
+ printf(" git branch: " BUILDBRANCH "\n"
+ " git commit: " BUILDGITREV "\n\n");
+#endif
+ return 0;
+}