pathes to better support third party extensions from ML. Thanks to Alessio Vanni
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Thu, 8 Aug 2019 15:23:26 +0000 (17:23 +0200)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Thu, 8 Aug 2019 15:23:26 +0000 (17:23 +0200)
src/include/gnunet_os_lib.h
src/util/Makefile.am
src/util/getopt_helpers.c
src/util/os_installation.c
src/util/program.c

index 6eb4ce5ebdd65b31812536e5de750a96d0736d9b..d43711a99fbe2590640d0076d0ccbb6957735a37 100644 (file)
@@ -267,6 +267,15 @@ struct GNUNET_OS_ProjectData
    */
   const char *user_config_file;
 
+  /**
+   * String identifying the current project version.
+   */
+  const char *version;
+
+  /**
+   * Non-zero means this project is part of GNU.
+   */
+  int is_gnu;
 };
 
 
index fe5cc6e72b121ea64bbc8d3b0dee380d76cf0f08..647f09224fe2676c78a567a364e410d90735d275 100644 (file)
@@ -161,7 +161,7 @@ libgnunetutil_la_LIBADD = \
 
 libgnunetutil_la_LDFLAGS = \
   $(GN_LIB_LDFLAGS) \
-  -version-info 13:1:0
+  -version-info 13:2:0
 
 libgnunetutil_taler_wallet_la_SOURCES = \
   common_allocation.c \
index 05856beeeec6d9f4f9742f8c327a69deb7328ebc..80d1037bb6d46a7b65d9dbce8b1f5d643646ebdf 100644 (file)
@@ -178,10 +178,13 @@ format_help (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
   }
   pd = GNUNET_OS_project_data_get ();
   printf ("Report bugs to %s.\n"
-          "GNUnet home page: %s\n"
-          "General help using GNU software: http://www.gnu.org/gethelp/\n",
+          "Home page: %s\n",
           pd->bug_email,
           pd->homepage);
+
+  if (0 != pd->is_gnu)
+    printf ("General help using GNU software: http://www.gnu.org/gethelp/\n");
+  
   return GNUNET_NO;
 }
 
index d2ce7fd9bc5037f6e4e549ab6ac0de0dc4f1e3fb..9dcfa5ef1baa2f0f2fb933e7eda1f369a8a4116e 100644 (file)
@@ -57,6 +57,7 @@ static const struct GNUNET_OS_ProjectData default_pd = {
   .libname = "libgnunetutil",
   .project_dirname = "gnunet",
   .binary_name = "gnunet-arm",
+  .version = PACKAGE_VERSION " " VCS_VERSION,
   .env_varname = "GNUNET_PREFIX",
   .base_config_varname = "GNUNET_BASE_CONFIG",
   .bug_email = "gnunet-developers@gnu.org",
index 8a5b1c41473c614b8600e1aef71079c8b6f2b66e..1462a03a838d77061b830345bef875c2c82e86c4 100644 (file)
@@ -161,12 +161,13 @@ GNUNET_PROGRAM_run2 (int argc,
   unsigned long long skew_variance;
   long long clock_offset;
   struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get ();
   struct GNUNET_GETOPT_CommandLineOption defoptions[] =
     {GNUNET_GETOPT_option_cfgfile (&cc.cfgfile),
      GNUNET_GETOPT_option_help (binaryHelp),
      GNUNET_GETOPT_option_loglevel (&loglev),
      GNUNET_GETOPT_option_logfile (&logfile),
-     GNUNET_GETOPT_option_version (PACKAGE_VERSION " " VCS_VERSION)};
+     GNUNET_GETOPT_option_version (pd->version)};
   struct GNUNET_GETOPT_CommandLineOption *allopts;
   const char *gargs;
   char *lpfx;
@@ -231,9 +232,9 @@ GNUNET_PROGRAM_run2 (int argc,
                      "%s%s%s",
                      xdg,
                      DIR_SEPARATOR_STR,
-                     GNUNET_OS_project_data_get ()->config_file);
+                     pd->config_file);
   else
-    cfg_fn = GNUNET_strdup (GNUNET_OS_project_data_get ()->user_config_file);
+    cfg_fn = GNUNET_strdup (pd->user_config_file);
   lpfx = GNUNET_strdup (binaryName);
   if (NULL != (spc = strstr (lpfx, " ")))
     *spc = '\0';