bash ~/feisty_meow/scripts/generator/produce_feisty_meow.sh
- All the applications can be found in $BINDIR
+ All the applications can be found in $FEISTY_MEOW_BINARIES
after the build is complete.
Cleaning the Codebase:
int test_runs = 10000;
time_stamp start; // start of test.
- astring bins = environment::get("$BINDIR");
+ astring bins = environment::get("$FEISTY_MEOW_BINARIES");
astring app = bins + "/example_application";
// save real stdout.
int real_stdout = dup(1);
[manifest]
-output=$BINDIR/manifest.txt
+output=$FEISTY_MEOW_BINARIES/manifest.txt
[searches]
DEFINE_OUTCOME=1
binaries=t
clam_bin=t
packages=t
-#win32_helper=t
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
target=$TARGET/runtime/packages
recurse=1
-#[win32_helper]
-#source=$PRODUCTION_DIR/win32_helper
-#target=$TARGET/production/win32_helper
-#recurse=1
&backup_hierarchy($snarf_file_base, $number, "$root", "production/assign_bases");
&backup_hierarchy($snarf_file_base, $number, "$root", "production/check_versions");
&backup_hierarchy($snarf_file_base, $number, "$root", "production/setup_src");
-#old &backup_hierarchy($snarf_file_base, $number, "$root", "production/win32_helper");
# now rename the file so only the unpacker can access it.
&rename_archive($snarf_file);
# this script needs to run as root. it will copy all the important
# assets for cgi into the right places.
+echo "antiquated approach, we now do this with links instead."
+exit 1
+
cd ~/feisty_meow/scripts/cgi
cp call_version_utils.sh cgi_cat.pl cgi_display.pl cgi_nechung.cgi cgi_show_file_date.sh \
count.cgi nechung.cgi \
cp fortunes.dat \
/usr/lib/cgi-bin
-cp $BINDIR/*nechung* /usr/lib/cgi-bin
+cp $FEISTY_MEOW_BINARIES/*nechung* /usr/lib/cgi-bin
chmod a+x /usr/lib/cgi-bin/*
done
}
+ ############################
+
# takes a file to modify, and then it will replace any occurrences of the
# pattern provided as the second parameter with the text in the third
# parameter.
sed -i -e "s%$pattern%$replacement%g" "$file"
}
+ # similar to replace_pattern_in_file, but also will add the new value
+ # when the old one did not already exist in the file.
+ function replace_if_exists_or_add()
+ {
+ local file="$1"; shift
+ local phrase="$1"; shift
+ local replacement="$1"; shift
+ if [ -z "$file" -o ! -f "$file" -o -z "$phrase" -o -z "$replacement" ]; then
+ echo "replace_if_exists_or_add: needs a filename, a phrase to replace, and the"
+ echo "text to replace that phrase with."
+ return 1
+ fi
+ grep "$phrase" "$file" >/dev/null
+ # replace if the phrase is there, otherwise add it.
+ if [ $? -eq 0 ]; then
+ replace_pattern_in_file "$file" "$phrase" "$replacement"
+ else
+ # this had better be the complete line.
+ echo "$replacement" >>"$file"
+ fi
+ }
+
+ ############################
+
+ # finds a variable (first parameter) in a particular property file
+ # (second parameter). the expected format for the file is:
+ # varX=valueX
+ function seek_variable()
+ {
+ local find_var="$1"; shift
+ local file="$1"; shift
+ if [ -z "$find_var" -o -z "$file" -o ! -f "$file" ]; then
+ echo -e "seek_variable: needs two parameters, firstly a variable name, and\nsecondly a file where the variable's value will be sought." 1>&2
+ return 1
+ fi
+
+ while read line; do
+ if [ ${#line} -eq 0 ]; then continue; fi
+ # split the line into the variable name and value.
+ IFS='=' read -a assignment <<< "$line"
+ local var="${assignment[0]}"
+ local value="${assignment[1]}"
+ if [ "${value:0:1}" == '"' ]; then
+ # assume the entry was in quotes and remove them.
+ value="${value:1:$((${#value} - 2))}"
+ fi
+ if [ "$find_var" == "$var" ]; then
+ echo "$value"
+ fi
+ done < "$file"
+ }
+
+ # finds a variable (first parameter) in a particular XML format file
+ # (second parameter). the expected format for the file is:
+ # ... name="varX" value="valueX" ...
+ function seek_variable_in_xml()
+ {
+ local find_var="$1"; shift
+ local file="$1"; shift
+ if [ -z "$find_var" -o -z "$file" -o ! -f "$file" ]; then
+ echo "seek_variable_in_xml: needs two parameters, firstly a variable name, and"
+ echo "secondly an XML file where the variable's value will be sought."
+ return 1
+ fi
+
+ while read line; do
+ if [ ${#line} -eq 0 ]; then continue; fi
+ # process the line to make it more conventional looking.
+ line="$(echo "$line" | sed -e 's/.*name="\([^"]*\)" value="\([^"]*\)"/\1=\2/')"
+ # split the line into the variable name and value.
+ IFS='=' read -a assignment <<< "$line"
+ local var="${assignment[0]}"
+ local value="${assignment[1]}"
+ if [ "${value:0:1}" == '"' ]; then
+ # assume the entry was in quotes and remove them.
+ value="${value:1:$((${#value} - 2))}"
+ fi
+ if [ "$find_var" == "$var" ]; then
+ echo "$value"
+ fi
+ done < "$file"
+ }
+
+ ############################
+
# goes to a particular directory passed as parameter 1, and then removes all
# the parameters after that from that directory.
function push_whack_pop()
require "filename_helper.pl";
-use Env qw(BINDIR BUILD_TOP FEISTY_MEOW_APEX FEISTY_MEOW_LOADING_DOCK FEISTY_MEOW_SCRIPTS SHELL_DEBUG );
+use Env qw(FEISTY_MEOW_BINARIES BUILD_TOP FEISTY_MEOW_APEX FEISTY_MEOW_LOADING_DOCK FEISTY_MEOW_SCRIPTS SHELL_DEBUG );
# given a possible aliasable filename, this will decide whether to create a perl
# or bash alias for it. it needs the filename of the possible alias and the
##############
# set the executable bit for binaries for just this current user.
-if (-d $BINDIR) {
- system("chmod -R u+x \"$BINDIR\"/*");
+if (-d $FEISTY_MEOW_BINARIES) {
+ system("chmod -R u+x \"$FEISTY_MEOW_BINARIES\"/*");
}
# generate the first set of alias files that are defined in the core
fi
# decide whether they've got splitter available or not.
-if [ -f "$BINDIR/splitter" -o -f "$BINDIR/splitter.exe" ]; then
+if [ -f "$FEISTY_MEOW_BINARIES/splitter" -o -f "$FEISTY_MEOW_BINARIES/splitter.exe" ]; then
# calculate the number of columsn in the terminal.
cols=$(stty size | awk '{print $2}')
- splitter="$BINDIR/splitter --maxcol $(($cols - 1))"
+ splitter="$FEISTY_MEOW_BINARIES/splitter --maxcol $(($cols - 1))"
else
# not available, so just emit as huge overly long string.
splitter="cat"
# now augment the environment if we found our build variables.
if [ $found_build_vars == 1 ]; then
# the binary directory contains our collection of handy programs.
- define_yeti_variable BINDIR=$TARGETS_DIR
+ define_yeti_variable FEISTY_MEOW_BINARIES=$TARGETS_DIR
# add binaries created within build to the path.
- define_yeti_variable PATH="$(dos_to_unix_path $BINDIR):$PATH"
+ define_yeti_variable PATH="$(dos_to_unix_path $FEISTY_MEOW_BINARIES):$PATH"
# Shared libraries are located via this variable.
- define_yeti_variable LD_LIBRARY_PATH="$(dos_to_unix_path $LD_LIBRARY_PATH):$(dos_to_unix_path $BINDIR)"
+ define_yeti_variable LD_LIBRARY_PATH="$(dos_to_unix_path $LD_LIBRARY_PATH):$(dos_to_unix_path $FEISTY_MEOW_BINARIES)"
fi
}
function setup_visual_studio_variables()
{
-# chmod 755 $PRODUCTION_DIR/win32_helper/*.exe
-# export PATH="$(dos_to_unix_path $PRODUCTION_DIR)/win32_helper:$PATH"
-
# we try to use the most recent compiler location, and work backwards as
# needed for the supported range (10 = vs 2010, 9 = vs 2008, 8 = vs 2005).
export VSxTOOLS="$VS100COMNTOOLS"
{
start_background_action \
'echo "your nechung oracle pronouncement of the moment..."' \
- '$BINDIR/nechung'
+ '$FEISTY_MEOW_BINARIES/nechung'
}
function sum_dir()
echo "<br>"
echo "<br>"
echo "--<br>"
-$BINDIR/nechung
+$FEISTY_MEOW_BINARIES/nechung
print FILE "_______ chosen by the Nechung Oracle Program [ http://gruntose.com/ ] _______\n";
print FILE "\n";
close(FILE);
-local($bindir) = $ENV{'BINDIR'};
+local($bindir) = $ENV{'FEISTY_MEOW_BINARIES'};
$bindir = &sanitize_name($bindir);
system("$bindir/nechung >>$temp_filename");
###always hits this. nechung gives an error? || die "couldn't run nechung.";