From 46e5f687b745a1ec892d09cec5971b1287e2550d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 24 Sep 2020 13:57:14 -0700 Subject: [PATCH] build/bin/sage-spkg: Get rid of USE_LOCAL_SCRIPTS (it was always yes); prepare for script packages --- build/bin/sage-spkg | 59 ++++++++++++--------------------------------- 1 file changed, 15 insertions(+), 44 deletions(-) diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index 4d38fd74009..694091f5b7c 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -261,12 +261,6 @@ fi PKG_NAME="$PKG_SRC" PKG_BASE=`echo "$PKG_NAME" | sed 's/-.*//'` # strip version number -# USE_LOCAL_SCRIPTS is a flag that if non-empty will cause -# this script to try to install the package using local metadata -# i.e. use upstream tarballs (vs spkgs) and scripts located in build/pkgs/$PKG_BASE -# the value of this flag is set in the next codeblock -USE_LOCAL_SCRIPTS= - # PKG_SRC should look like "package-VERSION" or just "package". # If VERSION matches the version in build/pkgs or there is no version # specified, use the local scripts; otherwise we try to find a package @@ -281,7 +275,6 @@ if [ -z "$PKG_VER" ]; then else PKG_NAME="${PKG_BASE}-${PKG_VER}" fi -USE_LOCAL_SCRIPTS=yes PKG_BASE_VER=`echo $PKG_VER | sed 's/\.p[0-9][0-9]*$//'` PKG_NAME_UPSTREAM=`lookup_param tarball "$PKG_SCRIPTS/checksums.ini" | sed "s/VERSION/$PKG_BASE_VER/"` echo "Found local metadata for $PKG_NAME" @@ -318,7 +311,7 @@ EOF fi fi -if [ $INFO -ne 0 -a "$USE_LOCAL_SCRIPTS" = yes ]; then +if [ $INFO -ne 0 ]; then exec sage-spkg-info $PKG_BASE fi @@ -362,20 +355,6 @@ if [ -n "$SAGE_INSTALL_FETCH_ONLY" ]; then exit 0 fi -################################################################## -# Handle --info -################################################################## - -if [ $INFO -ne 0 -a -z "$USE_LOCAL_SCRIPTS" ]; then - cat "$PKG_SCRIPTS/SPKG.txt" - sage-uncompress-spkg "$PKG_SRC" "$PKG_NAME/SPKG.txt" - if [ $? -ne 0 ]; then - error_msg "Error: no file SPKG.txt in $PKG_NAME" - exit 1 - fi - exit 0 -fi - ################################################################## # Setup directories ################################################################## @@ -431,11 +410,11 @@ if [ -e "$PKG_NAME" ]; then fi ################################################################## -# Extract the package +# Normal packages: Extract the package ################################################################## -if [ "$USE_LOCAL_SCRIPTS" = yes ]; then - # New-style package +if [ -f "$PKG_SCRIPTS"/checksums.ini ]; then + # Normal package echo "Setting up build directory for $PKG_NAME" cp -RLp "$PKG_SCRIPTS" "$PKG_NAME" cd "$PKG_NAME" || exit $? @@ -445,19 +424,18 @@ if [ "$USE_LOCAL_SCRIPTS" = yes ]; then error_msg "Error: failed to extract $PKG_SRC" exit 1 fi -else - echo >&2 "Error: Installing old-style SPKGs is no longer supported." - exit 1 -fi - -echo "Finished extraction" -cd src -if ! sage-apply-patches; then - error_msg "Error applying patches" - exit 1 + echo "Finished extraction" + cd src + if ! sage-apply-patches; then + error_msg "Error applying patches" + exit 1 + fi + cd .. +else + # Script package: Build out of the source tree without copying + cd "$PKG_SCRIPTS" fi -cd .. ################################################################## # The package has been extracted, prepare for installation @@ -539,14 +517,7 @@ for script in $WRAPPED_SCRIPTS; do script="spkg-$script" if [ -f "$script.in" ]; then - if [ "$USE_LOCAL_SCRIPTS" = "yes" ]; then - write_script_wrapper "$(pwd)/$script" "$script_dir" - else - if [ ! -x "$script" ]; then - echo >&2 "WARNING: $script is not executable, making it executable" - chmod +x "$script" - fi - fi + write_script_wrapper "$(pwd)/$script" "$script_dir" fi done