Skip to content

Commit

Permalink
Trac #21792: Fix indents and trailing whitespace
Browse files Browse the repository at this point in the history
In all scripts: Use spaces, not a mixture of spaces and TABs to indent.
Also remove all trailing whitespace.

URL: https://trac.sagemath.org/21792
Reported by: jdemeyer
Ticket author(s): Jeroen Demeyer
Reviewer(s): Matthias Koeppe, John Palmieri
  • Loading branch information
Release Manager authored and vbraun committed Nov 3, 2016
2 parents 9b251c1 + b7d7a71 commit 484b5f9
Show file tree
Hide file tree
Showing 69 changed files with 276 additions and 276 deletions.
10 changes: 5 additions & 5 deletions build/bin/sage-logger
Expand Up @@ -71,23 +71,23 @@ if [[ "$V" = 0 && $use_prefix = true ]]; then
( exec>> $logfile 2>&1 ; eval "$cmd" )
status=$?
if [[ $status != 0 ]]; then
echo " [$logname] error installing, exit status $status. Log file: $logfile"
echo " [$logname] error installing, exit status $status. Log file: $logfile"
else
echo " [$logname] successfully installed."
echo " [$logname] successfully installed."
fi
exit $status
else
# Redirect stdout and stderr to a subprocess running tee.
# We trap SIGINT such that SIGINT interrupts the main process being
# run, not the logging.
( exec 2>&1; eval "$cmd" ) | \
( trap '' SIGINT; tee -a "$logfile" | $SED )
( trap '' SIGINT; tee -a "$logfile" | $SED )

pipestatus=(${PIPESTATUS[*]})

if [ ${pipestatus[1]} -ne 0 ]; then
exit ${pipestatus[1]}
exit ${pipestatus[1]}
else
exit ${pipestatus[0]}
exit ${pipestatus[0]}
fi
fi
144 changes: 72 additions & 72 deletions build/bin/sage-spkg
Expand Up @@ -118,9 +118,9 @@ write_to_tty()
{
# Try writing to terminal. Suppress the possible error message
if ! ( cat > /dev/tty ) 2> /dev/null ; then
# Fall back to writing to stdout
cat
return 1
# Fall back to writing to stdout
cat
return 1
fi
}

Expand Down Expand Up @@ -201,8 +201,8 @@ while true; do
INFO=1;;
-y)
YES=1;;
-n)
YES=-1;;
-n)
YES=-1;;
-d)
SAGE_INSTALL_FETCH_ONLY=1;;
-s)
Expand Down Expand Up @@ -290,34 +290,34 @@ elif [ -z "$PKG_HAS_PATH" ]; then

# Warning for experimental packages
if [ x`cat "$PKG_SCRIPTS/type"` = x"experimental" -a $INFO = 0 ]; then
if [ $YES != 1 ]; then
# We use /dev/tty here because our output may be redirected
# to a logfile, or line-buffered.
write_to_tty <<EOF
if [ $YES != 1 ]; then
# We use /dev/tty here because our output may be redirected
# to a logfile, or line-buffered.
write_to_tty <<EOF
=========================== WARNING ===========================
You are about to download and install the experimental package
$PKG_NAME. This probably won't work at all for you! There
is no guarantee that it will build correctly, or behave as
expected. Use at your own risk!
===============================================================
EOF
if [ $? -ne 0 ]; then
echo "Terminal not available for prompting. Use 'sage -i -y $PKG_BASE'"
echo "to install experimental packages in non-interactive mode."
YES=-1
fi
if [ $YES != -1 ]; then
read -p "Are you sure you want to continue [Y/n]? " answer < /dev/tty > /dev/tty 2>&1
else
answer=n
fi
case "$answer" in
n*|N*) exit 1;;
esac
# Confirm the user's input. (This gives important
# feedback to the user when output is redirected to a logfile.)
echo > /dev/tty "OK, installing $PKG_NAME now..."
fi
if [ $? -ne 0 ]; then
echo "Terminal not available for prompting. Use 'sage -i -y $PKG_BASE'"
echo "to install experimental packages in non-interactive mode."
YES=-1
fi
if [ $YES != -1 ]; then
read -p "Are you sure you want to continue [Y/n]? " answer < /dev/tty > /dev/tty 2>&1
else
answer=n
fi
case "$answer" in
n*|N*) exit 1;;
esac
# Confirm the user's input. (This gives important
# feedback to the user when output is redirected to a logfile.)
echo > /dev/tty "OK, installing $PKG_NAME now..."
fi
fi

