|
@ -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!) |
|
|
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_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 |
|
|
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 _dir_satellites # Directory where the satellite files are placed. |
|
|
unset _options |
|
|
unset options |
|
|
[ -f /etc/astronaut.conf ] && . /etc/astronaut.conf |
|
|
[ -f /etc/astronaut.conf ] && . /etc/astronaut.conf |
|
|
[ -f "$HOME/.astronaut.conf" ] && . "$HOME/.astronaut.conf" |
|
|
[ -f "$HOME/.astronaut.conf" ] && . "$HOME/.astronaut.conf" |
|
|
|
|
|
|
|
@ -24,7 +23,7 @@ vcs_compile=false |
|
|
_show_help() { |
|
|
_show_help() { |
|
|
echo "This astronaut will help you build some satellites. |
|
|
echo "This astronaut will help you build some satellites. |
|
|
Just describe what he's got to do in a satellite file. |
|
|
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 |
|
|
-h/? Show this message |
|
|
-b Set build directory [WARNING: Will be deleted before build] |
|
|
-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 |
|
|
-p Set prefix directory |
|
|
-r Set root directory |
|
|
-r Set root directory |
|
|
-I Nuke install directory before build |
|
|
-I Nuke install directory before build |
|
|
-c/C Enable/Disable package checking |
|
|
|
|
|
-d Only download package files |
|
|
-d Only download package files |
|
|
-v Only build vcs package if any updates have been made to it |
|
|
-v Only build vcs package if any updates have been made to it |
|
|
-o Set package options (comma-separated)" |
|
|
-o Set package options (comma-separated)" |
|
@ -73,12 +71,6 @@ while getopts "h?s:b:i:p:IcCdvo:" opt; do |
|
|
I) |
|
|
I) |
|
|
_nuke_dir_install=true |
|
|
_nuke_dir_install=true |
|
|
;; |
|
|
;; |
|
|
c) |
|
|
|
|
|
enable_check=true |
|
|
|
|
|
;; |
|
|
|
|
|
C) |
|
|
|
|
|
enable_check=false |
|
|
|
|
|
;; |
|
|
|
|
|
d) |
|
|
d) |
|
|
_download_only=true |
|
|
_download_only=true |
|
|
;; |
|
|
;; |
|
@ -86,7 +78,7 @@ while getopts "h?s:b:i:p:IcCdvo:" opt; do |
|
|
_vcs_only=true |
|
|
_vcs_only=true |
|
|
;; |
|
|
;; |
|
|
o) |
|
|
o) |
|
|
_options="$_options "$(printf "$OPTARG" | sed -e 's/,/ /g')"" |
|
|
options="$options "$(printf "$OPTARG" | sed -e 's/,/ /g')"" |
|
|
;; |
|
|
;; |
|
|
esac |
|
|
esac |
|
|
done |
|
|
done |
|
@ -151,14 +143,6 @@ dlfile() { |
|
|
getfile "$(basename "$1" | cut -d? -f1)" |
|
|
getfile "$(basename "$1" | cut -d? -f1)" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
do_check() { |
|
|
|
|
|
if [ "$1" ]; then |
|
|
|
|
|
[ "$enable_check" = true ] && eval $@ || true |
|
|
|
|
|
else |
|
|
|
|
|
return $([ "$enable_check" = true ]) |
|
|
|
|
|
fi |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
option() { |
|
|
option() { |
|
|
local check=$1 |
|
|
local check=$1 |
|
|
shift |
|
|
shift |
|
@ -173,7 +157,7 @@ option() { |
|
|
|
|
|
|
|
|
local enabled=false |
|
|
local enabled=false |
|
|
local option |
|
|
local option |
|
|
for option in $_options; do |
|
|
for option in $options; do |
|
|
if [ "$option" = "$check" ]; then |
|
|
if [ "$option" = "$check" ]; then |
|
|
local enabled=true |
|
|
local enabled=true |
|
|
break |
|
|
break |
|
@ -185,8 +169,11 @@ option() { |
|
|
[ "$enabled" = true ] && local enabled=false || local enabled=true |
|
|
[ "$enabled" = true ] && local enabled=false || local enabled=true |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
local enable_check=$enabled |
|
|
if [ "$1" ]; then |
|
|
do_check $@ # Reuse the code from do_check |
|
|
[ "$enabled" = true ] && eval $@ || true |
|
|
|
|
|
else |
|
|
|
|
|
return $([ "$enabled" = true ]) |
|
|
|
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
import() { |
|
|
import() { |
|
|