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

Commit

Permalink
Merge branch 't/21325/sequences/k-regular-subseq' into t/21319/sequen…
Browse files Browse the repository at this point in the history
…ces/rec-hash

* t/21325/sequences/k-regular-subseq: (2027 commits)
  Python3: xrange
  Python3: absolut import
  Python3: absolute import
  Python3: izip
  Python3: __nonzero__
  Trac #21295: fix typos
  Trac #21295: fix ReST error
  Updated SageMath version to 7.5
  Updated SageMath version to 7.5.rc3
  Use a deterministic sorting key for number fields
  Updated SageMath version to 7.5.rc2
  22136: pkg version/chksum
  Upgrade to Python 2.7.13
  Updated SageMath version to 7.5.rc1
  amending coment and message in setup.py
  Move autogen to a more appropriate location.
  22095: better doctest
  run tests only in spkg-check. Also run spkg-check with the same options as spkg-install
  SAGERUNTIME requires psutil
  22095: zero should be zero
  ...
  • Loading branch information
dkrenn committed Jan 24, 2017
2 parents 18c5268 + fc6c3f5 commit 714276c
Show file tree
Hide file tree
Showing 2,022 changed files with 78,963 additions and 32,920 deletions.
9 changes: 9 additions & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((nil
;; Use space instead of tabs for indentation
(indent-tabs-mode . nil))
(makefile-mode
;; But use tabs in Makefiles
(indent-tabs-mode . t)))
3 changes: 3 additions & 0 deletions COPYING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ free open source license as defined at http://www.opensource.org/.
The whole Sage software distribution is licensed under the General
Public License, version 3 (no other versions!).

All Sage documentation is licensed under Creative Commons 3.0 BY-SA
License.

Some of the code available in *optional* Sage packages (not included
in sage-*.tar) are licensed under more restrictive conditions.

Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SageMath version 7.4.beta2, Release Date: 2016-08-26
SageMath version 7.5, Release Date: 2017-01-11
2 changes: 2 additions & 0 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ MAKE="${MAKE:-make}"
CONFVERSION=`cat $PKG/package-version.txt`

bootstrap () {
# Get autotools from our own package into PATH (Trac #21214)
source src/bin/sage-env
aclocal -I m4 && \
automake --add-missing --copy build/make/Makefile-auto && \
autoconf
Expand Down
15 changes: 15 additions & 0 deletions build/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
This directory contains the build system of Sage, the distribution.

Subdirectories:

- bin: Various scripts needed at build time. Not installed.

- make: Makefiles and related scripts.

- pkgs: New-style sage packages.

- sage_bootstrap: Python utility library for dealing with
third-party tarballs and building Sage. See its README for
more information. Not installed.

- test: Test suite for sage_bootstrap.
78 changes: 78 additions & 0 deletions build/bin/sage-apply-patches
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/usr/bin/env bash
#
# sage-apply-patches [-p<num>] [-d patch-subdir] [patch-dir] -- [...]
#
# Apply any patches to original spkg sources. Patch files must have
# the .patch extension.
#
# By default the patches are applied from ../patches/ using the -p1
# option, and it is assumed that the patches are being applied from
# the root of the package source.
#
# An optional patch subdirectory may be specified with the -d flag.
# For example `sage-apply-patches -d cygwin` applies only those
# patches under <patch-dir>/cygwin.
#
# The -p<num> arg is the argument accepted by the `patch` command,
# and overrides the default -p1
#
# Any additional arguments following " -- " are passed directly
# to the `patch` command.
#
#***************************************************************************
#
# Distributed under the terms of the GNU General Public License (GPL)
# as published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
# http://www.gnu.org/licenses/
#***************************************************************************

patchdir="../patches"
patch_subdir=""
patch_strip="-p1"
patch_args_sep=""
patch_args="--no-backup-if-mismatch"

while [[ $# > 0 ]]; do
if [[ -z "$patch_args_sep" ]]; then
case $1 in
-d)
patch_subdir="${2%/}"
shift
;;
-p[0-9])
patch_strip="$1"
;;
--)
patch_args_sep="$1"
;;
*)
patchdir="${1%/}"
;;
esac
else
patch_args="$patch_args $1"
fi

shift
done

