diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index 39621393586..7e8406bc620 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -270,13 +270,13 @@ PKG_BASE=`echo "$PKG_NAME" | sed 's/-.*//'` # strip version number # 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 @@ -330,15 +330,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 @@ -416,7 +416,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" @@ -537,7 +537,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