|
@ -1,4 +1,5 @@ |
|
|
#!/bin/sh -e |
|
|
#!/bin/sh |
|
|
|
|
|
set -e |
|
|
|
|
|
|
|
|
# Configuration |
|
|
# Configuration |
|
|
|
|
|
|
|
@ -34,12 +35,12 @@ 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 |
|
|
|
|
|
|
|
|
# If we can't find the satellite file, we'll look in this directory for it. |
|
|
# If we can't find the satellite file, we'll look in this directory for it. |
|
|
unset dir_satellites |
|
|
dir_satellites= |
|
|
|
|
|
|
|
|
# Options are comma-separated and parsed from front to back. |
|
|
# Options are comma-separated and parsed from front to back. |
|
|
# This means that in '!opt,someotheropt,opt', opt is disabled. |
|
|
# This means that in '!opt,someotheropt,opt', opt is disabled. |
|
|
|
|
|
|
|
|
unset options # The least-priority global options |
|
|
options= # The least-priority global options |
|
|
package_options() { :; } # Per-package options function. |
|
|
package_options() { :; } # Per-package options function. |
|
|
# Example for package_options: |
|
|
# Example for package_options: |
|
|
# package_options() { |
|
|
# package_options() { |
|
@ -57,8 +58,14 @@ package_options() { :; } # Per-package options function. |
|
|
download_only=false |
|
|
download_only=false |
|
|
_vcs_only=false |
|
|
_vcs_only=false |
|
|
_nuke_dir_install=false |
|
|
_nuke_dir_install=false |
|
|
unset _user_options # Options specified in the command line get the highest priority |
|
|
_user_options= # Options specified in the command line get the highest priority |
|
|
unset _sat_options # Options defined by the satellite |
|
|
_sat_options= # Options defined by the satellite |
|
|
|
|
|
|
|
|
|
|
|
# Should be specified in the satellite |
|
|
|
|
|
name= |
|
|
|
|
|
version= |
|
|
|
|
|
update_url= |
|
|
|
|
|
vcs_compile=false |
|
|
|
|
|
|
|
|
# Check if running from a wrapper |
|
|
# Check if running from a wrapper |
|
|
if [ "$(basename "$0")" != "astronaut" ]; then |
|
|
if [ "$(basename "$0")" != "astronaut" ]; then |
|
@ -69,12 +76,6 @@ else |
|
|
_astronaut_wrapper_post() { :; } |
|
|
_astronaut_wrapper_post() { :; } |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# Should be specified in the satellite |
|
|
|
|
|
unset name |
|
|
|
|
|
unset version |
|
|
|
|
|
unset update_url |
|
|
|
|
|
vcs_compile=false |
|
|
|
|
|
|
|
|
|
|
|
# Some printing functions |
|
|
# Some printing functions |
|
|
_show_help() { |
|
|
_show_help() { |
|
|
echo "This astronaut will help you build some satellites. |
|
|
echo "This astronaut will help you build some satellites. |
|
@ -141,7 +142,7 @@ while getopts "h?s:b:i:p:IcCdvo:" opt; do |
|
|
esac |
|
|
esac |
|
|
done |
|
|
done |
|
|
|
|
|
|
|
|
shift $((OPTIND-1)) |
|
|
shift $(expr $OPTIND - 1) |
|
|
[ "$1" = "--" ] && shift |
|
|
[ "$1" = "--" ] && shift |
|
|
|
|
|
|
|
|
if [ ! "$1" ]; then |
|
|
if [ ! "$1" ]; then |
|
@ -164,7 +165,7 @@ download() { |
|
|
[ "$3" ] && local filename="$3" || local filename="$(basename $(echo "$1" | cut -d? -f1))" |
|
|
[ "$3" ] && local filename="$3" || local filename="$(basename $(echo "$1" | cut -d? -f1))" |
|
|
local path="$dir_source/$name/$filename" |
|
|
local path="$dir_source/$name/$filename" |
|
|
|
|
|
|
|
|
[ "$2" -a -f "$path" ] && local checksum="$(_mksum "$path")" |
|
|
[ "$2" -a -f "$path" ] && local checksum="$(_mksum "$path")" || true |
|
|
|
|
|
|
|
|
if [ ! -e "$path" -o "$checksum" != "$2" ]; then |
|
|
if [ ! -e "$path" -o "$checksum" != "$2" ]; then |
|
|
_msg "Downloading $filename" |
|
|
_msg "Downloading $filename" |
|
@ -193,7 +194,7 @@ getfile() { |
|
|
|
|
|
|
|
|
extrafile() { |
|
|
extrafile() { |
|
|
local dir="$(dirname "$_satellite")" |
|
|
local dir="$(dirname "$_satellite")" |
|
|
[ -d "$dir/extrafiles" ] && local dir="$dir/extrafiles/$name" |
|
|
[ -d "$dir/extrafiles" ] && local dir="$dir/extrafiles/$name" || true |
|
|
|
|
|
|
|
|
cp -a "$dir/$1" "./$1" |
|
|
cp -a "$dir/$1" "./$1" |
|
|
} |
|
|
} |
|
@ -276,7 +277,7 @@ option() { |
|
|
"$@" |
|
|
"$@" |
|
|
fi |
|
|
fi |
|
|
else |
|
|
else |
|
|
return $([ "$enabled" = true ]) |
|
|
[ "$enabled" = true ] |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|