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

Commit

Permalink
Merge branch 'develop' into t/10034/10034-1
Browse files Browse the repository at this point in the history
  • Loading branch information
rwst committed Jun 25, 2016
2 parents d414b5d + 671c3d1 commit 7b90350
Show file tree
Hide file tree
Showing 244 changed files with 7,891 additions and 2,741 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SageMath version 7.3.beta4, Release Date: 2016-06-12
SageMath version 7.3.beta5, Release Date: 2016-06-24
4 changes: 2 additions & 2 deletions build/bin/sage-download-file
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ except ImportError:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import sage_bootstrap

from sage_bootstrap.cmdline import SageDownloadFileApplication
SageDownloadFileApplication().run()
from sage_bootstrap.download.cmdline import run_safe
run_safe()
4 changes: 2 additions & 2 deletions build/bin/sage-package
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ except ImportError:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import sage_bootstrap

from sage_bootstrap.cmdline import SagePkgApplication
SagePkgApplication().run()
from sage_bootstrap.cmdline import run
run()
28 changes: 16 additions & 12 deletions build/bin/sage-spkg
Original file line number Diff line number Diff line change
Expand Up @@ -520,32 +520,36 @@ fi
##################################################################

if [ "$USE_LOCAL_SCRIPTS" = yes ]; then
# New-style package
echo "Setting up build directory for $PKG_NAME"
cp -Rp "$PKG_SCRIPTS" "$PKG_NAME"
cd "$PKG_NAME" || exit $?

sage-uncompress-spkg -d src "$PKG_SRC"
if [ $? -ne 0 ]; then
echo >&2 "Error: failed to extract $PKG_SRC"
exit 1
fi
else
# Old-style package (deprecated)
echo "Extracting package $PKG_SRC"
ls -l "$PKG_SRC"
fi

sage-uncompress-spkg -d src "$PKG_SRC"
if [ $? -ne 0 ]; then
echo >&2 "Error: failed to extract $PKG_SRC"
exit 1
fi

if [ "$USE_LOCAL_SCRIPTS" = yes ]; then
echo "Finished set up"
else
echo "Finished extraction"
sage-uncompress-spkg "$PKG_SRC"
if [ $? -ne 0 ]; then
echo >&2 "Error: failed to extract $PKG_SRC"
exit 1
fi

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

echo "Finished extraction"

##################################################################
# The package has been extracted, prepare for installation
##################################################################
Expand Down
9 changes: 4 additions & 5 deletions build/bin/sage-uncompress-spkg
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,11 @@ class SageTarFile(tarfile.TarFile):
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 self.getmember(m)
for m in members]

else name_to_member[m]
for m in members]
return super(SageTarFile, self).extractall(path=path, members=members)

def extractbytes(self, member):
Expand Down Expand Up @@ -195,7 +194,7 @@ def main(argv=None):
args = parser.parse_args(argv)

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

for cls in ARCHIVE_TYPES:
if cls.can_read(filename):
Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=81654f7fa4e739cfc152390e84f49b6c06a13208
md5=a2f51bacac19ffe7a36dc64e68087674
cksum=3868511547
sha1=387750b93152bd04031fc79fefbedf67a81d2570
md5=168ddf3b69c6a1d16126b247dbb266a4
cksum=1400068458
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
169
170
6 changes: 3 additions & 3 deletions build/pkgs/pari/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=pari-VERSION.tar.gz
sha1=0f8221f5052610c1e6826852ab29ecb1e1cddeec
md5=03b83e4af898f456cae16c9ade1e1cb5
cksum=3725243671
sha1=a936e0ed661c8e453578f3c129c3a454e2039e3e
md5=59f2e4c3c51f7652182400489cd76e6a
cksum=1366291737
2 changes: 1 addition & 1 deletion build/pkgs/pari/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8-2341-g61b65cc.p1
2.8-2771-gb70b447.p0
2 changes: 0 additions & 2 deletions build/pkgs/pari/patches/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,5 @@ Patches to configuration files:
the flag unconditionally.