else
Expand All @@ -337,9 +337,9 @@ fi
if [ $INFO -ne 0 -a "$USE_LOCAL_SCRIPTS" = yes ]; then
cat "$PKG_SCRIPTS/SPKG.txt"
if [ -r "$PKG_SCRIPTS/type" ] ; then
echo "== Type =="
echo
cat "$PKG_SCRIPTS/type"
echo "== Type =="
echo
cat "$PKG_SCRIPTS/type"
fi
exit 0
fi
Expand All @@ -353,11 +353,11 @@ if [ ! -f "$PKG_SRC" ]; then
else
# Handle all the legacy cruft. This branch can be deleted once
# we get rid of old-style spkgs
if [ $YES = -1 ]; then
# User provided -n option, so don't even try to download the package"
echo "Old-style packages disabled by use of '-n' option"
exit 1
fi
if [ $YES = -1 ]; then
# User provided -n option, so don't even try to download the package"
echo "Old-style packages disabled by use of '-n' option"
exit 1
fi
if [ $INFO -eq 0 ]; then
echo "Attempting to download package $PKG_NAME"
else
Expand Down Expand Up @@ -402,13 +402,13 @@ if [ ! -f "$PKG_SRC" ]; then
# If the download failed (for whatever reason),
# fall through and use the .spkg file.
else
if [ $YES != 1 ]; then
# Warn and ask the user if downloading an
# experimental package.
# Add a deprecation note for other packages,
# since old-style packages are deprecated.
if [ $repo = experimental ]; then
write_to_tty <<EOF
if [ $YES != 1 ]; then
# Warn and ask the user if downloading an
# experimental package.
# Add a deprecation note for other packages,
# since old-style packages are deprecated.
if [ $repo = experimental ]; then
write_to_tty <<EOF
================================ WARNING =================================
You are about to download and install an unmaintained experimental
package. This probably won't work at all for you! There is no guarantee
Expand All @@ -420,22 +420,22 @@ For more information about making Sage packages, see
http://doc.sagemath.org/html/en/developer/packaging.html
==========================================================================
EOF
if [ $? -ne 0 ]; then
echo "Terminal not available for prompting. Use 'sage -i -y $PKG_BASE'"
echo "to install experimental packages in non-interactive mode."
YES=-1
fi
if [ $YES != -1 ]; then
read -p "Are you sure you want to continue [Y/n]? " answer < /dev/tty > /dev/tty 2>&1
else
answer=n
fi
case "$answer" in
n*|N*) exit 1;;
esac
else
# Deprecated since Sage 6.9, Trac #19158
write_to_tty <<EOF
if [ $? -ne 0 ]; then
echo "Terminal not available for prompting. Use 'sage -i -y $PKG_BASE'"
echo "to install experimental packages in non-interactive mode."
YES=-1
fi
if [ $YES != -1 ]; then
read -p "Are you sure you want to continue [Y/n]? " answer < /dev/tty > /dev/tty 2>&1
else
answer=n
fi
case "$answer" in
n*|N*) exit 1;;
esac
else
# Deprecated since Sage 6.9, Trac #19158
write_to_tty <<EOF
================================== NOTE ==================================
You are about to download and install an old-style package. While this
might still work fine, old-style packages are unmaintained and deprecated.
Expand All @@ -446,21 +446,21 @@ For more information about making Sage packages, see
http://doc.sagemath.org/html/en/developer/packaging.html
==========================================================================
EOF
if [ $? = 0 -a $YES != -1 ]; then
read -t 30 -p "Are you sure (automatically continuing in 30 seconds) [Y/n]? " answer < /dev/tty > /dev/tty 2>&1
elif [ $YES = -1 ]; then
answer=n
else
answer=y
fi
case "$answer" in
n*|N*) exit 1;;
esac
fi
# Confirm the user's input. (This gives important
# feedback to the user when output is redirected to a logfile.)
echo > /dev/tty "OK, installing $PKG_NAME now..."
fi
if [ $? = 0 -a $YES != -1 ]; then
read -t 30 -p "Are you sure (automatically continuing in 30 seconds) [Y/n]? " answer < /dev/tty > /dev/tty 2>&1
elif [ $YES = -1 ]; then
answer=n
else
answer=y
fi
case "$answer" in
n*|N*) exit 1;;
esac
fi
# Confirm the user's input. (This gives important
# feedback to the user when output is redirected to a logfile.)
echo > /dev/tty "OK, installing $PKG_NAME now..."
fi
fi
PKG_URL="$MIRROR/$repo/$pkg.spkg"
break
Expand Down
4 changes: 2 additions & 2 deletions build/bin/sage-uncompress-spkg
@@ -1,12 +1,12 @@
#!/usr/bin/env python