patchdir="${patchdir}/${patch_subdir}"
patchdir="${patchdir%/}"
patches=( "${patchdir}"/*.patch )

if [[ -r "${patches[0]}" ]]; then
echo "Applying patches from ${patchdir}..."
for patch in ${patches[@]}; do
# Skip non-existing or non-readable patches
[ -r "$patch" ] || continue
echo "Applying $patch"
patch $patch_strip $patch_args < "$patch"
if [ $? -ne 0 ]; then
echo >&2 "Error applying '$patch'"
exit 1
fi
done
else
>&2 echo "No patch files found in $patchdir"
fi
54 changes: 39 additions & 15 deletions build/bin/sage-logger
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,50 @@ fi
# Use sed option to reduce buffering, to make the output appear more
# smoothly. For GNU sed, this is the --unbuffered option.
# For BSD sed (which is also on OS X), this is the -l option.
if sed </dev/null 2>/dev/null --unbuffered ""; then
SED="sed --unbuffered"
elif sed </dev/null 2>/dev/null -l ""; then
SED="sed -l"
if [ -n "$prefix" ]; then
if sed </dev/null 2>/dev/null --unbuffered ""; then
SED="sed --unbuffered"
elif sed </dev/null 2>/dev/null -l ""; then
SED="sed -l"
else
SED="sed"
fi

# eval needed to get the quoting around the regexp right
SED="eval $SED 's/^/$prefix/'"
else
SED="sed"
# Make SED a useless use of cat
SED=cat
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" | $SED "s/^/$prefix/" )
if [[ "$V" = 0 && $use_prefix = true ]]; then
# Silent build.
# Similar to https://www.gnu.org/software/automake/manual/html_node/Automake-Silent-Rules.html#Automake-Silent-Rules
echo "[$logname] installing. Log file: $logfile"
# Use verbose mode for output to logfiles.
export V=1
( exec>> $logfile 2>&1 ; eval "$cmd" )
status=$?
if [[ $status != 0 ]]; then
echo " [$logname] error installing, exit status $status. Log file: $logfile"
else
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 )

pipestatus=(${PIPESTATUS[*]})
pipestatus=(${PIPESTATUS[*]})

if [ ${pipestatus[1]} -ne 0 ]; then
exit ${pipestatus[1]}
else
exit ${pipestatus[0]}
if [ ${pipestatus[1]} -ne 0 ]; then
exit ${pipestatus[1]}
else
exit ${pipestatus[0]}
fi
fi
72 changes: 72 additions & 0 deletions build/bin/sage-pip-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/usr/bin/env bash
# This command is specifically for pip-installing from a local
# source directory, as opposed to from a package index via package
# name. That is, it is for pip-installing Sage spkgs from their
# extracted upstream sources.
#
# This ensures that any previous installations of the same package
# are uninstalled first.

# Default arguments for all packages installed with `pip install`
# --ignore-installed : Force pip to re-install package even if it thinks it's
# already installed (for which it sometimes gets false
# positives for partially-installed packages).
# --verbose : Display the output when running setup.py.
# --no-deps : Don't install runtime dependencies from PyPI.
# --no-index : Don't look at the package index.
# This also disables pip's version self-check.
pip_install_flags="--ignore-installed --verbose --no-deps --no-index"

# Consume any additional pip install arguments except the last one
while [ $# -gt 1 ]; do
pip_install_flags="$pip_install_flags $1"
shift
done

# Last argument must be "." and will be ignored
if [ "$1" != "." ]; then
echo >&2 "$0 requires . as final argument"
exit 1
fi

# Find out the name of the package that we are installing
name="$(python setup.py --name)"

if [ $? -ne 0 ]; then
echo >&2 "Error: could not determine package name"
exit 1
fi

if [ $(echo "$name" | wc -l) -gt 1 ]; then
name="$(echo "$name" | tail -1)"
echo >&2 "Warning: This package has a badly-behaved setup.py which outputs"
echo >&2 "more than the package name for 'setup.py --name'; using the last"
echo >&2 "line as the package name: $name"
fi

# We should avoid running pip while uninstalling a package because that
# is prone to race conditions. Therefore, we use a lockfile while
# running pip. This is implemented in the Python script pip-lock.

# Keep uninstalling as long as it succeeds
while true; do
out=$(pip-lock uninstall --disable-pip-version-check -y "$name" 2>&1)
if [ $? -ne 0 ]; then
break
fi
echo "$out"
done

# Not ideal, but this is the easiest way to check if the package
# was not installed to begin with (which pip treats as an error).
# If it wasn't, then we proceed quietly; if it was installed show the
# uninstallation output and error out.
if [[ "$out" != *"not installed" ]]; then
echo >&2 "$out"
exit 1
fi

# Finally actually do the installation (the "SHARED" tells pip-lock
# to apply a shared lock)
echo "Installing package $name using pip"
exec pip-lock SHARED install $pip_install_flags .
Loading

0 comments on commit 714276c

Please sign in to comment.