C files:
* do_QXQ_eval.patch (Peter Bruin, #20749): avoid unnecessary
computations in do_QXQ_eval, relevant for nf_nfzk (PARI bug 1822).
* stackwarn.patch (Jeroen Demeyer, #19883): do not display warnings
regarding the stack size (unless DEBUGMEM is set).
20 changes: 0 additions & 20 deletions build/pkgs/pari/patches/do_QXQ_eval.patch

This file was deleted.

6 changes: 3 additions & 3 deletions build/pkgs/pynac/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=pynac-VERSION.tar.bz2
sha1=e43d1e78a3558d4bf1f8c1ca71cc95a2c4758868
md5=5435ea1568cad643a490bd8cb8b6c1e2
cksum=3626141660
sha1=58ac340027fe440389e21f8ea9b824876adf1429
md5=f78724485c8438bc931966f0a0fd0061
cksum=3600148331
2 changes: 1 addition & 1 deletion build/pkgs/pynac/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.5
0.6.7
10 changes: 7 additions & 3 deletions build/pkgs/python2/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,15 @@ build()
fi
}


build

PYTHON_VERSION=$("$SAGE_LOCAL/bin/python" -c 'import sys; print("%d.%d" % sys.version_info[:2])')

cd "$SAGE_LOCAL/lib"

# Make symbolic link (after removing old link first)
rm -f python
ln -s python2.7 python
ln -s python${PYTHON_VERSION} python
if [ $? -ne 0 ]; then
echo >&2 "Error creating symbolic link"
exit 1
Expand All @@ -128,7 +129,10 @@ fi
# x.y.z with x >= 10).
if [ "$UNAME" = "Darwin" ] && \
[ `uname -r | cut '-d.' -f1` -gt 9 ]; then
rm -f "$SAGE_LOCAL/lib/python2.7/config/libpython2.7.a"
rm -f "$SAGE_LOCAL/lib/python$PYTHON_VERSION/config/libpython${PYTHON_VERSION}.a"
elif [ "$UNAME" = "CYGWIN" ]; then
# See http://trac.sagemath.org/ticket/20437
ln -sf "python/config/libpython${PYTHON_VERSION}.dll.a" "$SAGE_LOCAL/lib/libpython${PYTHON_VERSION}.dll.a"
fi

# Make sure extension modules were built correctly.
Expand Down
9 changes: 7 additions & 2 deletions build/pkgs/python3/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,19 @@ if [ $? -ne 0 ]; then
exit 1
fi

PYTHON_VERSION=$("$SAGE_LOCAL/bin/python" -c 'import sys; print("%d.%d" % sys.version_info[:2])')

# On OS X with XCode 4, the presence of
# $SAGE_LOCAL/lib/python/config/libpython2.7.a causes problems with
# $SAGE_LOCAL/lib/python/config/libpython3.x.a causes problems with
# GiNaC -- see #11967. It is easiest to test the version of OS X; we
# delete this file if using OS X 10.6 or later (so `uname -r` returns
# x.y.z with x >= 10).
if [ "$UNAME" = "Darwin" ] && \
[ `uname -r | cut '-d.' -f1` -gt 9 ]; then
rm -f "$SAGE_LOCAL"/lib/python*/config/libpython*.a
rm -f "$SAGE_LOCAL/lib/python$PYTHON_VERSION/config/libpython${PYTHON_VERSION}.a"
elif [ "$UNAME" = "CYGWIN" ]; then
# See http://trac.sagemath.org/ticket/20437
ln -sf "python/config/libpython${PYTHON_VERSION}.dll.a" "$SAGE_LOCAL/lib/libpython${PYTHON_VERSION}.dll.a"
fi

# Make sure extension modules were built correctly.
Expand Down
176 changes: 176 additions & 0 deletions build/sage_bootstrap/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
# -*- coding: utf-8 -*-
"""
Controller for the commandline actions
"""


#*****************************************************************************
# Copyright (C) 2016 Volker Braun <vbraun.name@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License 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/
#*****************************************************************************

import os
import sys
import logging
log = logging.getLogger()

from sage_bootstrap.env import SAGE_DISTFILES
from sage_bootstrap.package import Package
from sage_bootstrap.tarball import Tarball
from sage_bootstrap.updater import ChecksumUpdater, PackageUpdater
from sage_bootstrap.creator import PackageCreator



class Application(object):

def config(self):
"""
Print the configuration
$ sage --package config
Configuration:
* log = info
* interactive = True
"""
log.debug('Printing configuration')
from sage_bootstrap.config import Configuration
print(Configuration())

def list(self):
"""
Print a list of all available packages
$ sage --package list | sort
4ti2
arb
atlas
autotools
[...]
zn_poly
"""
log.debug('Listing packages')
for pkg in Package.all():
print(pkg.name)

def name(self, tarball_filename):
"""
Find the package name given a tarball filename
$ sage --package name pari-2.8-1564-gdeac36e.tar.gz
pari
"""
log.debug('Looking up package name for %s', tarball_filename)
tarball = Tarball(os.path.basename(tarball_filename))
print(tarball.package.name)

def tarball(self, package_name):
"""
Find the tarball filename given a package name
$ sage --package tarball pari
pari-2.8-1564-gdeac36e.tar.gz
"""
log.debug('Looking up tarball name for %s', package_name)
package = Package(package_name)
print(package.tarball.filename)

def apropos(self, incorrect_name):
"""
Find up to 5 package names that are close to the given name
$ sage --package apropos python
Did you mean: cython, ipython, python2, python3, patch?
"""
log.debug('Apropos for %s', incorrect_name)
from sage_bootstrap.levenshtein import Levenshtein, DistanceExceeded
levenshtein = Levenshtein(5)
names = []
for pkg in Package.all():
try:
names.append([levenshtein(pkg.name, incorrect_name), pkg.name])
except DistanceExceeded:
pass
if names:
names = sorted(names)[:5]
print('Did you mean: {0}?'.format(', '.join(name[1] for name in names)))
else:
print('There is no package similar to {0}'.format(incorrect_name))
print('You can find further packages at http://files.sagemath.org/spkg/')

def update(self, package_name, new_version, url=None):
"""
Update a package. This modifies the Sage sources.
$ sage --package update pari 2015 --url=http://localhost/pari/tarball.tgz
"""
log.debug('Updating %s to %s', package_name, new_version)
update = PackageUpdater(package_name, new_version)
if url is not None:
log.debug('Downloading %s', url)
update.download_upstream(url)
update.fix_checksum()

def download(self, package_name):
"""
Download a package
$ sage --package download pari
Using cached file /home/vbraun/Code/sage.git/upstream/pari-2.8-2044-g89b0f1e.tar.gz
/home/vbraun/Code/sage.git/upstream/pari-2.8-2044-g89b0f1e.tar.gz
"""
log.debug('Downloading %s', package_name)
package = Package(package_name)
package.tarball.download()
print(package.tarball.upstream_fqn)

def fix_all_checksums(self):
"""
Fix the checksum of a package
$ sage --package fix-checksum
"""
for pkg in Package.all():
if not os.path.exists(pkg.tarball.upstream_fqn):
log.debug('Ignoring {0} because tarball is not cached'.format(pkg.tarball_filename))
continue
if pkg.tarball.checksum_verifies():
log.debug('Checksum of {0} unchanged'.format(pkg.tarball_filename))
continue
update = ChecksumUpdater(pkg.name)
print('Updating checksum of {0}'.format(pkg.tarball_filename))
update.fix_checksum()

def fix_checksum(self, package_name):
"""
Fix the checksum of a package
$ sage --package fix-checksum pari
Updating checksum of pari-2.8-2044-g89b0f1e.tar.gz
"""
log.debug('Correcting the checksum of %s', package_name)
update = ChecksumUpdater(package_name)
pkg = update.package
if pkg.tarball.checksum_verifies():
print('Checksum of {0} unchanged'.format(pkg.tarball_filename))
else:
print('Updating checksum of {0}'.format(pkg.tarball_filename))
update.fix_checksum()

def create(self, package_name, version, tarball, pkg_type):
log.debug('Creating %s: %s, %s, %s', package_name, version, tarball, pkg_type)
creator = PackageCreator(package_name)
if version:
creator.set_version(version)
if pkg_type:
creator.set_type(pkg_type)
if tarball:
creator.set_tarball(tarball)
update = ChecksumUpdater(package_name)
update.fix_checksum()

Loading

0 comments on commit 7b90350

Please sign in to comment.