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

Commit

Permalink
20697: Merge with latest beta.
Browse files Browse the repository at this point in the history
  • Loading branch information
Grayson Jorgenson committed May 31, 2016
2 parents 5a5fe9a + 769ff19 commit b3e8447
Show file tree
Hide file tree
Showing 875 changed files with 29,033 additions and 22,722 deletions.
24 changes: 7 additions & 17 deletions Makefile
Expand Up @@ -15,7 +15,7 @@ build: all-build
%::
@if [ -x relocate-once.py ]; then ./relocate-once.py; fi
$(MAKE) build/make/Makefile
+build/bin/sage-logger \
+build/bin/sage-logger -p \
"cd build/make && ./install '$@'" logs/install.log

# If configure was run before, rerun it with the old arguments.
Expand Down Expand Up @@ -130,22 +130,12 @@ configure: configure.ac src/bin/sage-version.sh m4/*.m4
./bootstrap -d

install:
echo "Experimental use only!"
if [ "$(DESTDIR)" = "" ]; then \
echo >&2 "Set the environment variable DESTDIR to the install path."; \
exit 1; \
fi
# Make sure we remove only an existing directory. If $(DESTDIR)/sage is
# a file instead of a directory then the mkdir statement later will fail
if [ -d "$(DESTDIR)"/sage ]; then \
rm -rf "$(DESTDIR)"/sage; \
fi
mkdir -p "$(DESTDIR)"/sage
mkdir -p "$(DESTDIR)"/bin
cp -Rp * "$(DESTDIR)"/sage
rm -f "$(DESTDIR)"/bin/sage
ln -s ../sage/sage "$(DESTDIR)"/bin/sage
"$(DESTDIR)"/bin/sage -c # Run sage-location
@echo "******************************************************************"
@echo "The '$@' target is no longer supported:"
@echo "either build SageMath in-place or use the binary packaging scripts"
@echo "from https://github.com/sagemath/binary-pkg"
@echo "******************************************************************"
@exit 1


.PHONY: default build install micro_release \
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
@@ -1 +1 @@
SageMath version 7.2.rc1, Release Date: 2016-05-07
SageMath version 7.3.beta2, Release Date: 2016-05-28
22 changes: 20 additions & 2 deletions build/bin/sage-logger
@@ -1,11 +1,14 @@
#!/usr/bin/env bash
#
# sage-logger COMMAND LOGFILE
# sage-logger [-p] COMMAND LOGFILE
#
# Evaluate shell command COMMAND while logging stdout and stderr to
# LOGFILE. If either the command or the logging failed, return a
# non-zero exit status.
#
# If the -p argument is given, each line printed to stdout is prefixed
# with the name of the log file.
#
# AUTHOR:
#
# - Jeroen Demeyer (2015-07-26): initial version based on old pipestatus
Expand All @@ -20,16 +23,31 @@
# http://www.gnu.org/licenses/
#*****************************************************************************

use_prefix=false

if [[ "$1" = -p ]]; then
use_prefix=true
shift
fi

cmd="$1"
logfile="$2"
logname="$(basename $logfile .log)"
logdir=`dirname "$logfile"`

if [[ $use_prefix = true ]]; then
prefix="[${logname}] "
else
prefix=""
fi

mkdir -p "$logdir"

# 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" )
( exec 2>&1; eval "$cmd" ) | ( trap '' SIGINT; tee -a "$logfile" ) | \
(while read line; do echo "${prefix}${line}"; done)

pipestatus=(${PIPESTATUS[*]})

Expand Down
29 changes: 28 additions & 1 deletion build/bin/sage-uncompress-spkg
Expand Up @@ -10,15 +10,42 @@
# stdout. (This option is present only for backwards compatibility:
# printing the SPKG.txt file from an old-style spkg.)

import copy
import os
import sys
import tarfile
import zipfile


class UmaskExtractTarFile(tarfile.TarFile):
"""
Sage as tarfile.TarFile, but applies the user's current umask to the
permissions of al extracted files and directories.
This mimics the default behavior of the ``tar`` utility.
See http://trac.sagemath.org/ticket/20218#comment:16 for more background.
"""

def __init__(self, *args, **kwargs):
super(UmaskExtractTarFile, self).__init__(*args, **kwargs)

# Unfortunately the only way to get the current umask is to set it
# and then restore it
self.umask = os.umask(0777)
os.umask(self.umask)

def chmod(self, tarinfo, target):
tarinfo = copy.copy(tarinfo)
tarinfo.mode &= ~self.umask
return super(UmaskExtractTarFile, self).chmod(tarinfo, target)


if __name__ == '__main__':
filename = sys.argv[1]
if tarfile.is_tarfile(filename):
# tar file, possibly compressed:
archive = tarfile.open(filename, 'r:*')
archive = UmaskExtractTarFile.open(filename, 'r:*')
if len(sys.argv) == 2:
archive.extractall()
else:
Expand Down
10 changes: 5 additions & 5 deletions build/make/deps
Expand Up @@ -149,7 +149,7 @@ sagelib: \
$(EXTCODE)
if [ -z "$$SAGE_INSTALL_FETCH_ONLY" ]; then \
cd $(SAGE_SRC) && source bin/sage-env && \
sage-logger 'time $(MAKE) sage' '$(SAGE_LOGS)/sagelib-$(SAGE_VERSION).log'; \
sage-logger -p 'time $(MAKE) sage' '$(SAGE_LOGS)/sagelib-$(SAGE_VERSION).log'; \
fi


Expand Down Expand Up @@ -197,23 +197,23 @@ DOC_DEPENDENCIES = sagelib $(inst_sphinx) $(inst_sagenb) \
doc: doc-html

doc-html: $(DOC_DEPENDENCIES)
cd ../.. && sage-logger './sage --docbuild --no-pdf-links all html $(SAGE_DOCBUILD_OPTS)' logs/dochtml.log
cd ../.. && sage-logger -p './sage --docbuild --no-pdf-links all html $(SAGE_DOCBUILD_OPTS)' logs/dochtml.log

# 'doc-html-no-plot': build docs without building the graphics coming
# from the '.. plot' directive, in case you want to save a few
# megabytes of disk space. 'doc-clean' is a prerequisite because the
# presence of graphics is cached in src/doc/output.
doc-html-no-plot: doc-clean $(DOC_DEPENDENCIES)
cd ../.. && sage-logger './sage --docbuild --no-pdf-links --no-plot all html $(SAGE_DOCBUILD_OPTS)' logs/dochtml.log
cd ../.. && sage-logger -p './sage --docbuild --no-pdf-links --no-plot all html $(SAGE_DOCBUILD_OPTS)' logs/dochtml.log

doc-html-mathjax: $(DOC_DEPENDENCIES)
cd ../.. && sage-logger './sage --docbuild --no-pdf-links all html -j $(SAGE_DOCBUILD_OPTS)' logs/dochtml.log
cd ../.. && sage-logger -p './sage --docbuild --no-pdf-links all html -j $(SAGE_DOCBUILD_OPTS)' logs/dochtml.log

# Keep target 'doc-html-jsmath' for backwards compatibility.
doc-html-jsmath: doc-html-mathjax

doc-pdf: $(DOC_DEPENDENCIES)
cd ../.. && sage-logger './sage --docbuild all pdf $(SAGE_DOCBUILD_OPTS)' logs/docpdf.log
cd ../.. && sage-logger -p './sage --docbuild all pdf $(SAGE_DOCBUILD_OPTS)' logs/docpdf.log

doc-clean: doc-src-clean doc-output-clean

Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/alabaster/checksums.ini
@@ -1,4 +1,4 @@
tarball=alabaster-VERSION.tar.gz
sha1=ff3e575ee7eb4ba1721f17d91ec5a54b16283603
md5=957c665d7126dea8121f98038debcba7
cksum=738605178
sha1=c80dedaf4a1906410e53b653de059fe9d8b17c68
md5=346a71e8a6d51dff2e02086fdd9c5ffe
cksum=2849350596
2 changes: 1 addition & 1 deletion build/pkgs/alabaster/package-version.txt
@@ -1 +1 @@
0.7.7
0.7.8
6 changes: 3 additions & 3 deletions build/pkgs/babel/checksums.ini
@@ -1,4 +1,4 @@
tarball=Babel-VERSION.tar.gz
sha1=e02392bc9a16f7672686bce23e4e3cdadcc1b1c8
md5=1b69e4b2ab3795119266ccaa36b36f15
cksum=2897183559
sha1=c92786942f1c920e3c39a057a7678d2aa0d1c44c
md5=afa20bc55b0e991833030129ad498f35
cksum=4254002491
2 changes: 1 addition & 1 deletion build/pkgs/babel/package-version.txt
@@ -1 +1 @@
2.2.0
2.3.4
5 changes: 5 additions & 0 deletions build/pkgs/backports_shutil_get_terminal_size/SPKG.txt
@@ -0,0 +1,5 @@
= backports.shutil_get_terminal_size =

== Description ==

A backport of the get_terminal_size function from Python 3.3's shutil.
4 changes: 4 additions & 0 deletions build/pkgs/backports_shutil_get_terminal_size/checksums.ini
@@ -0,0 +1,4 @@
tarball=backports.shutil_get_terminal_size-VERSION.tar.gz
sha1=a9774b04db0abc2df1b4b603699469358967346c
md5=03267762480bd86b50580dc19dff3c66
cksum=2627812760
5 changes: 5 additions & 0 deletions build/pkgs/backports_shutil_get_terminal_size/dependencies
@@ -0,0 +1,5 @@
$(PYTHON) | setuptools

----------
All lines of this file are ignored except the first.
It is copied by SAGE_ROOT/build/make/install into SAGE_ROOT/build/make/Makefile.
@@ -0,0 +1 @@
1.0.0.p0
69 changes: 69 additions & 0 deletions build/pkgs/backports_shutil_get_terminal_size/patches/master.patch
@@ -0,0 +1,69 @@
Diff between the latest release and the github master

diff -ru backports.shutil_get_terminal_size-1.0.0/backports/shutil_get_terminal_size/get_terminal_size.py backports.shutil_get_terminal_size/backports/shutil_get_terminal_size/get_terminal_size.py
--- backports.shutil_get_terminal_size-1.0.0/backports/shutil_get_terminal_size/get_terminal_size.py 2014-08-19 01:52:24.000000000 +0200
+++ backports.shutil_get_terminal_size/backports/shutil_get_terminal_size/get_terminal_size.py 2016-05-12 17:59:57.208494332 +0200
@@ -16,30 +16,30 @@
terminal_size = namedtuple("terminal_size", "columns lines")

try:
- from ctypes import windll, create_string_buffer
+ from ctypes import windll, create_string_buffer, WinError

- _handles = {
- 0: windll.kernel32.GetStdHandle(-10),
- 1: windll.kernel32.GetStdHandle(-11),
- 2: windll.kernel32.GetStdHandle(-12),
+ _handle_ids = {
+ 0: -10,
+ 1: -11,
+ 2: -12,
}

def _get_terminal_size(fd):
- columns = lines = 0
-
- try:
- handle = _handles[fd]
- csbi = create_string_buffer(22)
- res = windll.kernel32.GetConsoleScreenBufferInfo(handle, csbi)
- if res:
- res = struct.unpack("hhhhHhhhhhh", csbi.raw)
- left, top, right, bottom = res[5:9]
- columns = right - left + 1
- lines = bottom - top + 1
- except Exception:
- pass
-
- return terminal_size(columns, lines)
+ handle = windll.kernel32.GetStdHandle(_handle_ids[fd])
+ if handle == 0:
+ raise OSError('handle cannot be retrieved')
+ if handle == -1:
+ raise WinError()
+ csbi = create_string_buffer(22)
+ res = windll.kernel32.GetConsoleScreenBufferInfo(handle, csbi)
+ if res:
+ res = struct.unpack("hhhhHhhhhhh", csbi.raw)
+ left, top, right, bottom = res[5:9]
+ columns = right - left + 1
+ lines = bottom - top + 1
+ return terminal_size(columns, lines)
+ else:
+ raise WinError()

except ImportError:
import fcntl
@@ -48,9 +48,9 @@
def _get_terminal_size(fd):
try:
res = fcntl.ioctl(fd, termios.TIOCGWINSZ, b"\x00" * 4)
- lines, columns = struct.unpack("hh", res)
- except Exception:
- columns = lines = 0
+ except IOError as e:
+ raise OSError(e)
+ lines, columns = struct.unpack("hh", res)

return terminal_size(columns, lines)

14 changes: 14 additions & 0 deletions build/pkgs/backports_shutil_get_terminal_size/spkg-install
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

cd src

for patch in ../patches/*.patch; do
[ -r "$patch" ] || continue # Skip non-existing or non-readable patches
patch -p1 <"$patch"
if [ $? -ne 0 ]; then
echo >&2 "Error applying '$patch'"
exit 1
fi
done

python setup.py install
1 change: 1 addition & 0 deletions build/pkgs/backports_shutil_get_terminal_size/type
@@ -0,0 +1 @@
standard
2 changes: 2 additions & 0 deletions build/pkgs/brial/spkg-install
Expand Up @@ -22,6 +22,8 @@ for patch in ../patches/*.patch; do
fi
done

touch aclocal.m4 configure Makefile.in

./configure \
--prefix="$SAGE_LOCAL" \
--libdir="$SAGE_LOCAL/lib" \
Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=6ba41f01a5e6c4244ae0cd1b777d1f105ca2c507
md5=44f2228be0b7190646294a40ff5b7806
cksum=3056196411
sha1=6e250d8c145ce4d2561d0e33c01f26f08bf3b561
md5=955f5d5678d0276c9b9b2181963bc7ec
cksum=3564541652
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
@@ -1 +1 @@
162
167
6 changes: 3 additions & 3 deletions build/pkgs/cysignals/checksums.ini
@@ -1,4 +1,4 @@
tarball=cysignals-VERSION.tar.bz2
sha1=26b5fa9ac855af6ab33157fe7c8f095ca086063b
md5=31e95c68349b33b7781969e0d1ecab91
cksum=939390582
sha1=1ad0314a19bfad58dfb689c534087c31241c07f0
md5=20483b618a1d5c65485d38a2d0002386
cksum=507747317
2 changes: 1 addition & 1 deletion build/pkgs/cysignals/package-version.txt
@@ -1 +1 @@
1.1.0
1.1.1
6 changes: 3 additions & 3 deletions build/pkgs/ecl/checksums.ini
@@ -1,4 +1,4 @@
tarball=ecl-VERSION.tar.bz2
sha1=a2ba6f17df11e77149869d7d71c2175c284778ce
md5=fdca3688a9171518f301e4200f82532a
cksum=3217462385
sha1=66f99db852b23660668e8c1d5304ec842558d1a2
md5=14740f65bb971127bb10caaff855361e
cksum=1956945543
2 changes: 1 addition & 1 deletion build/pkgs/ecl/package-version.txt
@@ -1 +1 @@
15.3.7.p1
16.1.2.p0
2 changes: 1 addition & 1 deletion build/pkgs/ecl/patches/src/gmp.patch
Expand Up @@ -3,7 +3,7 @@ index bc8d84b..e076e09 100644
--- b/src/configure.ac
+++ a/src/configure.ac
@@ -11,7 +11,7 @@ dnl
AC_INIT([ecl],[15.3.7],[])
AC_INIT([ecl],[16.1.2],[])
AC_REVISION([$Revision$])
AC_CONFIG_SRCDIR([bare.lsp.in])
-AC_CONFIG_AUX_DIR([gmp])
Expand Down

0 comments on commit b3e8447

Please sign in to comment.