From 53adbfe9ec4d463d36671f9c7ffe7a56b3130e85 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 8 Jan 2017 00:56:32 +0100 Subject: [PATCH] Namespace module functions. --- chocpkg/modules/build_autotools.sh | 4 ++-- chocpkg/modules/fetch_download.sh | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/chocpkg/modules/build_autotools.sh b/chocpkg/modules/build_autotools.sh index 4ebbb6f..fce63ff 100644 --- a/chocpkg/modules/build_autotools.sh +++ b/chocpkg/modules/build_autotools.sh @@ -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" diff --git a/chocpkg/modules/fetch_download.sh b/chocpkg/modules/fetch_download.sh index 78c2136..5963c24 100644 --- a/chocpkg/modules/fetch_download.sh +++ b/chocpkg/modules/fetch_download.sh @@ -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 }