|
|
@ -8,9 +8,8 @@ dir_sysroot="" # The root dir (Used for dirs like etc and var) |
|
|
|
dir_prefix="$dir_sysroot/usr" # Prefix directory (Should always contain $dir_sysroot!) |
|
|
|
cmd_download="curl -# -L -o {dst} {src}" # Command to execute to download files |
|
|
|
cmd_extract="tar -x -C {dst} -f {src}" # Command to execute to extract files |
|
|
|
enable_check=true # Run the test suite of packages |
|
|
|
unset _dir_satellites # Directory where the satellite files are placed. |
|
|
|
unset _options |
|
|
|
unset options |
|
|
|
[ -f /etc/astronaut.conf ] && . /etc/astronaut.conf |
|
|
|
[ -f "$HOME/.astronaut.conf" ] && . "$HOME/.astronaut.conf" |
|
|
|
|
|
|
@ -24,7 +23,7 @@ vcs_compile=false |
|
|
|
_show_help() { |
|
|
|
echo "This astronaut will help you build some satellites. |
|
|
|
Just describe what he's got to do in a satellite file. |
|
|
|
Usage: $0 [-sbip <dir>] [-IcCd] [-o <options>] <satellite> |
|
|
|
Usage: $0 [-sbip <dir>] [-Id] [-o <options>] <satellite> |
|
|
|
|
|
|
|
-h/? Show this message |
|
|
|
-b Set build directory [WARNING: Will be deleted before build] |
|
|
@ -33,7 +32,6 @@ Usage: $0 [-sbip <dir>] [-IcCd] [-o <options>] <satellite> |
|
|
|
-p Set prefix directory |
|
|
|
-r Set root directory |
|
|
|
-I Nuke install directory before build |
|
|
|
-c/C Enable/Disable package checking |
|
|
|
-d Only download package files |
|
|
|
-v Only build vcs package if any updates have been made to it |
|
|
|
-o Set package options (comma-separated)" |
|
|
@ -73,12 +71,6 @@ while getopts "h?s:b:i:p:IcCdvo:" opt; do |
|
|
|
I) |
|
|
|
_nuke_dir_install=true |
|
|
|
;; |
|
|
|
c) |
|
|
|
enable_check=true |
|
|
|
;; |
|
|
|
C) |
|
|
|
enable_check=false |
|
|
|
;; |
|
|
|
d) |
|
|
|
_download_only=true |
|
|
|
;; |
|
|
@ -86,7 +78,7 @@ while getopts "h?s:b:i:p:IcCdvo:" opt; do |
|
|
|
_vcs_only=true |
|
|
|
;; |
|
|
|
o) |
|
|
|
_options="$_options "$(printf "$OPTARG" | sed -e 's/,/ /g')"" |
|
|
|
options="$options "$(printf "$OPTARG" | sed -e 's/,/ /g')"" |
|
|
|
;; |
|
|
|
esac |
|
|
|
done |
|
|
@ -151,14 +143,6 @@ dlfile() { |
|
|
|
getfile "$(basename "$1" | cut -d? -f1)" |
|
|
|
} |
|
|
|
|
|
|
|
do_check() { |
|
|
|
if [ "$1" ]; then |
|
|
|
[ "$enable_check" = true ] && eval $@ || true |
|
|
|
else |
|
|
|
return $([ "$enable_check" = true ]) |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
option() { |
|
|
|
local check=$1 |
|
|
|
shift |
|
|
@ -173,7 +157,7 @@ option() { |
|
|
|
|
|
|
|
local enabled=false |
|
|
|
local option |
|
|
|
for option in $_options; do |
|
|
|
for option in $options; do |
|
|
|
if [ "$option" = "$check" ]; then |
|
|
|
local enabled=true |
|
|
|
break |
|
|
@ -185,8 +169,11 @@ option() { |
|
|
|
[ "$enabled" = true ] && local enabled=false || local enabled=true |
|
|
|
fi |
|
|
|
|
|
|
|
local enable_check=$enabled |
|
|
|
do_check $@ # Reuse the code from do_check |
|
|
|
if [ "$1" ]; then |
|
|
|
[ "$enabled" = true ] && eval $@ || true |
|
|
|
else |
|
|
|
return $([ "$enabled" = true ]) |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
import() { |
|
|
|