# usage: sage-uncompress-spkg [-h] [-d DIR] PKG [FILE]
#
#
# positional arguments:
# PKG the archive to extract
# FILE (deprecated) print the contents of the given archive member to
# stdout
#
#
# optional arguments:
# -h, --help show this help message and exit
# -d DIR directory to extract archive contents into
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/autotools/Makefile.build
Expand Up @@ -21,7 +21,7 @@ $(SAGE_LOCAL)/bin/help2man: $(SRC)/help2man-1.46.4 $(SAGE_LOCAL)/bin/makeinfo
########################################################################

# Extract sources from git repository serially
autoconf-2.13.rc1/.tarball-version:
autoconf-2.13.rc1/.tarball-version:
( cd $(SRC)/autoconf && git archive --format=tar --prefix=autoconf-2.13.rc1/ autoconf-2-13-rc1 ) | tar xf -
echo 2.13.rc1 >autoconf-2.13.rc1/.tarball-version

Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/autotools/dependencies
@@ -1,4 +1,4 @@
ncurses git xz
ncurses git xz

----------
All lines of this file are ignored except the first.
Expand Down
40 changes: 20 additions & 20 deletions build/pkgs/autotools/spkg-write-makefile
Expand Up @@ -141,10 +141,10 @@ write_make_rules() {
ac_ver=`( echo 2.59; autoconf --trace='AC_PREREQ:$1' configure.ac ) | latest_version`
fi

# Automake 1.10 thinks it only needs autoconf 2.59, when in fact it needs 2.60. Fix it up.
if [ $p = automake ] && [ $v = 1.10 ]; then
ac_ver=2.60
fi
# Automake 1.10 thinks it only needs autoconf 2.59, when in fact it needs 2.60. Fix it up.
if [ $p = automake ] && [ $v = 1.10 ]; then
ac_ver=2.60
fi

# Minimum required version of libtool.
# Empty by default.
Expand Down Expand Up @@ -183,29 +183,29 @@ write_make_rules() {
echo "$p-$v/.tarball-version: $prevextract"
echo -e "\t( cd \$(SRC)/$p && git archive --format=tar --prefix=$p-$v/ $tag ) | tar xf -"
echo -e "\techo $v >$p-$v/.tarball-version"
if [ $p = libtool -a ! -f .serial ] ; then
# The file .serial would be generated at "make dist" time. It is used in ltversion.m4.
# If .serial is missing, ltmversion.m4 will be malformed, causing the following warning
# when the user uses autoreconf.
# m4/ltversion.m4:12: warning: ill-formed serial number 'ltversion.m4',
# expecting a version string with only digits and dots
# See Trac #21047.
# Since we don't do "make dist" but rather build from a repository check-out, we have to
# supply the .serial file ourselves. The following recipe is from libtool's Makefile.am.
echo -e "\techo $( git log --pretty=oneline | wc -l | sed 's|[\t ]||g ' ) > $p-$v/.serial"
fi
if [ $p = libtool -a ! -f .serial ] ; then
# The file .serial would be generated at "make dist" time. It is used in ltversion.m4.
# If .serial is missing, ltmversion.m4 will be malformed, causing the following warning
# when the user uses autoreconf.
# m4/ltversion.m4:12: warning: ill-formed serial number 'ltversion.m4',
# expecting a version string with only digits and dots
# See Trac #21047.
# Since we don't do "make dist" but rather build from a repository check-out, we have to
# supply the .serial file ourselves. The following recipe is from libtool's Makefile.am.
echo -e "\techo $( git log --pretty=oneline | wc -l | sed 's|[\t ]||g ' ) > $p-$v/.serial"
fi
echo

echo "\$(SAGE_LOCAL)/$p-$v: $p-$v/.tarball-version $deps"
echo -e "\texport MAKE='\$(MAKE) -j1' ; \\\\"
[ -z "$lt_ver" ] || echo -e "\texport LIBTOOL_VERSION=$lt_ver ; \\\\"
[ -z "$ac_ver" ] || echo -e "\texport AUTOCONF_VERSION=$ac_ver ; \\\\"
[ -z "$am_ver" ] || echo -e "\texport AUTOMAKE_VERSION=$am_ver ; \\\\"
echo -e "\tcd $p-$v && ${bootstrap}\\\\"
echo -e "\t ./configure --prefix=\"\$(SAGE_LOCAL)/$p-$v\" && \\\\"
echo -e "\t \$\$MAKE && \$\$MAKE install"
echo -e "\t# Remove all files except for the .* files"
echo -e "\t[ \"\$\$SAGE_KEEP_BUILT_SPKGS\" = yes ] || rm -rf $p-$v/*"
echo -e "\tcd $p-$v && ${bootstrap}\\\\"
echo -e "\t ./configure --prefix=\"\$(SAGE_LOCAL)/$p-$v\" && \\\\"
echo -e "\t \$\$MAKE && \$\$MAKE install"
echo -e "\t# Remove all files except for the .* files"
echo -e "\t[ \"\$\$SAGE_KEEP_BUILT_SPKGS\" = yes ] || rm -rf $p-$v/*"
echo

prevextract="$p-$v/.tarball-version"
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/benzene/SPKG.txt
Expand Up @@ -17,7 +17,7 @@ http://www.grinvin.org/

=== benzene-20130630 Nico Van Cleemput (10th September 2014) ===
* #16963: Update for the sage-git directory layout.

=== benzene-20130630 Nico Van Cleemput (30th June 2013) ===
* First release put into Sage.

4 changes: 2 additions & 2 deletions build/pkgs/bliss/spkg-src
Expand Up @@ -11,7 +11,7 @@ die () {

rm -rf bliss/
git clone -b sage_package https://github.com/mkoeppe/bliss.git || die "Failed to git clone"
cd bliss/
cd bliss/

VERSION=`autoconf --trace='AC_INIT:$2'`
libtoolize || die "Failed to autoreconf"
Expand All @@ -23,6 +23,6 @@ rm -f bliss-$VERSION.tar.gz
make dist || die "make dist failed"
mv bliss-$VERSION.tar.gz ../
cd ..
rm -rf bliss/
rm -rf bliss/


2 changes: 1 addition & 1 deletion build/pkgs/boost_cropped/SPKG.txt
Expand Up @@ -27,7 +27,7 @@ None
=== boost_cropped-1.58.0 (Emmanuel Charpentier, November 13th, 2015) ===
* Updated to boost_1_58_0/boost
* Created spkg-src

=== boost_cropped-1.52.0 (Timo Kluck, February 26th, 2013) ===
* Drop sage patches; take all upstream headers

Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/buckygen/SPKG.txt
@@ -1,7 +1,7 @@
= Buckygen =

== Description ==
Buckygen is a program for the efficient generation of all nonisomorphic fullerenes. These are triangulations where all vertices have degree 5 or 6. Or if the dual representation is used: cubic plane graphs where all faces are pentagons or hexagons.
Buckygen is a program for the efficient generation of all nonisomorphic fullerenes. These are triangulations where all vertices have degree 5 or 6. Or if the dual representation is used: cubic plane graphs where all faces are pentagons or hexagons.

== License ==
Buckygen is licensed under the GNU General Public License v3 ( June 2007 )
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/cddlib/spkg-check
Expand Up @@ -12,7 +12,7 @@ run_test() {
cat input/$1 | $SAGE_LOCAL/bin/cdd_both_reps_gmp --all > $TEST_OUTPUT
# Now, compare the two outputs and error out if there is a discrepancy:
diff -n output/$1 $TEST_OUTPUT || ( \
echo "cdd_both_reps not working as expected"; \
echo "cdd_both_reps not working as expected"; \
exit 1 )
}

Expand Down
10 changes: 5 additions & 5 deletions build/pkgs/cddlib/spkg-install
Expand Up @@ -7,14 +7,14 @@ die () {

[ -n "$SAGE_LOCAL" ] || die "SAGE_LOCAL undefined, maybe run \`sage -sh\`?"

# Normaly for a 64-bit build, the -m64 option is added to
# gcc, but other compilers will not accept that, so
# Normally for a 64-bit build, the -m64 option is added to
# gcc, but other compilers will not accept that, so
# allow it to be configured as something different if need
# be.
# be.

if [ -z $CFLAG64 ] ; then
if [ -z $CFLAG64 ] ; then
CFLAG64=-m64
fi
fi

if [ "x$SAGE64" = xyes ]; then
echo "64 bit build of cddlib"
Expand Down

0 comments on commit 484b5f9

Please sign in to comment.