local project_built=
local defines_override=
local process=
+ local verbosity="normal"
local enable_shared=
local enable_static=
do_color=none
elif [[ $p == "+l" || $p == "++light" ]] ; then
do_color=light
+ elif [[ $p == "+q" || $p == "++quiet" ]] ; then
+ verbosity="quiet"
+ verbose=
elif [[ $p == "+v" || $p == "++version" ]] ; then
echo $version
return
+ elif [[ $p == "+V" || $p == "++verbose" ]] ; then
+ verbosity="verbose"
+ verbose="-v"
elif [[ $p == "-d" || $p == "--defines" ]] ; then
grab_next=defines_override
elif [[ $p == "-m" || $p == "--mode" ]] ; then
# FSS and Featurless Make supports more flexible mode names, but for the purpose of this bootstrap script and avoiding potential problems, keep it simple.
if [[ $mode != "" && $(echo "$mode" | grep -s -o "[^_[:alnum:]+-]") != "" ]] ; then
- echo -e "${c_error}ERROR: the mode $c_notice$mode$c_error includes invalid characters, only alphanumeric, underscore, minus, and plus are allowed.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the mode $c_notice$mode$c_error includes invalid characters, only alphanumeric, underscore, minus, and plus are allowed.$c_reset"
+ fi
+
bootstrap_cleanup
return 1
fi
mode=${variables[$(bootstrap_id modes_default)]}
if [[ $mode != "" && $(echo "$mode" | grep -s -o "[^_[:alnum:]+-]") != "" ]] ; then
- echo -e "${c_error}ERROR: the mode $c_notice$mode$c_error includes invalid characters, only alphanumeric, underscore, minus, and plus are allowed.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the mode $c_notice$mode$c_error includes invalid characters, only alphanumeric, underscore, minus, and plus are allowed.$c_reset"
+ fi
+
bootstrap_cleanup
return 1
fi
if [[ ${variables[$(bootstrap_id modes)]} == "" ]] ; then
if [[ $mode != "" ]] ; then
- echo -e "${c_error}ERROR: the mode $c_notice$mode$c_error is not a valid mode, there are no available modes.$c_error$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the mode $c_notice$mode$c_error is not a valid mode, there are no available modes.$c_error$c_reset"
+ fi
+
bootstrap_cleanup
return 1
fi
done
if [[ $i -eq 0 ]] ; then
- echo -e "${c_error}ERROR: the mode $c_notice$mode$c_error is not a valid mode, it must be one of: $c_notice${variables[$(bootstrap_id modes)]}$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the mode $c_notice$mode$c_error is not a valid mode, it must be one of: $c_notice${variables[$(bootstrap_id modes)]}$c_error.$c_reset"
+ fi
+
bootstrap_cleanup
return 1
fi
fi
if [[ ${variables[$(bootstrap_id project_name)]} == "" ]] ; then
- echo -e "${c_error}ERROR: the required setting '${c_notice}project_name$c_error' is not specified in the build settings file '$c_notice$settings_file$c_error'.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the required setting '${c_notice}project_name$c_error' is not specified in the build settings file '$c_notice$settings_file$c_error'.$c_reset"
+ fi
+
bootstrap_cleanup
return 1
fi
if [[ ${variables[$(bootstrap_id version_major)]} == "" ]] ; then
- echo -e "${c_error}ERROR: the required setting '${c_notice}version_major$c_error' is not specified in the build settings file '$c_notice$settings_file$c_error'.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the required setting '${c_notice}version_major$c_error' is not specified in the build settings file '$c_notice$settings_file$c_error'.$c_reset"
+ fi
+
bootstrap_cleanup
return 1
fi
if [[ ${variables[$(bootstrap_id version_minor)]} == "" ]] ; then
- echo -e "${c_error}ERROR: the required setting '${c_notice}version_minor$c_error' is not specified in the build settings file '$c_notice$settings_file$c_error'.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the required setting '${c_notice}version_minor$c_error' is not specified in the build settings file '$c_notice$settings_file$c_error'.$c_reset"
+ fi
+
bootstrap_cleanup
return 1
fi
if [[ ${variables[$(bootstrap_id version_micro)]} == "" ]] ; then
- echo -e "${c_error}ERROR: the required setting '${c_notice}version_micro$c_error' is not specified in the build settings file '$c_notice$settings_file$c_error'.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the required setting '${c_notice}version_micro$c_error' is not specified in the build settings file '$c_notice$settings_file$c_error'.$c_reset"
+ fi
+
bootstrap_cleanup
return 1
fi
if [[ $path_data == "" || ! -d $path_data ]] ; then
- echo -e "${c_error}ERROR: the data directory $c_notice$path_data$c_error is not a valid directory.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the data directory $c_notice$path_data$c_error is not a valid directory.$c_reset"
+ fi
+
bootstrap_cleanup
return 1
fi
if [[ $path_sources == "" || ! -d $path_sources ]] ; then
- echo -e "${c_error}ERROR: the sources directory $c_notice$path_sources$c_error is not a valid directory.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the sources directory $c_notice$path_sources$c_error is not a valid directory.$c_reset"
+ fi
+
bootstrap_cleanup
return 1
fi
if [[ $path_work != "" && ! -d $path_work ]] ; then
- echo -e "${c_error}ERROR: the work directory $c_notice$path_work$c_error is not a valid directory.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the work directory $c_notice$path_work$c_error is not a valid directory.$c_reset"
+ fi
+
bootstrap_cleanup
return 1
fi
if [[ $defines_override != "" && $(echo "$defines_override" | grep -s -o "[^_[:alnum:][:space:]]") != "" ]] ; then
- echo -e "${c_error}ERROR: the defines override $c_notice$defines_override$c_error includes invalid characters, only alphanumeric, whitespace, and underscore are allowed.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the defines override $c_notice$defines_override$c_error includes invalid characters, only alphanumeric, whitespace, and underscore are allowed.$c_reset"
+ fi
+
bootstrap_cleanup
return 1
fi
if [[ $operation_failure == "fail-multiple" ]] ; then
- echo -e "${c_error}ERROR: only one operation may be specified at a time.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: only one operation may be specified at a time.$c_reset"
+ fi
+
bootstrap_cleanup
return 1
elif [[ $operation == "build" ]] ; then
if [[ -f ${project_built}.built ]] ; then
- echo -e "${c_warning}WARNING: this project has already been built.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_warning}WARNING: this project has already been built.$c_reset"
+ fi
else
if [[ ! -f ${project_built}.prepared ]] ; then
bootstrap_prepare_build
elif [[ $operation == "clean" ]] ; then
bootstrap_operation_clean
elif [[ $operation == "" ]] ; then
- echo -e "${c_error}ERROR: no operation was given.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: no operation was given.$c_reset"
+ fi
+
bootstrap_cleanup
return 1
else
- echo -e "${c_error}ERROR: the operation $c_notice$operation$c_error was not recognized.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the operation $c_notice$operation$c_error was not recognized.$c_reset"
+ fi
+
bootstrap_cleanup
return 1
fi
echo -e " -${c_important}h$c_reset, --${c_important}help$c_reset Print this help screen."
echo -e " +${c_important}l$c_reset, ++${c_important}light$c_reset Use color modes that show up better on light backgrounds."
echo -e " +${c_important}n$c_reset, ++${c_important}no_color$c_reset Do not use color."
+ echo -e " +${c_important}q$c_reset, ++${c_important}quiet$c_reset Decrease verbosity beyond normal output."
+ echo -e " +${c_important}V$c_reset, ++${c_important}verbose$c_reset Increase verbosity beyond normal output."
echo -e " +${c_important}v$c_reset, ++${c_important}version$c_reset Print the version number of this program."
echo
echo -e "${c_highlight}Bootstrap Options:$c_reset"
local key=
if [[ ! -d ${path_data}build/ ]] ; then
- echo -e "${c_error}ERROR: no build settings directory '$c_notice${path_data}build/$c_error' could not be found or is not a valid directory.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: no build settings directory '$c_notice${path_data}build/$c_error' could not be found or is not a valid directory.$c_reset"
+ fi
+
failure=1
elif [[ ! -f $settings_file ]] ; then
- echo -e "${c_error}ERROR: no settings file $c_notice$settings_file$c_error could not be found or is not a valid file.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: no settings file $c_notice$settings_file$c_error could not be found or is not a valid file.$c_reset"
+ fi
+
failure=1
fi
local alt=$1
local i=
- mkdir -vp ${path_build}{documents,includes,libraries/{script,shared,static},objects,programs/{script,shared,static},settings,stage} || failure=1
+ mkdir $verbose -p ${path_build}{documents,includes,libraries/{script,shared,static},objects,programs/{script,shared,static},settings,stage} || failure=1
if [[ $failure == "" ]] ; then
for i in ${variables[$(bootstrap_id path_headers)]} ; do
- mkdir -vp ${path_build}includes/$i || failure=1
+ mkdir $verbose -p ${path_build}includes/$i || failure=1
done
fi
fi
if [[ $shared != "yes" && $static != "yes" ]] ; then
- echo -e "${c_error}ERROR: Cannot Build, either build_shared or build_static must be set to 'yes'.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: Cannot Build, either build_shared or build_static must be set to 'yes'.$c_reset"
+ fi
+
bootstrap_cleanup
exit -1
fi
if [[ $search_shared != "yes" && $search_static != "yes" ]] ; then
- echo -e "${c_error}ERROR: Cannot Build, either search_shared or search_static must be set to 'yes'.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: Cannot Build, either search_shared or search_static must be set to 'yes'.$c_reset"
+ fi
+
bootstrap_cleanup
exit -1
fi
for i in $sources_library ; do
if [[ $i != "$(echo $i | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then
- echo -e "${c_error}ERROR: Cannot Build, invalid source_library path provided: '$i'.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: Cannot Build, invalid source_library path provided: '$i'.$c_reset"
+ fi
+
bootstrap_cleanup
exit -1
fi
for i in $sources_program ; do
if [[ $i != "$(echo $i | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then
- echo -e "${c_error}ERROR: Cannot Build, invalid sources_program path provided: '$i'.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: Cannot Build, invalid sources_program path provided: '$i'.$c_reset"
+ fi
+
bootstrap_cleanup
exit -1
fi
for i in $sources_headers ; do
if [[ $i != "$(echo $i | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then
- echo -e "${c_error}ERROR: Cannot Build, invalid sources_headers path provided: '$i'.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: Cannot Build, invalid sources_headers path provided: '$i'.$c_reset"
+ fi
+
bootstrap_cleanup
exit -1
fi
for i in $sources_bash ; do
if [[ $i != "$(echo $i | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then
- echo -e "${c_error}ERROR: Cannot Build, invalid sources_bash path provided: '$i'.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: Cannot Build, invalid sources_bash path provided: '$i'.$c_reset"
+ fi
+
bootstrap_cleanup
exit -1
fi
for i in $sources_setting ; do
if [[ $i != "$(echo $i | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then
- echo -e "${c_error}ERROR: Cannot Build, invalid sources_setting path provided: '$i'.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: Cannot Build, invalid sources_setting path provided: '$i'.$c_reset"
+ fi
+
bootstrap_cleanup
exit -1
fi
directory=$(dirname $i)
if [[ $directory == "." ]] ; then
- cp -vR $path_settings$i ${path_build}settings/ || failure=1
+ cp $verbose -R $path_settings$i ${path_build}settings/ || failure=1
else
- mkdir -vp ${path_build}settings/$directory || failure=1
+ mkdir $verbose -p ${path_build}settings/$directory || failure=1
if [[ $failure == "" ]] ; then
- cp -vR $path_settings$i ${path_build}settings/${directory}/ || failure=1
+ cp $verbose -R $path_settings$i ${path_build}settings/${directory}/ || failure=1
fi
fi
done
directory=$(dirname $i)
if [[ $directory == "." ]] ; then
- cp -vf $path_c$i ${path_build}includes/ || failure=1
+ cp $verbose -f $path_c$i ${path_build}includes/ || failure=1
else
- mkdir -vp ${path_build}includes/$directory || failure=1
+ mkdir $verbose -p ${path_build}includes/$directory || failure=1
if [[ $failure == "" ]] ; then
- cp -vf $path_c$i ${path_build}includes/$i || failure=1
+ cp $verbose -f $path_c$i ${path_build}includes/$i || failure=1
fi
fi
done
else
for i in $sources_headers ; do
- cp -vf $path_c$i ${path_build}includes/$path_headers/ || failure=1
+ cp $verbose -f $path_c$i ${path_build}includes/$path_headers/ || failure=1
done
fi
fi
sources="$sources$path_c$i "
done
- echo $compiler $sources -shared -Wl,-soname,lib$name.so.$version -o ${path_build}libraries/shared/lib$name.so.$major.$minor.$micro $arguments_shared $arguments_include $libraries $flags_all $flags_shared $flags_library
+ if [[ $verbosity == "verbose" ]] ; then
+ echo $compiler $sources -shared -Wl,-soname,lib$name.so.$version -o ${path_build}libraries/shared/lib$name.so.$major.$minor.$micro $arguments_shared $arguments_include $libraries $flags_all $flags_shared $flags_library
+ fi
+
$compiler $sources -shared -Wl,-soname,lib$name.so.$version -o ${path_build}libraries/shared/lib$name.so.$major.$minor.$micro $arguments_shared $arguments_include $libraries $flags_all $flags_shared $flags_library || failure=1
if [[ $failure == "" ]] ; then
- ln -vsf lib$name.so.$major.$minor.$micro ${path_build}libraries/shared/lib$name.so.$major || failure=1
- ln -vsf lib$name.so.$major ${path_build}libraries/shared/lib$name.so || failure=1
+ ln $verbose -sf lib$name.so.$major.$minor.$micro ${path_build}libraries/shared/lib$name.so.$major || failure=1
+ ln $verbose -sf lib$name.so.$major ${path_build}libraries/shared/lib$name.so || failure=1
fi
fi
sources="$sources$path_c$i "
done
- echo $compiler $sources -o ${path_build}programs/shared/$name $arguments_shared $arguments_include $links $libraries $flags_all $flags_shared $flags_program
+ if [[ $verbosity == "verbose" ]] ; then
+ echo $compiler $sources -o ${path_build}programs/shared/$name $arguments_shared $arguments_include $links $libraries $flags_all $flags_shared $flags_program
+ fi
+
$compiler $sources -o ${path_build}programs/shared/$name $arguments_shared $arguments_include $links $libraries $flags_all $flags_shared $flags_program || failure=1
fi
fi
n=$(basename $i | sed -e 's|\.c$||')
if [[ $directory != "." && ! -d ${path_build}objects/$directory ]] ; then
- mkdir -vp ${path_build}objects/$directory
+ mkdir $verbose -p ${path_build}objects/$directory
if [[ $? -ne 0 ]] ; then
failure=1
sources="$sources${path_build}objects/$directory/$n.o "
- echo $compiler $path_c$i -c -static -o ${path_build}objects/$directory/$n.o $arguments_static $arguments_include $libraries $flags_all $flags_static $flags_library
+ if [[ $verbosity == "verbose" ]] ; then
+ echo $compiler $path_c$i -c -static -o ${path_build}objects/$directory/$n.o $arguments_static $arguments_include $libraries $flags_all $flags_static $flags_library
+ fi
+
$compiler $path_c$i -c -static -o ${path_build}objects/$directory/$n.o $arguments_static $arguments_include $libraries $flags_all $flags_static $flags_library || failure=1
if [[ $failure == "1" ]] ; then
done
if [[ $failure == "" ]] ; then
- echo $linker rcs ${path_build}libraries/static/lib$name.a $sources
+ if [[ $verbosity == "verbose" ]] ; then
+ echo $linker rcs ${path_build}libraries/static/lib$name.a $sources
+ fi
+
$linker rcs ${path_build}libraries/static/lib$name.a $sources || failure=1
fi
fi
sources="$sources$path_c$i "
done
- echo $compiler $sources -static -o ${path_build}programs/static/$name $arguments_static $arguments_include $links $libraries $flags_all $flags_static $flags_program
+ if [[ $verbosity == "verbose" ]] ; then
+ echo $compiler $sources -static -o ${path_build}programs/static/$name $arguments_static $arguments_include $links $libraries $flags_all $flags_static $flags_program
+ fi
+
$compiler $sources -static -o ${path_build}programs/static/$name $arguments_static $arguments_include $links $libraries $flags_all $flags_static $flags_program || failure=1
fi
fi
if [[ $failure != "" ]] ; then
- echo -e "${c_error}ERROR: failed to build.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to build.$c_reset"
+ fi
+
bootstrap_cleanup
exit $failure
fi
for i in ${path_build}{documents,includes,libraries,objects,programs,settings,stage} ; do
if [[ -e $i ]] ; then
- rm -vRf $i
+ rm $verbose -Rf $i
fi
done
if [[ -f ${project_built}.prepared ]] ; then
- rm -vf ${project_built}.prepared
+ rm $verbose -f ${project_built}.prepared
fi
if [[ -f ${project_built}.built ]] ; then
- rm -vf ${project_built}.built
+ rm $verbose -f ${project_built}.built
fi
}
local settings_file=data/build/settings
local operation=
local operation_failure=
+ local verbosity="normal"
+ local verbose=
local path_build=build/
local path_programs=programs/
do_color=none
elif [[ $p == "+l" || $p == "++light" ]] ; then
do_color=light
+ elif [[ $p == "+q" || $p == "++quiet" ]] ; then
+ verbosity="quiet"
+ verbose=
elif [[ $p == "+v" || $p == "++version" ]] ; then
echo $version
return
+ elif [[ $p == "+V" || $p == "++verbose" ]] ; then
+ verbosity="verbose"
+ verbose="-v"
elif [[ $p == "-b" || $p == "--build" ]] ; then
grab_next=path_build
elif [[ $p == "-s" || $p == "--settings" ]] ; then
fi
if [[ $operation_failure == "fail-unsupported" ]] ; then
- echo -e "${c_error}ERROR: the operation $c_notice$operation$c_error was not recognized.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the operation $c_notice$operation$c_error was not recognized.$c_reset"
+ fi
+
install_cleanup
return 1
fi
if [[ $prefix == "" && ! -d $path_build ]] ; then
- echo -e "${c_error}ERROR: the build path $c_notice$path_build$c_error is not a valid directory.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the build path $c_notice$path_build$c_error is not a valid directory.$c_reset"
+ fi
+
install_cleanup
return 1
fi
if [[ $destination_prefix != "" && ! -d $destination_prefix ]] ; then
- echo -e "${c_error}ERROR: the destination prefix $c_notice$destination_prefix$c_error is not a valid directory.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the destination prefix $c_notice$destination_prefix$c_error is not a valid directory.$c_reset"
+ fi
+
install_cleanup
return 1
fi
fi
if [[ $work != "" && ! -d $work ]] ; then
- echo -e "${c_error}ERROR: the work directory $c_notice$work$c_error is not a valid directory.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the work directory $c_notice$work$c_error is not a valid directory.$c_reset"
+ fi
+
install_cleanup
return 1
fi
if [[ ! -d $destination_programs ]] ; then
- echo -e "${c_error}ERROR: the destination bindir $c_notice$destination_programs$c_error is not a valid directory.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the destination bindir $c_notice$destination_programs$c_error is not a valid directory.$c_reset"
+ fi
+
install_cleanup
return 1
fi
if [[ ! -d $destination_programs_static ]] ; then
- echo -e "${c_error}ERROR: the destination (static) bindir $c_notice$destination_programs_static$c_error is not a valid directory.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the destination (static) bindir $c_notice$destination_programs_static$c_error is not a valid directory.$c_reset"
+ fi
+
install_cleanup
return 1
fi
if [[ ! -d $destination_programs_shared ]] ; then
- echo -e "${c_error}ERROR: the destination (shared) bindir $c_notice$destination_programs_shared$c_error is not a valid directory.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the destination (shared) bindir $c_notice$destination_programs_shared$c_error is not a valid directory.$c_reset"
+ fi
+
install_cleanup
return 1
fi
if [[ ! -d $destination_includes ]] ; then
- echo -e "${c_error}ERROR: the destination incluedir $c_notice$destination_includes$c_error is not a valid directory.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the destination incluedir $c_notice$destination_includes$c_error is not a valid directory.$c_reset"
+ fi
+
install_cleanup
return 1
fi
if [[ ! -d $destination_libraries_static ]] ; then
- echo -e "${c_error}ERROR: the destination (static) libdir $c_notice$destination_libraries_static$c_error is not a valid directory.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the destination (static) libdir $c_notice$destination_libraries_static$c_error is not a valid directory.$c_reset"
+ fi
+
install_cleanup
return 1
fi
if [[ ! -d $destination_libraries_shared ]] ; then
- echo -e "${c_error}ERROR: the destination (shared) libdir $c_notice$destination_libraries_shared$c_error is not a valid directory.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the destination (shared) libdir $c_notice$destination_libraries_shared$c_error is not a valid directory.$c_reset"
+ fi
+
install_cleanup
return 1
fi
echo -e " -${c_important}h$c_reset, --${c_important}help$c_reset Print this help screen."
echo -e " +${c_important}l$c_reset, ++${c_important}light$c_reset Use color modes that show up better on light backgrounds."
echo -e " +${c_important}n$c_reset, ++${c_important}no_color$c_reset Do not use color."
+ echo -e " +${c_important}q$c_reset, ++${c_important}quiet$c_reset Decrease verbosity beyond normal output."
+ echo -e " +${c_important}V$c_reset, ++${c_important}verbose$c_reset Increase verbosity beyond normal output."
echo -e " +${c_important}v$c_reset, ++${c_important}version$c_reset Print the version number of this program."
echo
echo -e "${c_highlight}Install Options:$c_reset"
local i=
if [[ $settings_file == "" ]] ; then
- echo -e "${c_error}ERROR: no settings file has been defined.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: no settings file has been defined.$c_reset"
+ fi
+
failure=1
elif [[ ! -f $settings_file ]] ; then
- echo -e "${c_error}ERROR: no settings file $c_notice$settings_file$c_error could not be found or is not a valid file.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: no settings file $c_notice$settings_file$c_error could not be found or is not a valid file.$c_reset"
+ fi
+
failure=1
fi
if [[ $work != "" ]] ; then
if [[ ! -d ${work}programs ]] ; then
- mkdir -v ${work}programs
+ mkdir $verbose ${work}programs
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create work directories $c_notice${work}programs$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create work directories $c_notice${work}programs$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ ! -d ${work}programs/shared ]] ; then
- mkdir -v ${work}programs/shared
+ mkdir $verbose ${work}programs/shared
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create work directories $c_notice${work}programs/shared$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create work directories $c_notice${work}programs/shared$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ ! -d ${work}programs/static ]] ; then
- mkdir -v ${work}programs/static
+ mkdir $verbose ${work}programs/static
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create work directories $c_notice${work}programs/static$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create work directories $c_notice${work}programs/static$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ ! -d ${work}libraries ]] ; then
- mkdir -v ${work}libraries
+ mkdir $verbose ${work}libraries
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create work directories $c_notice${work}libraries$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create work directories $c_notice${work}libraries$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ ! -d ${work}libraries/shared ]] ; then
- mkdir -v ${work}libraries/shared
+ mkdir $verbose ${work}libraries/shared
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create work directories $c_notice${work}libraries/shared$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create work directories $c_notice${work}libraries/shared$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ ! -d ${work}libraries/static ]] ; then
- mkdir -v ${work}libraries/static
+ mkdir $verbose ${work}libraries/static
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create work directories $c_notice${work}libraries/static$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create work directories $c_notice${work}libraries/static$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ ! -d ${work}includes ]] ; then
- mkdir -v ${work}includes
+ mkdir $verbose ${work}includes
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create work directories $c_notice${work}includes$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create work directories $c_notice${work}includes$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
fi
if [[ $failure == "" && $build_sources_headers != "" ]] ; then
- echo
- echo -e "${c_highlight}Installing Includes to: $c_reset$c_notice$destination_includes$c_reset${c_highlight}.$c_reset"
- cp -vR $path_build${path_includes}* $destination_includes
+ if [[ $verbosity != "quiet" ]] ; then
+ echo
+ echo -e "${c_highlight}Installing Includes to: $c_reset$c_notice$destination_includes$c_reset${c_highlight}.$c_reset"
+ fi
+
+ cp $verbose -R $path_build${path_includes}* $destination_includes
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy include files from $c_notice$path_build$path_includes$c_error to $c_notice$destination_includes$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy include files from $c_notice$path_build$path_includes$c_error to $c_notice$destination_includes$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ $failure == "" && ( $build_sources_library != "" || $build_sources_program != "" ) ]] ; then
if [[ $build_static == "yes" ]] ; then
- echo
- echo -e "${c_highlight}Installing (static) Libraries to: $c_reset$c_notice$destination_libraries_static$c_reset${c_highlight}.$c_reset"
- cp -vR $path_build$path_libraries${path_static}* $destination_libraries_static
+ if [[ $verbosity != "quiet" ]] ; then
+ echo
+ echo -e "${c_highlight}Installing (static) Libraries to: $c_reset$c_notice$destination_libraries_static$c_reset${c_highlight}.$c_reset"
+ fi
+
+ cp $verbose -R $path_build$path_libraries${path_static}* $destination_libraries_static
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy (static) library files from $c_notice$path_build$path_libraries$path_static$c_error to $c_notice$destination_libraries_static$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy (static) library files from $c_notice$path_build$path_libraries$path_static$c_error to $c_notice$destination_libraries_static$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ $failure == "" && $build_shared == "yes" ]] ; then
- echo
- echo -e "${c_highlight}Installing (shared) Libraries to: $c_reset$c_notice$destination_libraries_shared$c_reset${c_highlight}.$c_reset"
- cp -vR $path_build$path_libraries${path_shared}* $destination_libraries_shared
+ if [[ $verbosity != "quiet" ]] ; then
+ echo
+ echo -e "${c_highlight}Installing (shared) Libraries to: $c_reset$c_notice$destination_libraries_shared$c_reset${c_highlight}.$c_reset"
+ fi
+
+ cp $verbose -R $path_build$path_libraries${path_shared}* $destination_libraries_shared
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy (shared) library files from $c_notice$path_build$path_libraries$build_shared$c_error to $c_notice$destination_libraries_shared$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy (shared) library files from $c_notice$path_build$path_libraries$build_shared$c_error to $c_notice$destination_libraries_shared$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ $failure == "" && $build_sources_program != "" ]] ; then
if [[ $build_static == "yes" ]] ; then
- echo
- echo -e "${c_highlight}Installing (static) Programs to: $c_reset$c_notice$destination_programs_static$c_reset${c_highlight}.$c_reset"
- cp -vR $path_build$path_programs${path_static}* $destination_programs_static
+ if [[ $verbosity != "quiet" ]] ; then
+ echo
+ echo -e "${c_highlight}Installing (static) Programs to: $c_reset$c_notice$destination_programs_static$c_reset${c_highlight}.$c_reset"
+ fi
+
+ cp $verbose -R $path_build$path_programs${path_static}* $destination_programs_static
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy (static) library files from $c_notice$path_build$path_programs$path_static$c_error to $c_notice$destination_programs_static$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy (static) library files from $c_notice$path_build$path_programs$path_static$c_error to $c_notice$destination_programs_static$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ $failure == "" && $build_shared == "yes" ]] ; then
- echo
- echo -e "${c_highlight}Installing (shared) Programs to: $c_reset$c_notice$destination_programs_shared$c_reset${c_highlight}.$c_reset"
- cp -vR $path_build$path_programs${path_shared}* $destination_programs_shared
+ if [[ $verbosity != "quiet" ]] ; then
+ echo
+ echo -e "${c_highlight}Installing (shared) Programs to: $c_reset$c_notice$destination_programs_shared$c_reset${c_highlight}.$c_reset"
+ fi
+
+ cp $verbose -R $path_build$path_programs${path_shared}* $destination_programs_shared
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy (shared) library files from $c_notice$path_build$path_programs$build_shared$c_error to $c_notice$destination_programs_shared$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy (shared) library files from $c_notice$path_build$path_programs$build_shared$c_error to $c_notice$destination_programs_shared$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
fi
- if [[ $failure == "" && $build_sources_settings != "" ]] ; then
+ if [[ $failure == "" && $build_sources_settings != "" && $verbosity != "quiet" ]] ; then
echo
echo -e "${c_warning}Settings Files Detected, see: $c_reset$c_notice$path_build$path_settings$c_reset${c_warning}.$c_reset"
fi
local path_build=build/
local path_destination=package/
local path_sources=./
+ local verbosity="normal"
if [[ $# -gt 0 ]] ; then
t=$#
do_color=none
elif [[ $p == "+l" || $p == "++light" ]] ; then
do_color=light
+ elif [[ $p == "+q" || $p == "++quiet" ]] ; then
+ verbosity="quiet"
+ verbose=
elif [[ $p == "+v" || $p == "++version" ]] ; then
echo $version
return
+ elif [[ $p == "+V" || $p == "++verbose" ]] ; then
+ verbosity="verbose"
+ verbose="-v"
elif [[ $p == "-b" || $p == "--build" ]] ; then
grab_next=path_build
elif [[ $p == "-d" || $p == "--destination" ]] ; then
fi
if [[ $operation_failure == "fail-multiple" ]] ; then
- echo -e "${c_error}ERROR: only one operation may be specified at a time.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: only one operation may be specified at a time.$c_reset"
+ fi
+
package_cleanup
return 1
elif [[ $operation == "build" ]] ; then
if [[ ! -d $path_build ]] ; then
- echo -e "${c_error}ERROR: build directory '$path_build' is invalid or missing.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: build directory '$path_build' is invalid or missing.$c_reset"
+ fi
+
package_cleanup
return 1
fi
if [[ ! -d $path_destination ]] ; then
- mkdir -vp $path_destination
+ mkdir $verbose -p $path_destination
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: package directory '$path_destination' is invalid or could not be created.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: package directory '$path_destination' is invalid or could not be created.$c_reset"
+ fi
+
package_cleanup
return 1
fi
fi
if [[ ! -d $path_sources ]] ; then
- echo -e "${c_error}ERROR: sources directory '$path_sources' is invalid or missing.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: sources directory '$path_sources' is invalid or missing.$c_reset"
+ fi
+
package_cleanup
return 1
fi
if [[ ! -d ${path_sources}level_0/ ]] ; then
- echo -e "${c_error}ERROR: build sources directory '${path_sources}level_0/' is invalid or missing.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: build sources directory '${path_sources}level_0/' is invalid or missing.$c_reset"
+ fi
+
package_cleanup
return 1
fi
if [[ ! -d ${path_sources}level_1/ ]] ; then
- echo -e "${c_error}ERROR: build sources directory '${path_sources}level_1/' is invalid or missing.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: build sources directory '${path_sources}level_1/' is invalid or missing.$c_reset"
+ fi
+
package_cleanup
return 1
fi
if [[ ! -d ${path_sources}level_2/ ]] ; then
- echo -e "${c_error}ERROR: build sources directory '${path_sources}level_2/' is invalid or missing.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: build sources directory '${path_sources}level_2/' is invalid or missing.$c_reset"
+ fi
+
package_cleanup
return 1
fi
if [[ ! -d ${path_sources}level_3/ ]] ; then
- echo -e "${c_error}ERROR: build sources directory '${path_sources}level_3/' is invalid or missing.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: build sources directory '${path_sources}level_3/' is invalid or missing.$c_reset"
+ fi
+
package_cleanup
return 1
fi
fi
elif [[ $operation == "dependencies" ]] ; then
if [[ ! -d $path_sources ]] ; then
- echo -e "${c_error}ERROR: sources directory '$path_sources' is invalid or missing.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: sources directory '$path_sources' is invalid or missing.$c_reset"
+ fi
+
package_cleanup
return 1
fi
package_operation_dependencies
elif [[ $operation == "clean" ]] ; then
if [[ ! -d $path_destination ]] ; then
- echo -e "${c_warning}WARNING: package directory '$path_destination' does not exist, there is nothing to clean.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_warning}WARNING: package directory '$path_destination' does not exist, there is nothing to clean.$c_reset"
+ fi
+
package_cleanup
return 0
fi
package_operation_clean
elif [[ $operation == "" ]] ; then
- echo -e "${c_error}ERROR: no operation was given.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: no operation was given.$c_reset"
+ fi
+
package_cleanup
return 1
else
- echo -e "${c_error}ERROR: the operation $c_notice$operation$c_error was not recognized.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the operation $c_notice$operation$c_error was not recognized.$c_reset"
+ fi
+
package_cleanup
return 1
fi
echo -e " -${c_important}h$c_reset, --${c_important}help$c_reset Print this help screen."
echo -e " +${c_important}l$c_reset, ++${c_important}light$c_reset Use color modes that show up better on light backgrounds."
echo -e " +${c_important}n$c_reset, ++${c_important}no_color$c_reset Do not use color."
+ echo -e " +${c_important}q$c_reset, ++${c_important}quiet$c_reset Decrease verbosity beyond normal output."
+ echo -e " +${c_important}V$c_reset, ++${c_important}verbose$c_reset Increase verbosity beyond normal output."
echo -e " +${c_important}v$c_reset, ++${c_important}version$c_reset Print the version number of this program."
echo
echo -e "${c_highlight}Package Options:$c_reset"
package_create_base_files() {
if [[ ! -d $package ]] ; then
- mkdir -vp $package
+ mkdir $verbose -p $package
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create directory $c_notice$package$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create directory $c_notice$package$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ $failure == "" && ! -d ${path_build}documents ]] ; then
- echo -e "${c_error}ERROR: the build directory $c_notice${path_build}documents$c_error cannot be found or is invalid.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: the build directory $c_notice${path_build}documents$c_error cannot be found or is invalid.$c_reset"
+ fi
+
failure=1
fi
if [[ $failure == "" ]] ; then
- cp -vR ${path_build}documents $package
+ cp $verbose -R ${path_build}documents $package
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy directory $c_notice${path_build}documents$c_error to $c_notice$package$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy directory $c_notice${path_build}documents$c_error to $c_notice$package$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ $failure == "" ]] ; then
if [[ -d ${path_build}licenses ]] ; then
- cp -vR ${path_build}licenses $package
+ cp $verbose -R ${path_build}licenses $package
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy directory $c_notice${path_build}licenses$c_error to $c_notice$package$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy directory $c_notice${path_build}licenses$c_error to $c_notice$package$c_error.$c_reset"
+ fi
+
failure=1
fi
elif [[ -d ${path_build}../licenses ]] ; then
- cp -vR ${path_build}../licenses $package
+ cp $verbose -R ${path_build}../licenses $package
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy directory $c_notice${path_build}../licenses$c_error to $c_notice$package$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy directory $c_notice${path_build}../licenses$c_error to $c_notice$package$c_error.$c_reset"
+ fi
+
failure=1
fi
else
- echo -e "${c_error}ERROR: neither directory $c_notice${path_build}licenses$c_error nor $c_notice${path_build}../licenses$c_error can be found or are invalid.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: neither directory $c_notice${path_build}licenses$c_error nor $c_notice${path_build}../licenses$c_error can be found or are invalid.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ $failure == "" ]] ; then
- cp -vR ${path_build}scripts/bootstrap.sh $package
+ cp $verbose -R ${path_build}scripts/bootstrap.sh $package
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy script $c_notice${path_build}bootstrap.sh$c_error to $c_notice$package$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy script $c_notice${path_build}bootstrap.sh$c_error to $c_notice$package$c_error.$c_reset"
+ fi
+
failure=1
fi
chmod ugo+x ${package}bootstrap.sh
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to set executable permissions on script $c_notice${package}bootstrap.sh$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to set executable permissions on script $c_notice${package}bootstrap.sh$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ $failure == "" ]] ; then
- cp -vR ${path_build}scripts/install.sh $package
+ cp $verbose -R ${path_build}scripts/install.sh $package
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy script $c_notice${path_build}install.sh$c_error to $c_notice$package$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy script $c_notice${path_build}install.sh$c_error to $c_notice$package$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
chmod ugo+x ${package}install.sh
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to set executable permissions on script $c_notice${package}install.sh$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to set executable permissions on script $c_notice${package}install.sh$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
fi
if [[ $failure != "" && ! -d ${package}build ]] ; then
- mkdir -vp ${package}build
+ mkdir $verbose -p ${package}build
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create directory $c_notice${package}build$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create directory $c_notice${package}build$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ $failure != "" && ! -d ${package}sources ]] ; then
- mkdir -vp ${package}sources
+ mkdir $verbose -p ${package}sources
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create directory $c_notice${package}sources$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create directory $c_notice${package}sources$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ $failure != "" && ! -d ${package}documents ]] ; then
- mkdir -vp ${package}documents
+ mkdir $verbose -p ${package}documents
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create directory $c_notice${package}documents$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create directory $c_notice${package}documents$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
if [[ $failure != "" && ! -d ${package}licenses ]] ; then
- mkdir -vp ${package}licenses
+ mkdir $verbose -p ${package}licenses
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create directory $c_notice${package}licenses$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create directory $c_notice${package}licenses$c_error.$c_reset"
+ fi
+
failure=1
fi
fi
level_current="$(echo $directory | grep -o '\<level_[[:digit:]]/' | sed -e 's|level_||' -e 's|/$||')"
- echo
- echo -e "${c_highlight}Building Dependencies for $c_reset$c_notice${name}$c_reset${c_highlight}.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo
+ echo -e "${c_highlight}Building Dependencies for $c_reset$c_notice${name}$c_reset${c_highlight}.$c_reset"
+ fi
if [[ ! -f ${directory}/data/build/dependencies ]] ; then
- echo -e "${c_error}ERROR: cannot build dependencies, failed to find $c_notice${directory}/data/build/dependencies$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: cannot build dependencies, failed to find $c_notice${directory}/data/build/dependencies$c_error.$c_reset"
+ fi
+
failure=1
return
fi
if [[ ! -f ${directory}/data/build/settings ]] ; then
- echo -e "${c_error}ERROR: cannot build dependencies for $c_reset$c_notice${name}$c_reset${c_error}, failed to find $c_notice${directory}/data/build/settings$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: cannot build dependencies for $c_reset$c_notice${name}$c_reset${c_error}, failed to find $c_notice${directory}/data/build/settings$c_error.$c_reset"
+ fi
+
failure=1
return
fi
elif [[ $(echo "$dependency" | grep -o "^fll_") != "" ]] ; then
level=level_2
else
- echo -e "${c_warning}WARNING: failed to detect level for dependency $c_notice$dependency$c_warning.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_warning}WARNING: failed to detect level for dependency $c_notice$dependency$c_warning.$c_reset"
+ fi
+
continue
fi
if [[ ! -d ${path_sources}${level}/${dependency}/data/build/ ]] ; then
- echo -e "${c_error}ERROR: failed to find dependency data directory $c_notice${path_sources}${level}/${dependency}/data/build/$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to find dependency data directory $c_notice${path_sources}${level}/${dependency}/data/build/$c_error.$c_reset"
+ fi
+
failure=1
return
fi
elif [[ $(echo "$sub_dependency" | grep -o "^fl_") != "" ]] ; then
sub_level=level_1
else
- echo -e "${c_warning}WARNING: failed to detect level for sub-dependency $c_notice$sub_dependency$c_warning.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_warning}WARNING: failed to detect level for sub-dependency $c_notice$sub_dependency$c_warning.$c_reset"
+ fi
+
continue
fi
if [[ ! -d ${path_sources}${sub_level}/${sub_dependency}/data/build/ ]] ; then
- echo -e "${c_error}ERROR: failed to find dependency data directory $c_notice${path_sources}${sub_level}/${sub_dependency}/data/build/$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to find dependency data directory $c_notice${path_sources}${sub_level}/${sub_dependency}/data/build/$c_error.$c_reset"
+ fi
+
failure=1
return
fi
if [[ $(echo "$sub_sub_dependency" | grep -o "^f_") != "" ]] ; then
sub_sub_level=level_0
else
- echo -e "${c_warning}WARNING: failed to detect level for sub-sub-dependency $c_notice$sub_sub_dependency$c_warning.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_warning}WARNING: failed to detect level for sub-sub-dependency $c_notice$sub_sub_dependency$c_warning.$c_reset"
+ fi
+
continue
fi
individual_dependencies=$(echo "$individual_dependencies" | sed -e 's|^[[:space:]]*||' -e 's|[[:space:]]*$||')
if [[ $individual_dependencies != "" ]] ; then
- echo -e " $individual_dependencies"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e " $individual_dependencies"
+ fi
+
individual_dependencies=" $individual_dependencies"
fi
sed -i -e "s|^\s*build_libraries-individual\>.*\$|build_libraries-individual$individual_dependencies|" $settings
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to update settings file $c_notice${settings}$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to update settings file $c_notice${settings}$c_error.$c_reset"
+ fi
+
failure=1
return
fi
sed -i -e "s|^\s*build_libraries-level\>.*\$|build_libraries-level -lfll_2 -lfll_1 -lfll_0|" $settings
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to update settings file $c_notice${settings}$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to update settings file $c_notice${settings}$c_error.$c_reset"
+ fi
+
failure=1
return
fi
sed -i -e "s|^\s*build_libraries-monolithic\>.*\$|build_libraries-monolithic -lfll|" $settings
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to update settings file $c_notice${settings}$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to update settings file $c_notice${settings}$c_error.$c_reset"
+ fi
+
failure=1
return
fi
settings=${path_sources}${level}/${dependency}/data/build/settings
if [[ ! -f $settings ]] ; then
- echo -e "${c_error}ERROR: failed to find dependency settings file $c_notice$settings$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to find dependency settings file $c_notice$settings$c_error.$c_reset"
+ fi
+
failure=1
return
fi
local monolithic_libraries=
local monolithic_headers=
- echo
- echo -e "${c_highlight}Building Dependencies: $c_notice$level${c_highlight}.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo
+ echo -e "${c_highlight}Building Dependencies: $c_notice$level${c_highlight}.$c_reset"
+ fi
for directory in $path_sources${level}/* ; do
name="$(echo $directory | sed -e "s|$path_sources${level}/||")"
settings=${directory}/data/build/settings
if [[ ! -f $settings ]] ; then
- echo -e "${c_error}ERROR: failed to find settings file $c_notice$settings$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to find settings file $c_notice$settings$c_error.$c_reset"
+ fi
+
failure=1
return
fi
settings=${path_sources}/build/${level}/settings
if [[ ! -f $settings ]] ; then
- echo -e "${c_error}ERROR: failed to find settings file $c_notice$settings$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to find settings file $c_notice$settings$c_error.$c_reset"
+ fi
+
failure=1
return
fi
sed -i -e "s|^\s*build_libraries-level\>.*\$|build_libraries-level$level_libraries|" $settings
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to update libraries for settings file $c_notice$settings$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to update libraries for settings file $c_notice$settings$c_error.$c_reset"
+ fi
+
failure=1
return
fi
sed -i -e "s|^\s*build_sources_library\>.*\$|build_sources_library$level_sources_library|" $settings
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to update libraries for settings file $c_notice$settings$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to update libraries for settings file $c_notice$settings$c_error.$c_reset"
+ fi
+
failure=1
return
fi
sed -i -e "s|^\s*build_sources_headers\>.*\$|build_sources_headers$level_sources_headers|" $settings
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to update headers for settings file $c_notice$settings$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to update headers for settings file $c_notice$settings$c_error.$c_reset"
+ fi
+
failure=1
return
fi
local monolithic_libraries=""
local monolithic_headers=""
- echo
- echo -e "${c_highlight}Building Dependencies: ${c_notice}monolithic${c_highlight}.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo
+ echo -e "${c_highlight}Building Dependencies: ${c_notice}monolithic${c_highlight}.$c_reset"
+ fi
if [[ $level_0_libraries != "" ]] ; then
monolithic_libraries="$level_0_libraries"
settings=${path_sources}/build/monolithic/settings
if [[ $monolithic_libraries != "" ]] ; then
- echo " $monolithic_libraries"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo " $monolithic_libraries"
+ fi
+
monolithic_libraries=" $monolithic_libraries"
fi
sed -i -e "s|^\s*build_sources_library\>.*\$|build_sources_library$monolithic_libraries|" $settings
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to update libraries for settings file $c_notice$settings$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to update libraries for settings file $c_notice$settings$c_error.$c_reset"
+ fi
+
failure=1
return
fi
if [[ $monolithic_headers != "" ]] ; then
- echo " $monolithic_headers"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo " $monolithic_headers"
+ fi
+
monolithic_headers=" $monolithic_headers"
fi
sed -i -e "s|^\s*build_sources_headers\>.*\$|build_sources_headers$monolithic_headers|" $settings
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to update headers for settings file $c_notice$settings$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to update headers for settings file $c_notice$settings$c_error.$c_reset"
+ fi
+
failure=1
return
fi
for i in ${path_destination}{individual,level,monolithic,program} ; do
if [[ -d $i ]] ; then
- rm -vRf $i
+ rm $verbose -Rf $i
fi
done
}
package_operation_copy_package() {
if [[ -d ${package}sources/data/ ]] ; then
- cp -vR ${package}sources/data ${package}
+ cp $verbose -R ${package}sources/data ${package}
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy the data directory $c_notice${package}sources/data$c_error to $c_notice$package$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy the data directory $c_notice${package}sources/data$c_error to $c_notice$package$c_error.$c_reset"
+ fi
+
failure=1
break
fi
- rm -vRf ${package}sources/data
+ rm $verbose -Rf ${package}sources/data
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to remove directory $c_notice${package}sources/data$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to remove directory $c_notice${package}sources/data$c_error.$c_reset"
+ fi
+
failure=1
break
fi
fi
if [[ -d ${package}sources/documents/ ]] ; then
- cp -vR ${package}sources/documents/ ${package}
+ cp $verbose -R ${package}sources/documents/ ${package}
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to move sources documents directory $c_notice${path_sources}sources/documents$c_error to $c_notice$package$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to move sources documents directory $c_notice${path_sources}sources/documents$c_error to $c_notice$package$c_error.$c_reset"
+ fi
+
failure=1
break
fi
- rm -vRf ${package}sources/documents/
+ rm $verbose -Rf ${package}sources/documents/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to remove sources documents directory $c_notice${path_sources}sources/documents$c_error to $c_notice$package$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to remove sources documents directory $c_notice${path_sources}sources/documents$c_error to $c_notice$package$c_error.$c_reset"
+ fi
+
failure=1
break
fi
fi
if [[ -d ${package}sources/licenses/ ]] ; then
- cp -vR ${package}sources/licenses/ ${package}
+ cp $verbose -R ${package}sources/licenses/ ${package}
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to move sources licenses directory $c_notice${path_sources}sources/licenses$c_error to $c_notice$package$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to move sources licenses directory $c_notice${path_sources}sources/licenses$c_error to $c_notice$package$c_error.$c_reset"
+ fi
+
failure=1
break
fi
- rm -vRf ${package}sources/licenses/
+ rm $verbose -Rf ${package}sources/licenses/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to remove sources licenses directory $c_notice${path_sources}sources/licenses$c_error to $c_notice$package$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to remove sources licenses directory $c_notice${path_sources}sources/licenses$c_error to $c_notice$package$c_error.$c_reset"
+ fi
+
failure=1
break
fi
fi
if [[ -d ${package}sources/specifications/ ]] ; then
- cp -vR ${package}sources/specifications/ ${package}
+ cp $verbose -R ${package}sources/specifications/ ${package}
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to move sources specifications directory $c_notice${path_sources}sources/specifications$c_error to $c_notice$package$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to move sources specifications directory $c_notice${path_sources}sources/specifications$c_error to $c_notice$package$c_error.$c_reset"
+ fi
+
failure=1
break
fi
- rm -vRf ${package}sources/specifications/
+ rm $verbose -Rf ${package}sources/specifications/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to remove sources specifications directory $c_notice${path_sources}sources/specifications$c_error to $c_notice$package$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to remove sources specifications directory $c_notice${path_sources}sources/specifications$c_error to $c_notice$package$c_error.$c_reset"
+ fi
+
failure=1
break
fi
local package=
if [[ ! -d ${path_destination}individual ]] ; then
- mkdir -vp ${path_destination}individual
+ mkdir $verbose -p ${path_destination}individual
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create directory $c_notice${path_destination}individual$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create directory $c_notice${path_destination}individual$c_error.$c_reset"
+ fi
+
package_cleanup
exit $failure
fi
name="$(echo $directory | sed -e "s|${path_sources}level_0/||" -e "s|${path_sources}level_1/||" -e "s|${path_sources}level_2/||")"
package="${path_destination}individual/${name}-${version}/"
- echo
- echo -e "${c_highlight}Processing Package$c_reset (individual) $c_notice${name}-${version}$c_reset${c_highlight}.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo
+ echo -e "${c_highlight}Processing Package$c_reset (individual) $c_notice${name}-${version}$c_reset${c_highlight}.$c_reset"
+ fi
package_create_base_files
- cp -vR $directory ${package}sources/
+ cp $verbose -R $directory ${package}sources/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy sources directory $c_notice$directory$c_error to $c_notice${package}sources$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy sources directory $c_notice$directory$c_error to $c_notice${package}sources$c_error.$c_reset"
+ fi
+
failure=1
break
fi
name="fll-$level"
package="${path_destination}level/${name}-${version}/"
- echo
- echo -e "${c_highlight}Processing Package$c_reset (level) $c_notice${name}-${version}$c_reset${c_highlight}.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo
+ echo -e "${c_highlight}Processing Package$c_reset (level) $c_notice${name}-${version}$c_reset${c_highlight}.$c_reset"
+ fi
if [[ ! -d $path_build$level ]] ; then
- echo -e "${c_error}ERROR: build settings directory $c_notice$path_build$level$c_error is invalid or missing.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: build settings directory $c_notice$path_build$level$c_error is invalid or missing.$c_reset"
+ fi
+
failure=1
break
fi
package_create_base_files
if [[ ! -d ${package}data/ ]] ; then
- mkdir -v ${package}data/
+ mkdir $verbose ${package}data/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create directory $c_notice${package}data$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create directory $c_notice${package}data$c_error.$c_reset"
+ fi
+
failure=1
break
fi
fi
if [[ -d $path_build${level}/build ]] ; then
- cp -vR $path_build${level}/build ${package}data/
+ cp $verbose -R $path_build${level}/build ${package}data/
else
- cp -vR $path_build$level ${package}data/build
+ cp $verbose -R $path_build$level ${package}data/build
fi
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to move the directory $c_notice$path_build$level$c_error as $c_notice$path_build${level}build$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to move the directory $c_notice$path_build$level$c_error as $c_notice$path_build${level}build$c_error.$c_reset"
+ fi
+
failure=1
break
fi
if [[ ! -d ${package}sources/ ]] ; then
- mkdir -v ${package}sources/
+ mkdir $verbose ${package}sources/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create directory $c_notice${package}sources$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create directory $c_notice${package}sources$c_error.$c_reset"
+ fi
+
failure=1
break
fi
fi
for directory in $path_sources${level}/* ; do
- cp -vR $directory/* ${package}sources/
+ cp $verbose -R $directory/* ${package}sources/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy files from sources directory $c_notice$directory$c_error to $c_notice${package}sources$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy files from sources directory $c_notice$directory$c_error to $c_notice${package}sources$c_error.$c_reset"
+ fi
+
failure=1
break
fi
- rm -vRf ${package}sources/data/build/
+ rm $verbose -Rf ${package}sources/data/build/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to remove directory $c_notice${package}sources/data/build$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to remove directory $c_notice${package}sources/data/build$c_error.$c_reset"
+ fi
+
failure=1
break
fi
name="fll"
package="${path_destination}monolithic/${name}-${version}/"
- echo
- echo -e "${c_highlight}Processing Package$c_reset (monolithic) $c_notice${name}-${version}$c_reset${c_highlight}.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo
+ echo -e "${c_highlight}Processing Package$c_reset (monolithic) $c_notice${name}-${version}$c_reset${c_highlight}.$c_reset"
+ fi
if [[ ! -d ${path_build}monolithic ]] ; then
- echo -e "${c_error}ERROR: build settings directory $c_notice${path_build}monolithic$c_error is invalid or missing.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: build settings directory $c_notice${path_build}monolithic$c_error is invalid or missing.$c_reset"
+ fi
+
package_cleanup
return 1
fi
package_create_base_files
if [[ ! -d ${package}data/ ]] ; then
- mkdir -v ${package}data/
+ mkdir $verbose ${package}data/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create directory $c_notice${package}data$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create directory $c_notice${package}data$c_error.$c_reset"
+ fi
+
package_cleanup
return 1
fi
fi
if [[ -d ${path_build}monolithic/build ]] ; then
- cp -vR ${path_build}monolithic/build ${package}data
+ cp $verbose -R ${path_build}monolithic/build ${package}data
else
- cp -vR ${path_build}monolithic ${package}data/build
+ cp $verbose -R ${path_build}monolithic ${package}data/build
fi
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to move the directory $c_notice$path_build$level$c_error as $c_notice$path_build${level}build$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to move the directory $c_notice$path_build$level$c_error as $c_notice$path_build${level}build$c_error.$c_reset"
+ fi
+
package_cleanup
return 1
fi
if [[ ! -d ${package}sources/ ]] ; then
- mkdir -v ${package}sources/
+ mkdir $verbose ${package}sources/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create directory $c_notice${package}sources$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create directory $c_notice${package}sources$c_error.$c_reset"
+ fi
+
package_cleanup
return 1
fi
if [[ $pathname == "data" ]] ; then
if [[ ! -d ${package}data/$level ]] ; then
- mkdir -vp ${package}data/$level
+ mkdir $verbose -p ${package}data/$level
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create package data directory $c_notice${package}data/$level$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create package data directory $c_notice${package}data/$level$c_error.$c_reset"
+ fi
+
failure=1
break
fi
fi
- cp -vR $subdirectory ${package}sources/data
+ cp $verbose -R $subdirectory ${package}sources/data
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy files from data directory $c_notice$subdirectory$c_error to $c_notice${package}sources/data$level$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy files from data directory $c_notice$subdirectory$c_error to $c_notice${package}sources/data$level$c_error.$c_reset"
+ fi
+
failure=1
break
fi
- rm -vRf ${package}sources/data/build/
+ rm $verbose -Rf ${package}sources/data/build/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to remove directory $c_notice${package}sources/data/build$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to remove directory $c_notice${package}sources/data/build$c_error.$c_reset"
+ fi
+
failure=1
break
fi
if [[ "$(ls ${package}sources/data)" != "" ]] ; then
- cp -vR ${package}sources/data/* ${package}data/$level
+ cp $verbose -R ${package}sources/data/* ${package}data/$level
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy the data directory $c_notice${package}sources/data/$level/data$c_error to $c_notice${package}data/$level$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy the data directory $c_notice${package}sources/data/$level/data$c_error to $c_notice${package}data/$level$c_error.$c_reset"
+ fi
+
failure=1
break
fi
fi
- rm -vRf ${package}sources/data
+ rm $verbose -Rf ${package}sources/data
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to remove directory $c_notice${package}sources/data$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to remove directory $c_notice${package}sources/data$c_error.$c_reset"
+ fi
+
failure=1
break
fi
elif [[ $pathname == "documents" ]] ; then
- cp -vR $subdirectory ${package}sources/
+ cp $verbose -R $subdirectory ${package}sources/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy files from data directory $c_notice$subdirectory$c_error to $c_notice${package}sources/documents$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy files from data directory $c_notice$subdirectory$c_error to $c_notice${package}sources/documents$c_error.$c_reset"
+ fi
+
failure=1
break
fi
elif [[ $pathname == "licenses" ]] ; then
- cp -vR $subdirectory ${package}sources/
+ cp $verbose -R $subdirectory ${package}sources/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy files from data directory $c_notice$subdirectory$c_error to $c_notice${package}sources/licenses$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy files from data directory $c_notice$subdirectory$c_error to $c_notice${package}sources/licenses$c_error.$c_reset"
+ fi
+
failure=1
break
fi
elif [[ $pathname == "specifications" ]] ; then
- cp -vR $subdirectory ${package}sources/
+ cp $verbose -R $subdirectory ${package}sources/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy files from data directory $c_notice$subdirectory$c_error to $c_notice${package}sources/specifications$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy files from data directory $c_notice$subdirectory$c_error to $c_notice${package}sources/specifications$c_error.$c_reset"
+ fi
+
failure=1
break
fi
else
if [[ ! -d ${package}sources/$pathname/$level ]] ; then
- mkdir -vp ${package}sources/$pathname/$level
+ mkdir $verbose -p ${package}sources/$pathname/$level
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create package sources directory $c_notice${package}sources/$pathname/$level$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create package sources directory $c_notice${package}sources/$pathname/$level$c_error.$c_reset"
+ fi
+
failure=1
break
fi
fi
- cp -vR $subdirectory/* ${package}sources/$pathname/$level
+ cp $verbose -R $subdirectory/* ${package}sources/$pathname/$level
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy files from sources directory $c_notice$subdirectory$c_error to $c_notice${package}sources/$pathname/$level$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy files from sources directory $c_notice$subdirectory$c_error to $c_notice${package}sources/$pathname/$level$c_error.$c_reset"
+ fi
+
failure=1
break
fi
local package=
if [[ ! -d ${path_destination}program ]] ; then
- mkdir -vp ${path_destination}program
+ mkdir $verbose -p ${path_destination}program
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to create directory $c_notice${path_destination}program$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to create directory $c_notice${path_destination}program$c_error.$c_reset"
+ fi
+
package_cleanup
exit $failure
fi
name="$(echo $directory | sed -e "s|${path_sources}level_3/||")"
package="${path_destination}program/${name}-${version}/"
- echo
- echo -e "${c_highlight}Processing Package$c_reset (program) $c_notice${name}-${version}$c_reset${c_highlight}.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo
+ echo -e "${c_highlight}Processing Package$c_reset (program) $c_notice${name}-${version}$c_reset${c_highlight}.$c_reset"
+ fi
package_create_base_files
- cp -vR $directory ${package}sources/
+ cp $verbose -R $directory ${package}sources/
if [[ $? -ne 0 ]] ; then
- echo -e "${c_error}ERROR: failed to copy sources directory $c_notice$directory$c_error to $c_notice${package}sources$c_error.$c_reset"
+ if [[ $verbosity != "quiet" ]] ; then
+ echo -e "${c_error}ERROR: failed to copy sources directory $c_notice$directory$c_error to $c_notice${package}sources$c_error.$c_reset"
+ fi
+
failure=1
break
fi