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

Commit

Permalink
20790: merge with sage 7.3.rc0
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjorgenson committed Jul 30, 2016
2 parents c69bcd1 + c4f3c93 commit 16d6207
Show file tree
Hide file tree
Showing 1,210 changed files with 36,663 additions and 12,566 deletions.
15 changes: 10 additions & 5 deletions README.md
Expand Up @@ -3,7 +3,7 @@
> "Creating a Viable Open Source Alternative to
> Magma, Maple, Mathematica, and MATLAB"
> Copyright (C) 2005-2014 The Sage Development Team
> Copyright (C) 2005-2016 The Sage Development Team
http://www.sagemath.org

Expand Down Expand Up @@ -67,7 +67,7 @@ source. More detailed instructions, including how to build faster on
multicore machines, are contained later in this README and in the
Installation Guide:

http://www.sagemath.org/doc/installation
http://doc.sagemath.org/html/en/installation

__1. Make sure you have the dependencies and 5 GB of free disk space.__

Expand Down Expand Up @@ -110,14 +110,19 @@ __3. cd into the Sage directory and type make:__
should work fine on all fully supported platforms. If it does not, we
want to know!

If you'd like to contribute to Sage, be sure to read the
Developer's Guide:

http://doc.sagemath.org/html/en/developer/index.html


Environment Variables
---------------------

There are a lot of environment variables which control the install
process of Sage, see:

http://sagemath.org/doc/installation/source.html#environment-variables
http://doc.sagemath.org/html/en/installation/source.html#environment-variables


