Merge branch 'dev' of feistymeow.org:feisty_meow into dev
authorChris Koeritz <fred@gruntose.com>
Tue, 21 Nov 2017 02:37:22 +0000 (21:37 -0500)
committerChris Koeritz <fred@gruntose.com>
Tue, 21 Nov 2017 02:37:22 +0000 (21:37 -0500)
nucleus/library/versions/version_ini.cpp
nucleus/library/versions/version_ini.h
nucleus/tools/clam_tools/version_stamper.cpp
nucleus/tools/clam_tools/vsts_version_fixer.cpp
nucleus/tools/clam_tools/write_build_config.cpp
readme.txt
scripts/clam/cpp/rules.def
scripts/clam/cpp/variables.def
scripts/core/functions.sh
scripts/opensim/opensim_utils.sh

index 6a5519e14e1c73fd0666f5b936cbee5ef51a8b9c..e9fc8b23afb5a02e22aa770f348bf291c03d1dcc 100644 (file)
@@ -269,8 +269,9 @@ END\n\
 #define REPLACE(tag, replacement) \
   new_version_entry.replace_all(tag, replacement); \
 
-bool version_ini::write_rc(const version_record &to_write)
+bool version_ini::write_rc(const astring &header_store, const version_record &to_write)
 {
+  FUNCDEF("write_rc");
   astring new_version_entry(version_rc_template);
 
   // $file_ver -> w, x, y, z for version of the file.
@@ -320,7 +321,7 @@ bool version_ini::write_rc(const version_record &to_write)
   astring root_part = "/";
   root_part += _ini->load(VERSION_SECTION, ROOT, "");
 
-  astring rc_filename(astring(_path_name->dirname()) + root_part
+  astring rc_filename(header_store + "/" + root_part
       + "_version.rc");
 
   filename(rc_filename).chmod(filename::ALLOW_BOTH, filename::USER_RIGHTS);
@@ -374,8 +375,9 @@ const astring version_header_template = "\
 
 //////////////
 
-bool version_ini::write_code(const version_record &to_write)
+bool version_ini::write_code(const astring &header_store, const version_record &to_write)
 {
+  FUNCDEF("write_code");
   astring root_part = _ini->load(VERSION_SECTION, ROOT, "");
   astring root = root_part.upper();  // make upper case for naming sake.
   astring name = _ini->load(VERSION_SECTION, NAME, "");
@@ -409,7 +411,7 @@ bool version_ini::write_code(const version_record &to_write)
   // $web_address -> the web site for the company.  not actually stored.
   REPLACE("$web_address", to_write.web_address);
 
-  astring header_filename(_path_name->dirname().raw() + "/" + root_part
+  astring header_filename(header_store + "/" + root_part
       + astring("_version.h"));
 
   filename(header_filename).chmod(filename::ALLOW_BOTH, filename::USER_RIGHTS);
@@ -447,12 +449,16 @@ bool replace_version_entry(astring &full_string, const astring &look_for,
   return to_return;
 }
 
-bool version_ini::write_assembly(const version_record &to_write,
+bool version_ini::write_assembly(const astring &header_store, const version_record &to_write,
     bool do_logging)
 {
   FUNCDEF("write_assembly");
-  filename just_dir = _path_name->dirname();
-//LOG(astring("dir is set to: ") + just_dir);
+  filename just_dir = filename(header_store);
+         //_path_name->dirname();
+
+//hmmm: make condit on debug
+LOG(astring("dir is set to: ") + just_dir);
+
   directory dir(just_dir);
   filename to_patch;
 //LOG(astring("dir has: ") + dir.files().text_form());
@@ -530,8 +536,9 @@ bool version_ini::write_assembly(const version_record &to_write,
 }
 
 bool version_ini::one_stop_version_stamp(const astring &path,
-    const astring &source_version, bool do_logging)
+    const astring &header_store, const astring &source_version, bool do_logging)
 {
+  FUNCDEF("one_stop_version_stamp");
   astring path_name = path;
   if (path_name.equal_to("."))
     path_name = application_configuration::current_directory();
@@ -569,24 +576,26 @@ bool version_ini::one_stop_version_stamp(const astring &path,
   version_ini verini(path_name);
   verini.set_record(source.get_record(), false);
 
-//  LOG(a_sprintf("The file \"%s\" contains this version information:",
-//      path_name.s()));
-//  LOG(verini.get_record().text_form());
+//put this in debug brackets
+  LOG(a_sprintf("The file \"%s\" contains this version information:",
+      path_name.s()));
+  LOG(verini.get_record().text_form());
+//...debug to here
 
-  if (!verini.write_rc(verini.get_record())) {
+  if (!verini.write_rc(header_store, verini.get_record())) {
     critical_events::alert_message(a_sprintf("Could not write the RC file in \"%s\".",
         filename(path_name).basename().raw().s()));
     return false;
   }
 
-  if (verini.library() && !verini.write_code(verini.get_record())) {
+  if (verini.library() && !verini.write_code(header_store, verini.get_record())) {
     critical_events::alert_message(astring("Could not write the C++ header file for "
         "the directory \"")
         + filename(path_name).basename() + astring("\".\n"));
     return false;
   }
 
-  if (!verini.write_assembly(verini.get_record(), do_logging)) {
+  if (!verini.write_assembly(header_store, verini.get_record(), do_logging)) {
     critical_events::alert_message(astring("Could not write the Assembly info file for "
         "the directory \"")
         + filename(path_name).basename() + astring("\".\n"));
index 6838adee20a151e072d7099b3eccb857c60f374c..0fe559d20762165a7ed852b067b0c5238d659ca3 100644 (file)
@@ -80,18 +80,18 @@ public:
   bool ole_auto_registering();
     //!< returns true if this version file specifies ole auto registration.
 
-  bool write_rc(const structures::version_record &to_write);
+  bool write_rc(const basis::astring &header_store, const structures::version_record &to_write);
     //!< writes out the file 'X_version.rc' for the X library or application.
     /*!< the contents will include the information specified in "to_write",
     where X is the library name from that record. */
 
-  bool write_code(const structures::version_record &to_write);
+  bool write_code(const basis::astring &header_store, const structures::version_record &to_write);
     //!< writes out the header ('X_version.h') with the version information.
     /*!< this file is needed for other libraries or application to know this
     project's version number.  the users can make sure that the header info
     agrees with the actual version seen on the file. */
 
-  bool write_assembly(const structures::version_record &to_write, bool do_logging);
+  bool write_assembly(const basis::astring &header_store, const structures::version_record &to_write, bool do_logging);
     //!< fixes any assemblies with the info in "to_write".
 
   static bool executable(const basis::astring &path_name);
@@ -103,9 +103,11 @@ public:
     //!< specialized version ignores cache and gets version directly from file.
 
   static bool one_stop_version_stamp(const basis::astring &path,
-          const basis::astring &source_version, bool do_logging);
+          const basis::astring &header_store, const basis::astring &source_version,
+          bool do_logging);
     //!< performs version stamping using the ini file in "path".
-    /*!< "source_version" supplies the name of the main version file where
+    /*!< the created version files will be written to the "header_store".
+    "source_version" supplies the name of the main version file where
     we retrieve the current version numbers.  if that is not specified, then
     only the version header and RC file are created.  if "do_logging" is
     true, then version info will be sent to the program-wide logger. */
index ea90cd41822b2291551384c88783548ea92d5eb1..3313906d82f90b50343b49cfa44413f470ab49a0 100644 (file)
@@ -67,24 +67,27 @@ int version_stamper::execute()
 {
   FUNCDEF("execute");
   SETUP_CONSOLE_LOGGER;  // override the file_logger from app_shell.
-  if (application::_global_argc < 2) {
-    log(astring("The directory where the 'version.ini' file is located\n"
-        "must be specified as the first parameter of this program.  Another\n"
-        "version file may optionally be specified as the second parameter of\n"
-        "the program; the version contained in this file will be used to set\n"
-        "the version of the file specified in the first parameter.\n"
-        "Additionally, if the environment variable 'DEBUG' exists, then the\n"
-        "generated RC file will be marked as a debug build.  Otherwise it is\n"
-        "marked as a release build.  Note that the CLAM system automatically\n"
-        "sets this for you.\n\n"), ALWAYS_PRINT);
+  if (application::_global_argc < 3) {
+    log(astring(
+"The directory where the 'version.ini' file is located must be specified as the\n"
+"first parameter of this program.  The second parameter must provide the\n"
+"storage location where the version header will be written.  Another version\n"
+"file may optionally be specified as the third parameter of the program; the\n"
+"version contained in this file will be used to set the version of the file\n"
+"specified in the first parameter.\n"
+"Additionally, if the environment variable 'DEBUG' exists, then the\n"
+"generated RC file will be marked as a debug build.  Otherwise it is\n"
+"marked as a release build.  Note that the CLAM system automatically\n"
+"sets this for you.\n\n"), ALWAYS_PRINT);
     return 1;
   }
 
   astring path_name = application::_global_argv[1];
+  astring storage_name = application::_global_argv[2];
   astring source_version_file;  // blank by default.
-  if (application::_global_argc > 2)
-    source_version_file = application::_global_argv[2];
-  bool ret = version_ini::one_stop_version_stamp(path_name, source_version_file, true);
+  if (application::_global_argc > 3)
+    source_version_file = application::_global_argv[3];
+  bool ret = version_ini::one_stop_version_stamp(path_name, storage_name, source_version_file, true);
   if (!ret) return 1;  // failure.
   return 0;  // success.
 }
index bef8fcbafaf727d3b5f0b215280e4c54f8181722..3beb8779ee2310e125a71ef2eff21a010aa6577e 100644 (file)
@@ -219,8 +219,13 @@ bool stamping_spider(const directory &current)
     if (current_file.ends("version.ini")
         && !current_file.iequals("core_version.ini") ) {
 //LOG(astring("found ver file: ") + current.path() + "/" + current_file);
+//
+      astring versions_directory = environment::get("FEISTY_MEOW_GENERATED_STORE");
+     // we keep our version files one level below the top of the generated store.
+      versions_directory += "/versions";
+
       version_ini::one_stop_version_stamp(current.path() + "/" + current_file,
-          global_build_ini, true);
+          versions_directory, global_build_ini, true);
     }
   }
   return true;
index b8bfd80c1ee8c8d647c0a3ffb16067fdf741bbca..6eb06ad2ef3015e79806e98348a065e1eda09a0b 100644 (file)
@@ -206,12 +206,15 @@ if (read < 1) LOG("why is existing header contentless?");
   if (write_header) {
     // we actually want to blast out a new file.
     byte_filer build_header(filename, "wb");
-    if (!build_header.good())
-      non_continuable_error(static_class_name(), func, astring("failed to create "
+    if (!build_header.good()) {
+      continuable_error(static_class_name(), func, astring("could not create "
           "build header file in ") + build_header.name());
-    build_header.write(new_contents);
-    LOG(astring(static_class_name()) + ": wrote config to "
-        + build_header.name());
+      return false;
+    } else {
+      build_header.write(new_contents);
+      LOG(astring(static_class_name()) + ": wrote config to "
+          + build_header.name());
+    }
   } else {
     // nothing has changed.
 //    LOG(astring(static_class_name()) + ": config already up to date in "
@@ -245,8 +248,10 @@ int write_build_config::execute()
   // find our storage area for the build headers.  we know a couple build
   // configurations by now, but this should really be coming out of a config
   // file instead.
-  astring genstore_directory = environment::get("FEISTY_MEOW_GENERATED_STORE");
-  if (!filename(genstore_directory).good()) {
+  astring versions_directory = environment::get("FEISTY_MEOW_GENERATED_STORE");
+  // we keep our version files one level below the top of the generated store.
+  versions_directory += "/versions";
+  if (!filename(versions_directory).good()) {
     non_continuable_error(static_class_name(), func,
         astring("failed to locate the library folder storing the generated files."));
   }
@@ -254,8 +259,8 @@ int write_build_config::execute()
   // these are very specific paths, but they really are where we expect to
   // see the headers.
 
-  astring cfg_header_filename = genstore_directory + "/__build_configuration.h";
-  astring ver_header_filename = genstore_directory + "/__build_version.h";
+  astring cfg_header_filename = versions_directory + "/__build_configuration.h";
+  astring ver_header_filename = versions_directory + "/__build_version.h";
 
   // open the ini file for reading.
   byte_filer ini(fname, "r");
@@ -378,16 +383,16 @@ int write_build_config::execute()
     LOG(astring("failed writing output file ") + ver_header_filename);
   }
 
-  // now make a copy into the library folder, for when we release a production version.
-  astring library_directory = repodir + "/nucleus/library";
-  astring cfg_header_copy = library_directory + "/__build_configuration.h";
-  astring ver_header_copy = library_directory + "/__build_version.h";
-  if (!write_output_file(cfg_header_copy, cfg_accumulator)) {
-    LOG(astring("skipping copy due to read-only issue on output file: ") + cfg_header_copy);
-  }
-  if (!write_output_file(ver_header_copy, ver_accumulator)) {
-    LOG(astring("skipping copy due to read-only issue on output file: ") + ver_header_copy);
-  }
+//NO, not any more  // now make a copy into the library folder, for when we release a production version.
+//  astring library_directory = repodir + "/nucleus/library";
+//  astring cfg_header_copy = library_directory + "/__build_configuration.h";
+//  astring ver_header_copy = library_directory + "/__build_version.h";
+//  if (!write_output_file(cfg_header_copy, cfg_accumulator)) {
+//    LOG(astring("skipping copy due to read-only issue on output file: ") + cfg_header_copy);
+//  }
+//  if (!write_output_file(ver_header_copy, ver_accumulator)) {
+//    LOG(astring("skipping copy due to read-only issue on output file: ") + ver_header_copy);
+//  }
 
   return 0;
 }
index ca3b745926850fed6a873ed75741dbbe2fd02423..aaa8283b77d290095a210d1b309b9797cd16beef 100644 (file)
@@ -58,12 +58,15 @@ A couple of perl modules are required by some of the scripts (including the
 differ utility and the feisty meow customization system).  They can be
 installed with either apt-get or CPAN.
 
-Install using apt-get:
+Install using apt-get (on Ubuntu or Debian-based OS):
 # sudo apt-get install libfile-which-perl libtext-diff-perl
 
 or Install using perl's CPAN:
 # sudo cpan install Text::Diff File::Which
 
+or on Cygwin (MS-Windows), install with apt-cyg:
+# apt-cyg install perl-File-Which perl-Text-Diff
+
 ==============
 
 How to install the build dependencies for feisty meow
index 208728d9cb54e9ff718a367297f31fcfde68331b..40a72ba49f22903464a01799b25f2de0a1c3f2d1 100644 (file)
@@ -678,7 +678,7 @@ ifeq "$(OMIT_VERSIONS)" ""
   ifneq "$(VERSION_RC_ROOT)" ""
 # only redo the version resource if it or version.ini is out of date.
 %_version.rc: version.ini $(PARAMETER_FILE)
-       $(CATCHER)$(CLAM_BINARIES)/version_stamper$(EXE_END) . $(PARAMETER_FILE)
+       $(CATCHER)$(CLAM_BINARIES)/version_stamper$(EXE_END) . $(FEISTY_MEOW_GENERATED_STORE)/versions $(PARAMETER_FILE)
   endif
 endif
 
@@ -769,10 +769,11 @@ endif # no-deps.
 
 ############################################################################
 
-# examines the required variables and complains if they're missing.
+# examines the required variables and complains if they are missing.
 check_requirements:
        $(HIDESH) -c 'if [ -z "$(PROJECT)" ]; then echo the PROJECT variable is not defined!; . $(CLAM_SCRIPTS)/exit_make.sh; fi'
        $(HIDESH) -c 'if [ -z "$(TYPE)" ]; then echo the TYPE variable is not defined!; . $(CLAM_SCRIPTS)/exit_make.sh; fi'
+       $(HIDESH) -c 'if [ ! -d $(FEISTY_MEOW_GENERATED_STORE)/versions ]; then mkdir $(FEISTY_MEOW_GENERATED_STORE)/versions; fi'
  
 ############################################################################
 
index bcf70032cbce858f142a5ee62cdcae88c728ad05..c9210586b8b3ab3003de4cdaca976ef3e966f3f0 100644 (file)
@@ -229,7 +229,7 @@ export STATIC_LIBRARY_DIR = $(TARGETS_STORE)
 
 # "HEADER_SEARCH_PATH" is where the class interface files are to be found.
 # we add the generated store folder for the build version file.
-HEADER_SEARCH_PATH = $(FEISTY_MEOW_GENERATED_STORE)
+HEADER_SEARCH_PATH = $(FEISTY_MEOW_GENERATED_STORE)/versions
 
 # "HOOPLE_HEADERS" are locations where the HOOPLE headers can be found.
 ifeq "$(HOOPLE_HEADERS)" ""
index daaabcb16cece5a745d7735421fbecfc1c4691f3..189dac016546307e7e665e05f816285e4389cbf9 100644 (file)
@@ -488,9 +488,12 @@ if [ -z "$skip_all" ]; then
     pushd "$FEISTY_MEOW_LOADING_DOCK/custom" &>/dev/null
     incongruous_files="$(bash "$FEISTY_MEOW_SCRIPTS/files/list_non_dupes.sh" "$FEISTY_MEOW_SCRIPTS/customize/$custom_user" "$FEISTY_MEOW_LOADING_DOCK/custom")"
 
-    local fail_message="\nare the perl dependencies installed?  if you're on ubuntu or debian, try this:\n
-    $(grep "apt.*perl" $FEISTY_MEOW_APEX/readme.txt)\n"
-    
+    local fail_message="\n
+are the perl dependencies installed?  if you're on ubuntu or debian, try this:\n
+    $(grep "apt-get.*perl" $FEISTY_MEOW_APEX/readme.txt)\n
+or if you're on cygwin, then try this (if apt-cyg is available):\n
+    $(grep "apt-cyg.*perl" $FEISTY_MEOW_APEX/readme.txt)\n";
+
     #echo "the incongruous files list is: $incongruous_files"
     # disallow a single character result, since we get "*" as result when nothing exists yet.
     if [ ${#incongruous_files} -ge 2 ]; then
index d9d9d654784b9732a893c233486cced77a157005..f10d6b95ea3e21446d39f9371ff665935968f8e1 100644 (file)
@@ -37,9 +37,9 @@ function launch_screen()
   app_name="$1"; shift
   echo "$(date_stringer ' '): starting $screen_name now..."
 #hmmm: version check for if we're using old screen?  this -L change was a mistake though for the screen project owners on ubuntu.
-#local boguslog=$HOME/screen_junk_$(date_stringer).log
+local boguslog=$HOME/screen_junk_$(date_stringer).log
 #maybe they unbroke it in 17.10?
-  screen -L$boguslog -S "$screen_name" -d -m nice -n $NICENESS_LEVEL mono "$app_name" 
+  screen -L $boguslog -S "$screen_name" -d -m nice -n $NICENESS_LEVEL mono "$app_name" 
 
   echo "$(date_stringer ' '): $screen_name started."
   # only sleep if we are not at the last process that gets started.