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

Commit

Permalink
Silence "mv" and eliminate some "cd" commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jdemeyer committed Feb 3, 2014
1 parent 4b0db2c commit c83506a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/bin/sage-spkg
Expand Up @@ -298,7 +298,6 @@ elif [ -z "$PKG_HAS_PATH" ]; then

if [ $INFO -eq 0 ]; then
# see if we can the source tarball locally
cd "$SAGE_DISTFILES"
if [ -f "$SAGE_DISTFILES/$PKG_NAME_UPSTREAM" ]; then
# Found a good tarball
PKG_SRC="$SAGE_DISTFILES/$PKG_NAME_UPSTREAM"
Expand Down Expand Up @@ -572,7 +571,7 @@ fi
if [ "$USE_LOCAL_SCRIPTS" = yes ]; then
echo "Setting up build directory for $PKG_NAME"
cp -Rp "$PKG_SCRIPTS" "$PKG_NAME"
cd "$PKG_NAME"
cd "$PKG_NAME" || exit $?
else
echo "Extracting package $PKG_SRC"
ls -l "$PKG_SRC"
Expand All @@ -585,23 +584,22 @@ if [ $? -ne 0 ]; then
fi

if [ "$USE_LOCAL_SCRIPTS" = yes ]; then
mv "${PKG_NAME_UPSTREAM%.tar*}" src
cd ..
mv 2>/dev/null "${PKG_NAME_UPSTREAM%.tar*}" src
echo "Finished set up"
else
echo "Finished extraction"

cd "$PKG_NAME"
if [ $? -ne 0 ]; then
echo >&2 "Error: after extracting, the directory $PKG_NAME does not exist"
exit 1
fi
fi

##################################################################
# The package has been extracted, prepare for installation
##################################################################

cd "$PKG_NAME"
if [ $? -ne 0 ]; then
echo >&2 "Error: after extracting, the directory $PKG_NAME does not exist"
exit 1
fi

# When there is no spkg-install, assume the "spkg" is a tarball not
# specifically made for Sage. Since we want it to be as easy as
# possible to install such a package, we "guess" spkg-install.
Expand Down

0 comments on commit c83506a

Please sign in to comment.