Implementation
Expand Down Expand Up @@ -325,7 +330,7 @@ SAGE_ROOT Root directory (sage-x.y.z in Sage tarball)
```
For more details, see:

http://sagemath.org/doc/developer/coding_basics.html#files-and-directory-structure
http://doc.sagemath.org/html/en/developer/coding_basics.html#files-and-directory-structure


Relocation
Expand All @@ -343,7 +348,7 @@ Sage as root at least once prior to using the system-wide Sage as a
normal user. See the Installation Guide for further information on
performing a system-wide installation:

http://www.sagemath.org/doc/installation/source.html#installation-in-a-multiuser-environment
http://doc.sagemath.org/html/en/installation/source.html#installation-in-a-multiuser-environment

If you find anything that doesn't work correctly after you moved the
directory, please email the sage-support mailing list.
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
@@ -1 +1 @@
SageMath version 7.3.beta6, Release Date: 2016-06-30
SageMath version 7.3.rc0, Release Date: 2016-07-28
9 changes: 6 additions & 3 deletions build/bin/sage-spkg
Expand Up @@ -272,7 +272,8 @@ elif [ -z "$PKG_HAS_PATH" ]; then
echo "that it will build correctly, or behave as expected."
echo "Use at your own risk!"
echo "==============================================================="
read -p "Are you sure you want to continue [Y/n]? " answer
echo "Are you sure you want to continue [Y/n]?"
read -p "Answer: " answer
case "$answer" in
n*|N*) exit 0;;
esac
Expand Down Expand Up @@ -365,7 +366,8 @@ if [ ! -f "$PKG_SRC" ]; then
echo "For more information about making Sage packages, see"
echo "http://doc.sagemath.org/html/en/developer/packaging.html"
echo "=========================================================================="
read -p "Are you sure you want to continue [Y/n]? " answer
echo "Are you sure you want to continue [Y/n]?"
read -p "Answer: " answer
case "$answer" in
n*|N*) exit 0;;
esac
Expand All @@ -381,7 +383,8 @@ if [ ! -f "$PKG_SRC" ]; then
echo "http://doc.sagemath.org/html/en/developer/packaging.html"
echo "=========================================================================="
echo
read -t 30 -p "Are you sure (automatically continuing in 30 seconds) [Y/n]? " answer
echo "Are you sure (automatically continuing in 30 seconds) [Y/n]?"
read -t 30 -p "Answer: " answer
case "$answer" in
n*|N*) exit 0;;
esac
Expand Down
264 changes: 21 additions & 243 deletions build/bin/sage-uncompress-spkg
@@ -1,245 +1,23 @@
#!/usr/bin/env python

"""
USAGE:
sage-uncompress-spkg [-d DIR] PKG [FILE]
With a single argument, unpack the file PKG to the current directory.
If a directory is specified with the -d option the contents of
the archive are extracted into that directory using the following
rules:
1. If the archive contains (like most) a top-level directory
which contains all other files in the archive, the contents
of that directory are extracted into DIR, ignoring the name
of the top-level directory in the archive.
2. If the archive does not contain a single top-level directory
then all the contents of the archive are extracted into DIR.
The directory must not already exist.
If FILE is specified, extract FILE from PKG and send it to
stdout. (This option is present only for backwards compatibility:
printing the SPKG.txt file from an old-style spkg.)
"""

from __future__ import print_function

import argparse
import copy
import os
import sys
import tarfile
import zipfile


def filter_os_files(filenames):
"""
Given a list of filenames, returns a filtered list with OS-specific
special files removed.
Currently removes OSX .DS_Store files and AppleDouble format ._ files.
"""

files_set = set(filenames)

def is_os_file(path):
dirname, name = os.path.split(path)

if name == '.DS_Store':
return True

if name.startswith('._'):
name = os.path.join(dirname, name[2:])
# These files store extended attributes on OSX
# In principle this could be a false positive but it's
# unlikely, and to be really sure we'd have to extract the file
# (or at least the first four bytes to check for the magic number
# documented in
# http://kaiser-edv.de/documents/AppleSingle_AppleDouble.pdf)
if name in files_set or os.path.normpath(name) in files_set:
return True

return False

filenames = filter(lambda f: not is_os_file(f), filenames)

if sys.version_info[0] == 2:
return filenames
else:
# Make sure to return a list on Python >= 3
return list(filenames)


class SageTarFile(tarfile.TarFile):
"""
Sage as tarfile.TarFile, but applies the user's current umask to the
permissions of all 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(SageTarFile, 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(0o777)
os.umask(self.umask)

@classmethod
def can_read(cls, filename):
"""
Given an archive filename, returns True if this class can read and
process the archive format of that file.
"""

return tarfile.is_tarfile(filename)

@property
def names(self):
"""
List of filenames in the archive.
Filters out names of OS-related files that shouldn't be in the
archive (.DS_Store, etc.)
"""

return filter_os_files(self.getnames())

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

def extractall(self, path='.', members=None):
"""
Same as tarfile.TarFile.extractall but allows filenames for
the members argument (like zipfile.ZipFile).
"""
if members:
name_to_member = dict([member.name, member] for member in self.getmembers())
members = [m if isinstance(m, tarfile.TarInfo)
else name_to_member[m]
for m in members]
return super(SageTarFile, self).extractall(path=path, members=members)

def extractbytes(self, member):
"""
Return the contents of the specified archive member as bytes.
If the member does not exist, returns None.
"""

if member in self.getnames():
reader = self.extractfile(member)
return reader.read()


class SageZipFile(zipfile.ZipFile):
"""
Wrapper for zipfile.ZipFile to provide better API fidelity with
SageTarFile insofar as it's used by this script.
"""

@classmethod
def can_read(cls, filename):
"""
Given an archive filename, returns True if this class can read and
process the archive format of that file.
"""

return zipfile.is_zipfile(filename)

@property
def names(self):
"""
List of filenames in the archive.
Filters out names of OS-related files that shouldn't be in the
archive (.DS_Store, etc.)
"""

return filter_os_files(self.namelist())

def extractbytes(self, member):
"""
Return the contents of the specified archive member as bytes.
If the member does not exist, returns None.
"""

if member in self.namelist():
return self.read(member)


ARCHIVE_TYPES = [SageTarFile, SageZipFile]


def main(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument('-d', dest='dir', nargs=1, metavar='DIR',
help='directory to extract archive contents into')
parser.add_argument('pkg', nargs=1, metavar='PKG',
help='the archive to extract')
parser.add_argument('file', nargs='?', metavar='FILE',
help='(deprecated) print the contents of the given '
'archive member to stdout')

args = parser.parse_args(argv)

filename = args.pkg[0]
dirname = args.dir and args.dir[0]

for cls in ARCHIVE_TYPES:
if cls.can_read(filename):
break
else:
print('Error: Unknown file type: {}'.format(filename),
file=sys.stderr)
return 1

# For now ZipFile and TarFile both have default open modes that are
# acceptable
archive = cls.open(filename)

if args.file:
contents = archive.extractbytes(args.file)
if contents:
print(contents, end='')
return 0
else:
return 1

top_level = None

if dirname:
if os.path.exists(dirname):
print('Error: Directory {} already exists'.format(dirname),
file=sys.stderr)
return 1

top_levels = set()
for member in archive.names:
# Zip and tar files all use forward slashes as separators
# internally
top_levels.add(member.split('/', 1)[0])

if len(top_levels) == 1:
top_level = top_levels.pop()

archive.extractall(members=archive.names)

if top_level:
os.rename(top_level, dirname)

return 0


if __name__ == '__main__':
sys.exit(main())
# 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


try:
import sage_bootstrap
except ImportError:
import os, sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import sage_bootstrap

from sage_bootstrap.uncompress.cmdline import run
run()
2 changes: 1 addition & 1 deletion build/make/deps
Expand Up @@ -192,7 +192,7 @@ DOC_DEPENDENCIES = sagelib $(inst_sphinx) $(inst_sagenb) \
| $(SAGERUNTIME) $(inst_maxima) $(inst_networkx) $(inst_scipy) \
$(inst_matplotlib) $(inst_pillow) $(inst_mathjax) $(inst_mpmath) \
$(inst_ipykernel) $(inst_jupyter_client) $(inst_conway_polynomials) \
$(inst_tachyon)
$(inst_tachyon) $(inst_jmol)

doc: doc-html

Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/4ti2/dependencies
@@ -1,4 +1,4 @@
$(MP_LIBRARY) glpk
zlib $(MP_LIBRARY) glpk

----------
All lines of this file are ignored except the first.
Expand Down
4 changes: 2 additions & 2 deletions build/pkgs/atlas/patches/Makefile.patch
@@ -1,5 +1,5 @@
--- src/CONFIG/src/Makefile 2012-06-23 17:27:27.000000000 +0100
+++ new/CONFIG/src/Makefile 2012-06-24 03:05:52.043151077 +0100
--- src/ATLAS/CONFIG/src/Makefile 2012-06-23 17:27:27.000000000 +0100
+++ new/ATLAS/CONFIG/src/Makefile 2012-06-24 03:05:52.043151077 +0100
@@ -580,6 +580,6 @@
confclean: $(CLEANdep)
rm -f *core* *.o config?.out
Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/atlas/patches/arm_hard_floats.patch
@@ -1,6 +1,6 @@
diff -druN ATLAS.detect/CONFIG/src/atlcomp.txt ATLAS/CONFIG/src/atlcomp.txt
--- ATLAS.detect/CONFIG/src/atlcomp.txt 2013-01-08 10:15:42.000000000 -0800
+++ ATLAS/CONFIG/src/atlcomp.txt 2014-02-10 04:36:26.113011794 -0800
diff -druN ATLAS.detect/ATLAS/CONFIG/src/atlcomp.txt ATLAS/ATLAS/CONFIG/src/atlcomp.txt
--- ATLAS.detect/ATLAS/CONFIG/src/atlcomp.txt 2013-01-08 10:15:42.000000000 -0800
+++ ATLAS/ATLAS/CONFIG/src/atlcomp.txt 2014-02-10 04:36:26.113011794 -0800
@@ -255,13 +255,13 @@
# ARM defaults
#
Expand Down

0 comments on commit 16d6207

Please sign in to comment.