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.
+++ /dev/null
-
-##############
-
-# 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
-
-##############
-
+++ /dev/null
-
-##############
-
-# 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/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
-
-##############
-
--- /dev/null
+
+##############
+
+# 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
+
+##############
+
--- /dev/null
+
+##############
+
+# 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
+
+##############
+
docs=t
top_makefile=t
production_makefile=t
-##customize=t
-database=t
-examples=t
+infobase=t
scripts=t
nucleus=t
octopi=t
#recurse=1
#keyword=sources
-[database]
+[infobase]
source=$FEISTY_MEOW_APEX/infobase
target=$TARGET/infobase
recurse=1
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
###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");
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?FEISTY_MEOW_APEX=\".*\"?FEISTY_MEOW_APEX=\"$FEISTY_MEOW_APEX\"?" \
>> "$HOME/.bashrc"
}
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.
##############
+# 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.
#
# 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 '\\\\' '/' )"
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
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
# 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 ==============
# 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
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
##############
--- /dev/null
+#!/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"
+
{
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.
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.
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