Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
build/bin/sage-spkg: Fix up for normal and script packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jul 21, 2022
1 parent 25d38e9 commit 97c61be
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions build/bin/sage-spkg
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,13 @@ export SAGE_SPKG_WHEELS="$SAGE_INST_LOCAL/var/lib/sage/wheels"
# in upstream.
PKG_VER="${PKG_NAME#${PKG_BASE}}"
PKG_VER="${PKG_VER#-}"
if [ -n "$PKG_VER" ]; then
echo >&2 "Error: Selecting a different version of a package is no longer supported"
exit 1
fi
PKG_SCRIPTS="$SAGE_ROOT/build/pkgs/$PKG_BASE"
LOCAL_PKG_VER=`cat $PKG_SCRIPTS/package-version.txt 2>/dev/null`
PKG_VER="$LOCAL_PKG_VER"
if [ -n "$PKG_VER" -a "$PKG_VER" != "$LOCAL_PKG_VER" ]; then
echo >&2 "Error: Selecting a different version of a package is no longer supported"
exit 1
fi
if [ -z "$PKG_VER" ]; then
PKG_NAME="${PKG_BASE}"
else
Expand Down Expand Up @@ -362,15 +362,15 @@ if [ -n "$PKG_NAME_UPSTREAM" ]; then
error_msg "Error downloading $PKG_NAME_UPSTREAM"
exit 1
fi
fi
PKG_SRC="$SAGE_DISTFILES/$PKG_NAME_UPSTREAM"
PKG_SRC="$SAGE_DISTFILES/$PKG_NAME_UPSTREAM"

# Do a final check that PKG_SRC is a file with an absolute path
cd /
if [ ! -d "$PKG_SRC" ]; then
echo >&2 "Error: spkg directory '$PKG_SRC' not found."
echo >&2 "This shouldn't happen, it is a bug in the sage-spkg script."
exit 1
# Do a final check that PKG_SRC is a file with an absolute path
cd /
if [ ! -f "$PKG_SRC" ]; then
echo >&2 "Error: spkg file '$PKG_SRC' not found."
echo >&2 "This shouldn't happen, it is a bug in the sage-spkg script."
exit 1
fi
fi

# Go back to SAGE_ROOT where we have less chance of completely messing
Expand Down Expand Up @@ -448,7 +448,7 @@ fi
# Normal packages: Extract the package
##################################################################

if [ -f "$PKG_SCRIPTS"/checksums.ini ]; then
if [ -n "$PKG_NAME_UPSTREAM" ]; then
# Normal package
echo "Setting up build directory for $PKG_NAME"
cp -RLp "$PKG_SCRIPTS" "$PKG_NAME"
Expand Down Expand Up @@ -575,7 +575,8 @@ echo "****************************************************"
# Poison the proxy variable to forbid downloads in spkg-install
# for normal packages
##################################################################
if [ -f checksums.ini ]; then
if [ -n "$PKG_NAME_UPSTREAM" ]; then
# Normal package
export http_proxy=http://192.0.2.0:5187/
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
Expand Down

0 comments on commit 97c61be

Please sign in to comment.