From: Chris Koeritz
Date: Sat, 11 Nov 2017 05:45:05 +0000 (+0000)
Subject: Merge branch 'master' of feistymeow.org:feisty_meow
X-Git-Tag: 2.140.94~1^2^2^2^2
X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=f9aa9387e92eaebc7f65421c5063b334165e7ffb;hp=47e3b391e075f46b1a2717847b550d3059183e0f;p=feisty_meow.git
Merge branch 'master' of feistymeow.org:feisty_meow
---
diff --git a/documentation/clam_manual/clam_docs.html b/documentation/clam_manual/clam_docs.html
index 6872a4e1..b5380512 100644
--- a/documentation/clam_manual/clam_docs.html
+++ b/documentation/clam_manual/clam_docs.html
@@ -646,7 +646,7 @@
are
generated. All files generated by compilation are stored in the
repository
- directory (by default, either "~/feisty_meow" in Linux or "l:\" in
+ directory (by default, either "/opt/feistymeow.org/feisty_meow" in Linux or "l:\" in
win32). There are three TYPEs supported so far:
@@ -671,7 +671,7 @@
be given
an include directory named after the project, such as
- "~/feisty_meow/include/basis".
+ "/opt/feistymeow.org/feisty_meow/include/basis".
The include directory is created as a copy of the headers in the
project's
directory . Library projects will also have their final products
diff --git a/documentation/history_anat.txt b/documentation/history_anat.txt
index 6f727015..46f95fc2 100644
--- a/documentation/history_anat.txt
+++ b/documentation/history_anat.txt
@@ -74,18 +74,22 @@ octopi/
Octopus design pattern and CROMP protocol reference implementations. Assorted applications
based on these.
-infabase/
+infobase/
Some files considered critical to the operations of Feisty Meow Concerns Ltd. This includes
the database of fortunes used by the Nechung Oracle Program.
-documentation/
- Helpful guides and information for Feisty Meow. Also includes a code documentation generator
- configuration for feisty meow that produces a nice set of web docs, using doxygen.
+infobase/feisty_inits
+ Some example startup files for use with feisty meow. These are deployed automatically by
+ the "connect_feisty_meow" command.
-examples/
+infobase/examples/
Some files that show how to get work done with Feisty Meow or that show how to do certain
tasks in different scripting / programming languages.
+documentation/
+ Helpful guides and information for Feisty Meow. Also includes a code documentation generator
+ configuration for feisty meow that produces a nice set of web docs, using doxygen.
+
kona/
Our burgeoning Java libraries. Not much to see here yet, but there is some code piling
up for these that we will try to release soon.
diff --git a/feisty_inits/dot.bashrc-normal-user b/feisty_inits/dot.bashrc-normal-user
deleted file mode 100644
index 526b171e..00000000
--- a/feisty_inits/dot.bashrc-normal-user
+++ /dev/null
@@ -1,39 +0,0 @@
-
-##############
-
-# initializes the feisty meow environment for "normal" users (not intended for the root user).
-
-##############
-
-# drag in the default version of this file. this may not be needed if your
-# .bashrc script already has substantial code or already does this.
-source /etc/bash.bashrc
-
-##############
-
-# set the history sizes to be much larger, and do this whether we load the
-# feisty meow environment or not.
-
-export HISTSIZE=1000000
-export HISTFILESIZE=8000000
-
-##############
-
-# system-wide install:
-export FEISTY_MEOW_APEX="/usr/local/fred/feisty_meow"
-# personal install:
-#export FEISTY_MEOW_APEX="$HOME/feisty_meow"
-
-# sets up the feisty_meow scripts if appropriate for the environment.
-if [ "${TERM}" != "dumb" -a -z "$PBS_ENVIRONMENT" ]; then
- source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
-fi
-
-# if not commented out, then feisty meow will run all the unit tests during builds.
-#export RUN_ALL_TESTS=true
-
-# turns on noisy debugging in feisty meow scripts if uncommented.
-#export DEBUG_FEISTY_MEOW=true
-
-##############
-
diff --git a/feisty_inits/dot.bashrc-root b/feisty_inits/dot.bashrc-root
deleted file mode 100644
index ee860947..00000000
--- a/feisty_inits/dot.bashrc-root
+++ /dev/null
@@ -1,37 +0,0 @@
-
-##############
-
-# provides a macro to initialize the feisty meow environment for the "root" user.
-
-##############
-
-# drag in the default version of this file. this may not be needed if your
-# .bashrc script already has substantial code or already does this.
-source /etc/bash.bashrc
-
-##############
-
-# set the history sizes to be much larger, and do this whether we load the
-# feisty meow environment or not.
-
-export HISTSIZE=1000000
-export HISTFILESIZE=8000000
-
-##############
-
-# system-wide install:
-export FEISTY_MEOW_APEX="/usr/local/fred/feisty_meow"
-# personal install:
-#export FEISTY_MEOW_APEX="$HOME/feisty_meow"
-
-# the "fredme" macro enables the feisty_meow environment.
-alias fredme='source "$FEISTY_MEOW_APEX/feisty_meow/scripts/core/launch_feisty_meow.sh"'
-
-# if not commented out, then feisty meow will run all the unit tests during builds.
-#export RUN_ALL_TESTS=true
-
-# turns on noisy debugging in feisty meow scripts if uncommented.
-#export DEBUG_FEISTY_MEOW=true
-
-##############
-
diff --git a/infobase/configuration/cron/aa_cron_defaults.crontab b/infobase/configuration/cron/aa_cron_defaults.crontab
index 375d1d38..51a73ff4 100644
--- a/infobase/configuration/cron/aa_cron_defaults.crontab
+++ b/infobase/configuration/cron/aa_cron_defaults.crontab
@@ -14,16 +14,16 @@
# HOME, which is pretty lucky for us...
# please change the name to the user running the cronjob, or to whatever
# unique string you'd like to use:
-CRONUSER=FILL_CRONUSER_HERE
+CRONUSER=FILL-CRONUSER-HERE
# set the shell to bash. (not the default for some cron implementations.)
SHELL=/bin/bash
-# set the top-level folder for feisty meow here, since cron gets almost
-# nothing from the user's environment. this folder needs to be updated for
-# your own particular install location.
+# set the top-level folder for feisty meow here; important because cron gets
+# almost nothing from the user's environment. this folder needs to be updated
+# for your own particular install location.
+FEISTY_MEOW_APEX=/opt/feistymeow.org/feisty_meow
#FEISTY_MEOW_APEX=$HOME/feisty_meow
-FEISTY_MEOW_APEX=/usr/local/fred/feisty_meow
# crontab miniature docs:
#
diff --git a/infobase/configuration/quake3/quake3_server_start.txt b/infobase/configuration/quake3/quake3_server_start.txt
index ef4e9bb5..a498a3a4 100644
--- a/infobase/configuration/quake3/quake3_server_start.txt
+++ b/infobase/configuration/quake3/quake3_server_start.txt
@@ -10,6 +10,6 @@ that i don't know but which i have heard of.
this just automates the copying of the config file before running quake.
-cp ~/feisty_meow/infobase/quake3/fred_free_for_all.cfg /usr/local/games/quake3/baseq3/ ; nohup quake3 +set dedicated 1 +exec fred_free_for_all.cfg
+cp $FEISTY_MEOW_APEX/infobase/quake3/fred_free_for_all.cfg /usr/local/games/quake3/baseq3/ ; nohup quake3 +set dedicated 1 +exec fred_free_for_all.cfg
diff --git a/infobase/feisty_inits/dot.bashrc-normal-user b/infobase/feisty_inits/dot.bashrc-normal-user
new file mode 100644
index 00000000..edc83b70
--- /dev/null
+++ b/infobase/feisty_inits/dot.bashrc-normal-user
@@ -0,0 +1,39 @@
+
+##############
+
+# initializes the feisty meow environment for "normal" users (not intended for the root user).
+
+##############
+
+# drag in the default version of this file. this may not be needed if your
+# .bashrc script already has substantial code or already does this.
+source /etc/bash.bashrc
+
+##############
+
+# set the history sizes to be much larger, and do this whether we load the
+# feisty meow environment or not.
+
+export HISTSIZE=1000000
+export HISTFILESIZE=8000000
+
+##############
+
+# system-wide install:
+export FEISTY_MEOW_APEX="/opt/feistymeow.org/feisty_meow"
+# personal install:
+#export FEISTY_MEOW_APEX="$HOME/feisty_meow"
+
+# sets up the feisty_meow scripts if appropriate for the environment.
+if [ "${TERM}" != "dumb" -a -z "$PBS_ENVIRONMENT" ]; then
+ source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
+fi
+
+# if not commented out, then feisty meow will run all the unit tests during builds.
+#export RUN_ALL_TESTS=true
+
+# turns on noisy debugging in feisty meow scripts if uncommented.
+#export DEBUG_FEISTY_MEOW=true
+
+##############
+
diff --git a/infobase/feisty_inits/dot.bashrc-root b/infobase/feisty_inits/dot.bashrc-root
new file mode 100644
index 00000000..20a9023f
--- /dev/null
+++ b/infobase/feisty_inits/dot.bashrc-root
@@ -0,0 +1,37 @@
+
+##############
+
+# provides a macro to initialize the feisty meow environment for the "root" user.
+
+##############
+
+# drag in the default version of this file. this may not be needed if your
+# .bashrc script already has substantial code or already does this.
+source /etc/bash.bashrc
+
+##############
+
+# set the history sizes to be much larger, and do this whether we load the
+# feisty meow environment or not.
+
+export HISTSIZE=1000000
+export HISTFILESIZE=8000000
+
+##############
+
+# system-wide install:
+export FEISTY_MEOW_APEX="/opt/feistymeow.org/feisty_meow"
+# personal install:
+#export FEISTY_MEOW_APEX="$HOME/feisty_meow"
+
+# the "fredme" macro enables the feisty_meow environment.
+alias fredme='source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"'
+
+# if not commented out, then feisty meow will run all the unit tests during builds.
+#export RUN_ALL_TESTS=true
+
+# turns on noisy debugging in feisty meow scripts if uncommented.
+#export DEBUG_FEISTY_MEOW=true
+
+##############
+
diff --git a/production/setup_src/whole_build_package/whole_build_manifest.txt b/production/setup_src/whole_build_package/whole_build_manifest.txt
index e12d8425..017b534b 100644
--- a/production/setup_src/whole_build_package/whole_build_manifest.txt
+++ b/production/setup_src/whole_build_package/whole_build_manifest.txt
@@ -8,9 +8,7 @@ production_inis=t
docs=t
top_makefile=t
production_makefile=t
-##customize=t
-database=t
-examples=t
+infobase=t
scripts=t
nucleus=t
octopi=t
@@ -70,7 +68,7 @@ keyword=sources
#recurse=1
#keyword=sources
-[database]
+[infobase]
source=$FEISTY_MEOW_APEX/infobase
target=$TARGET/infobase
recurse=1
@@ -82,12 +80,6 @@ target=$TARGET/documentation
recurse=1
keyword=sources
-[examples]
-source=$FEISTY_MEOW_APEX/examples
-target=$TARGET/examples
-recurse=1
-keyword=sources
-
[scripts]
source=$FEISTY_MEOW_APEX/scripts
target=$TARGET/scripts
diff --git a/readme.txt b/readme.txt
index c089a4e7..0fda046e 100644
--- a/readme.txt
+++ b/readme.txt
@@ -6,20 +6,21 @@ Quick Start Guide for the Feisty Meow Codebase
Commands that can be typed in a console or terminal are are prefixed with "#".
Information that varies by platform is prefixed with a '|' character.
+This documentation assumes that the code is stored in the default location:
+ /opt/feistymeow.org/feistymeow
+If you have stored it elsewhere, then please adapt the commands accordingly.
+
==============
How to get the feisty meow codebase
| On Microsoft Windows, install the Cygwin tools as documented here:
-| ~/feisty_meow/documentation/cygwin_install_list.txt (local file) or
+| /opt/feistymeow.org/feisty_meow/documentation/cygwin_install_list.txt (local file) or
| https://feistymeow.org/feisty_meow/documentation/cygwin_install_list.txt (web)
Retrieve a clone of the feisty meow codebase:
# git clone git://feistymeow.org/feisty_meow
-The remainder of these notes assume that the code is stored in:
- ~/feisty_meow (aka $HOME/feisty_meow).
-
==============
How to load the feisty meow script environment
@@ -27,17 +28,17 @@ How to load the feisty meow script environment
Set up the feisty_meow scripts; this is only needed once, when you first get
the codebase. It will also regenerate the scripts using the latest installed
version.
-# bash ~/feisty_meow/scripts/core/reconfigure_feisty_meow.sh
+# bash /opt/feistymeow.org/feisty_meow/scripts/core/reconfigure_feisty_meow.sh
Connect the feisty meow scripts to your login script (in ~/.bashrc).
Note that this actually modifies ~/.bashrc. This step is only needed once.
-# bash ~/feisty_meow/scripts/core/connect_feisty_meow.sh
+# bash /opt/feistymeow.org/feisty_meow/scripts/core/connect_feisty_meow.sh
Load the script environment into the current shell. This can be done for
any new shell. This is idempotent, so it does no harm to run it again.
Note that you should not need this step if you connected feisty meow to
~/.bashrc above.
-# source ~/feisty_meow/scripts/core/launch_feisty_meow.sh
+# source /opt/feistymeow.org/feisty_meow/scripts/core/launch_feisty_meow.sh
When the feisty meow script environment loaded, many new aliases and
functions are available for use. These come from the $FEISTY_MEOW_SCRIPTS
@@ -72,10 +73,6 @@ in the "nucleus", "octopi", "graphiq" and other C++ collections.
| Centos / Redhat / Fedora:
| # sudo yum install gcc gcc-c++ openssl-devel.x86_64 curl-devel
-| Microsoft Windows:
-| Download and install the Cygwin environment first from cygwin.com, which is
-| documented in ~/feisty_meow/documentation/cygwin_install_list.txt
-
The "kona" collection depends on Java version 8 or better.
| Ubuntu:
@@ -90,8 +87,7 @@ Run the following command to build the feisty meow libraries and applications.
# produce_feisty_meow
After the build is complete, the feisty meow applications can be found in
-$FEISTY_MEOW_BINARIES (environment variable).
-# ls $FEISTY_MEOW_BINARIES
+the folder pointed at by the $FEISTY_MEOW_BINARIES environment variable.
==============
diff --git a/scripts/archival/snarf_feisty_meow.pl b/scripts/archival/snarf_feisty_meow.pl
index d79a73f5..c695be73 100644
--- a/scripts/archival/snarf_feisty_meow.pl
+++ b/scripts/archival/snarf_feisty_meow.pl
@@ -42,9 +42,7 @@ local($root) = &canonicalize("$FEISTY_MEOW_APEX");
###moved &backup_hierarchy($snarf_file_base, $number, $root, "customize");
&backup_hierarchy($snarf_file_base, $number, $root, "infobase");
&backup_hierarchy($snarf_file_base, $number, $root, "documentation");
-&backup_hierarchy($snarf_file_base, $number, $root, "examples");
&backup_hierarchy($snarf_file_base, $number, $root, "experiments");
-&backup_hierarchy($snarf_file_base, $number, $root, "feisty_inits");
&backup_hierarchy($snarf_file_base, $number, $root, "graphiq");
&backup_hierarchy($snarf_file_base, $number, $root, "huffware");
&backup_hierarchy($snarf_file_base, $number, $root, "kona");
diff --git a/scripts/core/connect_feisty_meow.sh b/scripts/core/connect_feisty_meow.sh
index 6b235793..9a5c81d5 100644
--- a/scripts/core/connect_feisty_meow.sh
+++ b/scripts/core/connect_feisty_meow.sh
@@ -9,15 +9,17 @@ export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's work
# normalize the path we want to cobble together.
export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+echo calculated apex as $FEISTY_MEOW_APEX
+
if [ -f "$HOME/.bashrc" ] && grep -q "launch_feisty_meow.sh" "$HOME/.bashrc"; then
# the stanza for loading feisty meow already seems to be present.
echo "Feisty Meow already seems to be configured in '~/.bashrc'."
else
# stuff the normal user init file into .bashrc. not appropriate for root probably, but
# this is the easy quick start script for normal folks.
- cat $FEISTY_MEOW_APEX/feisty_inits/dot.bashrc-normal-user |
+ cat $FEISTY_MEOW_APEX/infobase/feisty_inits/dot.bashrc-normal-user |
sed -e \
- "s? \$.*/scripts/core/launch_feisty? $FEISTY_MEOW_APEX/scripts/core/launch_feisty?" \
+ "s?FEISTY_MEOW_APEX=\".*\"?FEISTY_MEOW_APEX=\"$FEISTY_MEOW_APEX\"?" \
>> "$HOME/.bashrc"
echo "Feisty Meow is now configured in '~/.bashrc'."
fi
diff --git a/scripts/core/generate_aliases.pl b/scripts/core/generate_aliases.pl
index 45ff8118..4ed01fb7 100644
--- a/scripts/core/generate_aliases.pl
+++ b/scripts/core/generate_aliases.pl
@@ -94,11 +94,13 @@ sub rebuild_script_aliases {
}
if (length($DEBUG_FEISTY_MEOW)) {
print "using these alias files:\n";
+print "HEY IS THIS PROBLEM CHILD?\n";
foreach $i (@ALIAS_DEFINITION_FILES) {
local $base_of_dir = &basename(&dirname($i));
local $basename = &basename($i);
print " $base_of_dir/$basename\n";
}
+print "WAS PROBLEM CHILD ABOVE HERE?\n";
}
# write the aliases for sh and bash scripts.
@@ -147,7 +149,7 @@ if ( ! length("$FEISTY_MEOW_LOADING_DOCK") ) {
The FEISTY_MEOW_LOADING_DOCK variable is not defined. This must point to\
the location where the generated scripts are stored. You may still need to\
configure the feisty meow script system with something like:\
- bash ~/feisty_meow/scripts/core/reconfigure_feisty_meow.sh\
+ bash /opt/feistymeow.org/feisty_meow/scripts/core/reconfigure_feisty_meow.sh\
Please see http://feistymeow.org for more details.\n";
exit 1;
#really need to use better exit codes.
diff --git a/scripts/core/launch_feisty_meow.sh b/scripts/core/launch_feisty_meow.sh
index 8b07cc3b..80226899 100644
--- a/scripts/core/launch_feisty_meow.sh
+++ b/scripts/core/launch_feisty_meow.sh
@@ -18,6 +18,27 @@
##############
+# this script cannot handle figuring out where it lives, so approaches that
+# get the WORKDIR will fail. this is a consequence of this always being used
+# in bash's 'source' directive, which does not pass the script name as
+# argument 0. instead, we just check for the bad condition of a malconfigured
+# script system and try to repair it.
+
+# check if any crucial folder is hosed. we will torch the existing config
+# to the extent we can.
+if [ ! -d "$FEISTY_MEOW_SCRIPTS" -o ! -d "$FEISTY_MEOW_APEX" ]; then
+ # wipe out the offending variable(s).
+ unset FEISTY_MEOW_SCRIPTS FEISTY_MEOW_APEX
+ # clean out any unfortunate wrongness that may exist in our generated areas.
+ if [ -d "$"FEISTY_MEOW_LOADING_DOCK ]; then \rm -rf "$FEISTY_MEOW_LOADING_DOCK"; fi
+ if [ -d "$FEISTY_MEOW_GENERATED_STORE" ]; then \rm -rf "$FEISTY_MEOW_GENERATED_STORE"; fi
+ # also wipe any values from the variables pointing at generated stuff.
+ unset FEISTY_MEOW_LOADING_DOCK FEISTY_MEOW_GENERATED_STORE
+ exec "$*"
+fi
+
+##############
+
# some preconditions we want to establish before loading anything...
# make sure that aliases can be used in non-interactive shells.
@@ -44,11 +65,10 @@ if [ -z "$FEISTY_MEOW_LOADING_DOCK" ]; then
# make sure our main variables are established.
FEISTY_MEOW_VARIABLES_LOADING_FILE="$FEISTY_MEOW_LOADING_DOCK/fmc_variables.sh"
if [ ! -f "$FEISTY_MEOW_VARIABLES_LOADING_FILE" ]; then
- echo -e '\n\n'
- example_dir="/usr/local/fred"
echo -e "\
+
The feisty meow scripts need initialization via the bootstrap process. For\n\
-example, if the feisty meow folder lives in '$example_dir', then this\n\
+example, if the feisty meow folder lives in '$DEFAULT_FEISTYMEOW_ORG_DIR', then this\n\
command bootstraps feisty meow:\n\
\n\
bash $example_dir/feisty_meow/scripts/core/reconfigure_feisty_meow.sh\n\
diff --git a/scripts/core/reconfigure_feisty_meow.sh b/scripts/core/reconfigure_feisty_meow.sh
index dad26d14..b6421224 100644
--- a/scripts/core/reconfigure_feisty_meow.sh
+++ b/scripts/core/reconfigure_feisty_meow.sh
@@ -7,7 +7,7 @@
#
# Note: this does not yet ensure that the profile is executed on shell
# startup. that can be added manually by editing your .bashrc file.
-# read the examples/feisty_meow_startup/bashrc_user file for more details.
+# read the files infobase/feisty_inits for more details.
ORIGINATING_FOLDER="$( \cd "$(\dirname "$0")" && /bin/pwd )"
CORE_SCRIPTS_DIR="$(echo "$ORIGINATING_FOLDER" | tr '\\\\' '/' )"
@@ -21,6 +21,9 @@ source "$CORE_SCRIPTS_DIR/functions.sh"
export FEISTY_MEOW_APEX="$(/bin/pwd)"
#echo feisty now is FEISTY_MEOW_APEX=$FEISTY_MEOW_APEX
+# make the variables script run again.
+unset CORE_VARIABLES_LOADED
+
# repetitive bit stolen from variables. should make a file out of this somehow.
IS_DOS=$(uname | grep -i ming)
if [ -z "$IS_DOS" ]; then IS_DOS=$(uname | grep -i cygwin); fi
@@ -42,7 +45,12 @@ if [ ! -d "$FEISTY_MEOW_LOADING_DOCK" ]; then
mkdir -p "$FEISTY_MEOW_LOADING_DOCK"
fi
# need to add some paths explicitly until we've bootstrapped ourselves.
-export PERLLIB=$PERLLIB:"$FEISTY_MEOW_SCRIPTS/files":"$FEISTY_MEOW_SCRIPTS/generator"
+#hmmm: this is tasty reusable code...
+export PERLLIB=$(echo $PERLLIB | sed -e "s?\([:]*\)\([^:]*feisty_meow[^:]*\)\([:]*\)??g")
+
+PERLLIB=$PERLLIB:"$FEISTY_MEOW_SCRIPTS/core":"$FEISTY_MEOW_SCRIPTS/files":"$FEISTY_MEOW_SCRIPTS/generator"
+PERL5LIB=$PERLLIB
+#echo PERLLIB after modification is $PERLLIB
# make toast out of generated files right away, but leave any custom scripts.
find "$FEISTY_MEOW_LOADING_DOCK" -maxdepth 1 -type f -exec perl "$FEISTY_MEOW_SCRIPTS/files/safedel.pl" "{}" ';'
# &>/dev/null
@@ -61,11 +69,13 @@ done
# load our variables so we can run our perl scripts successfully.
source "$FEISTY_MEOW_SCRIPTS/core/variables.sh"
-# create our common aliases.
-perl "$FEISTY_MEOW_SCRIPTS/core/generate_aliases.pl"
+# create our common aliases. we need to refresh the PERLLIB since the shell
+# seems to keep accumulating the value in a weird way.
+PERLLIB=$PERLLIB PERL5LIB=$PERLLIB perl "$FEISTY_MEOW_SCRIPTS/core/generate_aliases.pl"
+#echo after the generate aliases, perllib is $PERLLIB
if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then
- echo established these variables for feisty_meow assets:
+ echo this is the variable config file for feisty_meow assets:
echo ==============
cat "$FEISTY_MEOW_VARIABLES_LOADING_FILE"
echo ==============
diff --git a/scripts/core/variables.sh b/scripts/core/variables.sh
index 976c7898..b6311dac 100644
--- a/scripts/core/variables.sh
+++ b/scripts/core/variables.sh
@@ -56,6 +56,9 @@ if [ -z "$CORE_VARIABLES_LOADED" ]; then
# start with some simpler things.
+#hmmm: this needs to come from some configuration item. especially for installs.
+define_yeti_variable DEFAULT_FEISTYMEOW_ORG_DIR=/opt/feistymeow.org
+
define_yeti_variable SCRIPT_SYSTEM=feisty_meow
# OS variable records the operating system we think we found.
@@ -93,9 +96,12 @@ if [ -z "$CORE_VARIABLES_LOADED" ]; then
# this is only used for extreme failure modes, when the values were not
# pulled in from our auto-generated config.
if [ -z "$FEISTY_MEOW_APEX" ]; then
- if [ -d "$HOME/feisty_meow" ]; then
+ if [ -d "/opt/feistymeow.org/feisty_meow" ]; then
+ define_yeti_variable FEISTY_MEOW_APEX="/opt/feistymeow.org/feisty_meow"
+ define_yeti_variable FEISTY_MEOW_SCRIPTS="$FEISTY_MEOW_APEX/scripts"
+ elif [ -d "$HOME/feisty_meow" ]; then
define_yeti_variable FEISTY_MEOW_APEX="$HOME/feisty_meow"
- define_yeti_variable FEISTY_MEOW_SCRIPTS="$FEISTY_MEOW_SCRIPTS"
+ define_yeti_variable FEISTY_MEOW_SCRIPTS="$FEISTY_MEOW_APEX/scripts"
fi
fi
@@ -169,7 +175,6 @@ if [ -z "$CORE_VARIABLES_LOADED" ]; then
# variables for perl.
define_yeti_variable PERLLIB+="/usr/lib/perl5"
- define_yeti_variable PERL5LIB+="/usr/lib/perl5"
if [ "$OS" == "Windows_NT" ]; then
define_yeti_variable PERLIO=:perlio
# choose perl's IO over the ms-windows version so we can handle file
@@ -184,10 +189,10 @@ if [ -z "$CORE_VARIABLES_LOADED" ]; then
ls $i/*.pl &>/dev/null
if [ $? -eq 0 ]; then
PERLLIB+=":$(dos_to_unix_path $i)"
- PERL5LIB+=":$(dos_to_unix_path $i)"
fi
fi
done
+ define_yeti_variable PERL5LIB=$PERLLIB
#echo PERLLIB is now $PERLLIB
##############
diff --git a/scripts/customize/fred/refred.sh b/scripts/customize/fred/refred.sh
index 908e3bd5..2f00854a 100644
--- a/scripts/customize/fred/refred.sh
+++ b/scripts/customize/fred/refred.sh
@@ -15,8 +15,14 @@ function refred()
done
#echo arch addin now is: $arch_addin
+ # special case that makes our software hierarchy folder, if it doesn't exist.
+ # everything else is only re-permed if it exists.
+ if [ ! -d "$DEFAULT_FEISTYMEOW_ORG_DIR" ]; then
+ sudo mkdir "$DEFAULT_FEISTYMEOW_ORG_DIR"
+ fi
+
# iterate across the list of dirs we want fred to own and change their ownership.
- for dirname in /home/fred /usr/local/fred /home/games $arch_addin; do
+ for dirname in /home/fred $DEFAULT_FEISTYMEOW_ORG_DIR /usr/local/fred /home/games $arch_addin; do
if [ -d "$dirname" ]; then
echo "refred on '$dirname'"
sudo chown -R fred:fred $dirname
diff --git a/scripts/files/edit_files_matching.sh b/scripts/files/edit_files_matching.sh
index 98c57ed5..31662a3f 100644
--- a/scripts/files/edit_files_matching.sh
+++ b/scripts/files/edit_files_matching.sh
@@ -10,8 +10,8 @@ function print_instructions()
echo "for example:"
- echo " $(basename $0 .sh) ~/feisty_meow hoople.net hoople.org"
- echo "the above will search the directory ~/feisty_meow for all matches to"
+ echo " $(basename $0 .sh) $FEISTY_MEOW_APEX hoople.net hoople.org"
+ echo "the above will search the directory $FEISTY_MEOW_APEX for all matches to"
echo "the two patterns 'hoople.org' and 'hoople.net'."
exit 1
diff --git a/scripts/generator/build_variables.sh b/scripts/generator/build_variables.sh
index 3139aac7..c8a4c3ec 100644
--- a/scripts/generator/build_variables.sh
+++ b/scripts/generator/build_variables.sh
@@ -9,12 +9,12 @@
# building the source code. It can either be run as a bash script directly
# like so:
#
-# bash ~/feisty_meow/scripts/generator/build_variables.sh
+# bash $FEISTY_MEOW_APEX/scripts/generator/build_variables.sh
#
# which will establish a new shell containing all the variables, or you can
# 'source' the script like so:
#
-# build_vars=~/feisty_meow/scripts/generator/build_variables.sh
+# build_vars=$FEISTY_MEOW_APEX/scripts/generator/build_variables.sh
# source $build_vars $build_vars
#
# to set all of the variables in your current shell. The full path is
diff --git a/scripts/generator/show_version.sh b/scripts/generator/show_version.sh
new file mode 100644
index 00000000..5091b645
--- /dev/null
+++ b/scripts/generator/show_version.sh
@@ -0,0 +1,99 @@
+#!/bin/bash
+
+# increments the build version number.
+
+#mkdir -p "$TEMPORARIES_PILE"
+
+#hmmm: looks like repeated reusable code below (compare with next_version)
+export PARAMETER_FILE
+if [ ! -z "$BUILD_PARAMETER_FILE" ]; then
+ # define our version of the build parameter file. this should be set
+ # beforehand so we override the default parameter file for clam.
+ PARAMETER_FILE="$BUILD_PARAMETER_FILE"
+fi
+if [ -z "$PARAMETER_FILE" ]; then
+ # last ditch attempt to get one that will work.
+ PARAMETER_FILE="$FEISTY_MEOW_APEX/build.ini"
+fi
+
+#chmod u+w "$PARAMETER_FILE"
+
+#new_buildini="$(mktemp "$TEMPORARIES_PILE/buildini.XXXXXX")"
+## whack the file just in case.
+#rm -f "$new_buildini"
+#echo -n "" >"$new_buildini"
+
+# pick a weird separator that we hope never to see.
+IFS='~'
+
+found_version=""
+skip_line=""
+
+major_string=
+minor_string=
+revision_string=
+
+#hmmm: now i know i'm having deja vu. this loop is a big chunk of reusable code that should be abstracted from this file and from next_version
+
+while read line_found; do
+ if [ $? != 0 ]; then break; fi
+#echo line found is $line_found
+ if [ ! -z "$skip_line" ]; then
+ # we were told to skip this line to fix win32.
+ skip_line=""
+ continue
+ fi
+
+ # these checks don't care about whether we've seen other stuff yet.
+ if [ -z "$major_string" ]; then
+ if [ ! -z "$(echo $line_found | sed -n -e 's/^ *major *=.*$/yep/p')" ]; then
+ major_string=$(echo $line_found | sed -e 's/.*=\(.*\)$/\1/' )
+ fi
+ fi
+ if [ -z "$minor_string" ]; then
+ if [ ! -z "$(echo $line_found | sed -n -e 's/^ *minor *=.*$/yep/p')" ]; then
+ minor_string=$(echo $line_found | sed -e 's/.*=\(.*\)$/\1/' )
+ fi
+ fi
+
+ # we process the revision string line specially.
+ if [ -z "$found_version" ]; then
+ if [ "$line_found" == "#[version]" ]; then
+ # repair our special escape that makes this a valid ini file and
+ # gnu make include file.
+# echo -e "#\\\\\n[version]" >>"$new_buildini"
+ found_version="yes"
+ continue
+ elif [ "$line_found" == "#" ]; then
+ # retarded win32 case.
+# echo -e "#\\\\\n[version]" >>"$new_buildini"
+ found_version="yes"
+ skip_line="yes"
+ continue
+ fi
+ elif [ -z "$revision_string" ]; then
+ if [ ! -z "$(echo $line_found | sed -n -e 's/^ *revision *=.*$/yep/p')" ]; then
+ revision_string=$(echo $line_found | sed -e 's/.*=\(.*\)$/\1/' )
+#echo second part is $revision_string
+ revision_string=$(expr $revision_string + 1)
+# echo "revision=$revision_string" >>"$new_buildini"
+ # don't print the line normally also.
+ continue
+ fi
+ fi
+
+ # send the line with no special processing.
+# echo "$line_found" >>"$new_buildini"
+
+done <"$PARAMETER_FILE"
+
+## if we created something with contents, let's use it.
+#if [ -s "$new_buildini" ]; then
+# cp "$new_buildini" "$PARAMETER_FILE"
+#fi
+
+echo "Current build version is: $major_string.$minor_string.$revision_string"
+
+# don't leave the temporary version files floating around.
+#rm -f "$new_buildini"
+
diff --git a/scripts/system/add_apache_site.sh b/scripts/system/add_apache_site.sh
index 6b095634..e99f371a 100644
--- a/scripts/system/add_apache_site.sh
+++ b/scripts/system/add_apache_site.sh
@@ -16,6 +16,8 @@ function write_apache_config()
{
local appname="$1"; shift
local sitename="$1"; shift
+ local site_path="$1"; shift
+
local site_config="/etc/apache2/sites-available/${sitename}.conf"
# check if config file already exists and bail if so.
@@ -30,12 +32,19 @@ function write_apache_config()
echo "Creating a new apache2 site for $sitename with config file:"
echo " $site_config"
- # path where site gets checked out, in some arcane manner, and which happens to be
- # above the path where we put webroot (in the storage suffix, if defined).
- local path_above="${BASE_PATH}/${appname}"
- # no slash between appname and suffix, in case suffix is empty.
- local full_path="${BASE_PATH}/${appname}${STORAGE_SUFFIX}"
+ # if no path, then we default to our standard app storage location. otherwise, we
+ # put the site where they told us to.
+ if [ -z "$site_path" ]; then
+ # path where site gets checked out, in some arcane manner, and which happens to be
+ # above the path where we put webroot (in the storage suffix, if defined).
+ local path_above="${BASE_PATH}/${appname}"
+ # no slash between appname and suffix, in case suffix is empty.
+ local full_path="${path_above}${STORAGE_SUFFIX}"
#echo really full path is $full_path
+ else
+ # we'll go with their specification for the site storage.
+ local full_path="$site_path"
+ fi
echo "
# set up the user's web folder as an apache user web directory.
@@ -125,16 +134,24 @@ fi
appname="$1"; shift
site="$1"; shift
+site_path="$1"; shift
if [ -z "$appname" -o -z "$site" ]; then
- echo "This script needs to know (1) the appname (application name) for the new"
- echo "site and (2) the DNS name for the apache virtual host."
- echo "The appname should work as a file-system compatible folder name."
+#hmmm: move to a print_instructions function.
+ echo "
+$(basename $0): {app name} {dns name} [site path]
+
+This script needs to know (1) the application name for the new site and
+(2) the DNS name for the apache virtual host. The appname should be an
+appropriate name for a file-system compatible folder name. There is an
+optional third parameter (3) the path for site storage. If the site path
+is not provided, we'll use this path:
+ $BASE_PATH/{app name}/$STORAGE_SUFFIX"
exit 1
fi
maybe_create_site_storage "$appname"
-write_apache_config "$appname" "$site"
+write_apache_config "$appname" "$site" "$site_path"
enable_site "$site"
restart_apache