Namespace module functions.

This commit is contained in:
Simon Howard 2017-01-08 00:56:32 +01:00
parent cf43367402
commit 53adbfe9ec
2 changed files with 8 additions and 8 deletions

View file

@ -3,7 +3,7 @@ build_autotools::init() {
PACKAGE_CONFIGURE_OPTS="$@"
}
need_autoreconf() {
build_autotools::need_autoreconf() {
if [ -e configure.in ] && [ ! -e configure.ac ]; then
local configure_ac=configure.in
else
@ -25,7 +25,7 @@ do_build() {
# If we're checking out from a version control repository, we may need
# to run the autotools commands first to generate the configure script.
if need_autoreconf; then
if build_autotools::need_autoreconf; then
if ! chocpkg::have_tool autoreconf; then
chocpkg::abort "autotools not installed; please run:" \
" chocpkg install native:autotools"

View file

@ -7,7 +7,7 @@ fetch_download::init() {
IS_TAR_BOMB=false
}
check_sha256_digest() {
fetch_download::check_sha256_digest() {
local filename="$1" dldigest
dldigest=$(chocpkg::sha256_digest "$filename")
# For development purposes only.
@ -23,19 +23,19 @@ check_sha256_digest() {
fi
}
download_package_file() {
fetch_download::download_package_file() {
local dlfile="$PACKAGES_DIR/$PACKAGE_FILENAME"
if [ ! -e "$dlfile" ]; then
local tmpfile="$dlfile.part"
if ! chocpkg::curl "$PACKAGE_URL" > $tmpfile; then
chocpkg::abort "Failed to download $PACKAGE_URL"
fi
check_sha256_digest "$tmpfile"
fetch_download::check_sha256_digest "$tmpfile"
mv "$tmpfile" "$dlfile"
fi
}
extract_package_file() {
fetch_download::extract_package_file() {
local dlfile="$PACKAGES_DIR/$PACKAGE_FILENAME"
# Well-formed tar files contain a single directory that matches their
# filename, but we support an override for badly-formed tar files too,
@ -54,7 +54,7 @@ extract_package_file() {
}
do_fetch() {
download_package_file
extract_package_file
fetch_download::download_package_file
fetch_download::extract_package_file
}