uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,19 @@
diff --git a/src/sage/repl/configuration.py b/src/sage/repl/configuration.py
index 67d7d2accf..18279581e2 100644
--- a/src/sage/repl/configuration.py
+++ b/src/sage/repl/configuration.py
@@ -9,10 +9,11 @@ the IPython simple prompt is being used::
sage: cmd = 'print([sys.stdin.isatty(), sys.stdout.isatty()])'
sage: import pexpect
sage: output = pexpect.run(
- ....: 'bash -c \'echo "{0}" | sage\''.format(cmd),
+ ....: 'bash -c \'export SAGE_BANNER=no; echo "{0}" | sage\''.format(cmd),
....: ).decode('utf-8', 'surrogateescape')
- sage: 'sage: [False, True]' in output
- True
+ sage: print(output)
+ sage...[False, True]
+ ...
"""
#*****************************************************************************

View file

@ -0,0 +1,87 @@
diff --git a/src/sage/env.py b/src/sage/env.py
index c4953cfa65..47b880f9ad 100644
--- a/src/sage/env.py
+++ b/src/sage/env.py
@@ -244,81 +244,8 @@ os.environ['MPMATH_SAGE'] = '1'
SAGE_BANNER = var("SAGE_BANNER", "")
SAGE_IMPORTALL = var("SAGE_IMPORTALL", "yes")
-
-def _get_shared_lib_path(*libnames: str) -> Optional[str]:
- """
- Return the full path to a shared library file installed in
- ``$SAGE_LOCAL/lib`` or the directories associated with the
- Python sysconfig.
-
- This can also be passed more than one library name (e.g. for cases where
- some library may have multiple names depending on the platform) in which
- case the first one found is returned.
-
- This supports most *NIX variants (in which ``lib<libname>.so`` is found
- under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
- extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
- or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
-
- For distributions like Debian that use a multiarch layout, we also try the
- multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
-
- This returns ``None`` if no matching library file could be found.
-
- EXAMPLES::
-
- sage: from sage.env import _get_shared_lib_path
- sage: "gap" in _get_shared_lib_path("gap")
- True
- sage: _get_shared_lib_path("an_absurd_lib") is None
- True
-
- """
-
- for libname in libnames:
- search_directories: List[Path] = []
- patterns: List[str] = []
- if sys.platform == 'cygwin':
- # Later down we take the first matching DLL found, so search
- # SAGE_LOCAL first so that it takes precedence
- if SAGE_LOCAL:
- search_directories.append(Path(SAGE_LOCAL) / 'bin')
- search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
- # Note: The following is not very robust, since if there are multible
- # versions for the same library this just selects one more or less
- # at arbitrary. However, practically speaking, on Cygwin, there
- # will only ever be one version
- patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll']
- else:
- if sys.platform == 'darwin':
- ext = 'dylib'
- else:
- ext = 'so'
-
- if SAGE_LOCAL:
- search_directories.append(Path(SAGE_LOCAL) / 'lib')
- libdir = sysconfig.get_config_var('LIBDIR')
- if libdir is not None:
- libdir = Path(libdir)
- search_directories.append(libdir)
-
- multiarchlib = sysconfig.get_config_var('MULTIARCH')
- if multiarchlib is not None:
- search_directories.append(libdir / multiarchlib),
-
- patterns = [f'lib{libname}.{ext}']
-
- for directory in search_directories:
- for pattern in patterns:
- path = next(directory.glob(pattern), None)
- if path is not None:
- return str(path.resolve())
-
- # Just return None if no files were found
- return None
-
# locate libgap shared object
-GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", ""))
+GAP_SO = var("GAP_SO", '/default')
# post process
if DOT_SAGE is not None and ' ' in DOT_SAGE:

View file

@ -0,0 +1,13 @@
diff --git a/src/sage/misc/sagedoc.py b/src/sage/misc/sagedoc.py
index 08c4225b87..3a9bbe4ed0 100644
--- a/src/sage/misc/sagedoc.py
+++ b/src/sage/misc/sagedoc.py
@@ -1402,6 +1402,8 @@ class _sage_doc:
sage: identity_matrix.__doc__ in browse_sage_doc(identity_matrix, 'rst')
True
sage: browse_sage_doc(identity_matrix, 'html', False) # optional - sphinx sagemath_doc_html
+ ...
+ FutureWarning: The configuration setting "embed_images" will be removed in Docutils 1.2. Use "image_loading: link".
'...div...File:...Type:...Definition:...identity_matrix...'
In the 'text' version, double colons have been replaced with

View file

@ -0,0 +1,19 @@
diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
index 02e18e67e7..2ebf6eb35f 100644
--- a/src/sage/doctest/forker.py
+++ b/src/sage/doctest/forker.py
@@ -1075,6 +1075,14 @@ class SageDocTestRunner(doctest.DocTestRunner, object):
sage: set(ex2.predecessors) == set([ex0,ex1])
True
"""
+
+ # Fix ECL dir race conditions by using a separate dir for each process
+ # (https://trac.sagemath.org/ticket/26968)
+ os.environ['MAXIMA_USERDIR'] = "{}/sage-maxima-{}".format(
+ tempfile.gettempdir(),
+ os.getpid()
+ )
+
if isinstance(globs, RecordingDict):
globs.start()
example.sequence_number = len(self.history)

View file

@ -0,0 +1,58 @@
diff --git a/src/sage/libs/linbox/conversion.pxd b/src/sage/libs/linbox/conversion.pxd
index 7794c9edc3..1753277b1f 100644
--- a/src/sage/libs/linbox/conversion.pxd
+++ b/src/sage/libs/linbox/conversion.pxd
@@ -177,9 +177,8 @@ cdef inline Vector_integer_dense new_sage_vector_integer_dense(P, DenseVector_in
- v -- linbox vector
"""
cdef Vector_integer_dense res = P()
- cdef cppvector[Integer] * vec = &v.refRep()
cdef size_t i
for i in range(<size_t> res._degree):
- mpz_set(res._entries[i], vec[0][i].get_mpz_const())
+ mpz_set(res._entries[i], v.getEntry(i).get_mpz_const())
return res
diff --git a/src/sage/libs/linbox/linbox.pxd b/src/sage/libs/linbox/linbox.pxd
index 9112d151f8..dcc482960c 100644
--- a/src/sage/libs/linbox/linbox.pxd
+++ b/src/sage/libs/linbox/linbox.pxd
@@ -32,7 +32,7 @@ cdef extern from "linbox/matrix/dense-matrix.h":
ctypedef Modular_double Field
ctypedef double Element
DenseMatrix_Modular_double(Field F, size_t m, size_t n)
- DenseMatrix_Modular_double(Field F, Element*, size_t m, size_t n)
+ DenseMatrix_Modular_double(Field F, size_t m, size_t n, Element*)
void setEntry(size_t i, size_t j, Element& a)
Element &getEntry(size_t i, size_t j)
@@ -42,7 +42,7 @@ cdef extern from "linbox/matrix/dense-matrix.h":
ctypedef Modular_float Field
ctypedef float Element
DenseMatrix_Modular_float(Field F, size_t m, size_t n)
- DenseMatrix_Modular_float(Field F, Element*, size_t m, size_t n)
+ DenseMatrix_Modular_float(Field F, size_t m, size_t n, Element*)
void setEntry(size_t i, size_t j, Element& a)
Element &getEntry(size_t i, size_t j)
@@ -101,7 +101,6 @@ cdef extern from "linbox/vector/vector.h":
DenseVector_integer (Field &F)
DenseVector_integer (Field &F, long& m)
DenseVector_integer (Field &F, cppvector[Integer]&)
- cppvector[Element]& refRep()
size_t size()
void resize(size_t)
void resize(size_t n, const Element&)
diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi
index 010365d76f..3d60726ff9 100644
--- a/src/sage/matrix/matrix_modn_dense_template.pxi
+++ b/src/sage/matrix/matrix_modn_dense_template.pxi
@@ -219,7 +219,7 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_
return 0,[]
cdef ModField *F = new ModField(<long>modulus)
- cdef DenseMatrix *A = new DenseMatrix(F[0], <ModField.Element*>entries,<Py_ssize_t>nrows, <Py_ssize_t>ncols)
+ cdef DenseMatrix *A = new DenseMatrix(F[0], <Py_ssize_t>nrows, <Py_ssize_t>ncols, <ModField.Element*>entries)
cdef Py_ssize_t r = reducedRowEchelonize(A[0])
cdef Py_ssize_t i,j
for i in range(nrows):

View file

@ -0,0 +1,61 @@
diff --git a/src/sage_docbuild/__init__.py b/src/sage_docbuild/__init__.py
index b12d56a3c9..df9d949ed1 100644
--- a/src/sage_docbuild/__init__.py
+++ b/src/sage_docbuild/__init__.py
@@ -88,30 +88,6 @@ def builder_helper(type):
"""
Return a function which builds the documentation for
output type ``type``.
-
- TESTS:
-
- Check that :trac:`25161` has been resolved::
-
- sage: from sage_docbuild import DocBuilder, setup_parser
- sage: DocBuilder._options = setup_parser().parse_args([]) # builder_helper needs _options to be set
-
- sage: import sage_docbuild.sphinxbuild
- sage: def raiseBaseException():
- ....: raise BaseException("abort pool operation")
- sage: original_runsphinx, sage_docbuild.sphinxbuild.runsphinx = sage_docbuild.sphinxbuild.runsphinx, raiseBaseException
-
- sage: from sage.misc.temporary_file import tmp_dir
- sage: os.environ['SAGE_DOC'] = tmp_dir()
- sage: sage.env.var('SAGE_DOC') # random
- sage: from sage_docbuild import builder_helper, build_ref_doc
- sage: from sage_docbuild import _build_many as build_many
- sage: helper = builder_helper("html")
- sage: try: # optional - sagemath_doc_html
- ....: build_many(build_ref_doc, [("docname", "en", "html", {})])
- ....: except Exception as E:
- ....: "Non-exception during docbuild: abort pool operation" in str(E)
- True
"""
def f(self, *args, **kwds):
output_dir = self._output_dir(type)
@@ -139,10 +115,9 @@ def builder_helper(type):
logger.debug(build_command)
# Run Sphinx with Sage's special logger
- sys.argv = ["sphinx-build"] + build_command.split()
- from .sphinxbuild import runsphinx
+ args = "python3 -um sage_docbuild.sphinxbuild -N".split() + build_command.split()
try:
- runsphinx()
+ subprocess.check_call(args)
except Exception:
if ABORT_ON_ERROR:
raise
diff --git a/src/sage_docbuild/sphinxbuild.py b/src/sage_docbuild/sphinxbuild.py
index a39c99ffe9..73be823684 100644
--- a/src/sage_docbuild/sphinxbuild.py
+++ b/src/sage_docbuild/sphinxbuild.py
@@ -330,3 +330,8 @@ def runsphinx():
sys.stderr = saved_stderr
sys.stdout.flush()
sys.stderr.flush()
+
+if __name__ == '__main__':
+ import sys
+ sys.argv[0] = "sphinx-build"
+ runsphinx()

View file

@ -0,0 +1,21 @@
diff --git a/src/sage/lfunctions/sympow.py b/src/sage/lfunctions/sympow.py
index 92cb01fd73..b123e6accc 100644
--- a/src/sage/lfunctions/sympow.py
+++ b/src/sage/lfunctions/sympow.py
@@ -50,6 +50,7 @@ from __future__ import print_function, absolute_import
import os
+from sage.env import DOT_SAGE
from sage.structure.sage_object import SageObject
from sage.misc.all import pager
from sage.misc.verbose import verbose
@@ -78,7 +79,7 @@ class Sympow(SageObject):
"""
Used to call sympow with given args
"""
- cmd = 'sympow %s' % args
+ cmd = 'env SYMPOW_CACHEDIR="%s/sympow///" sympow %s' % (DOT_SAGE, args)
with os.popen(cmd) as f:
v = f.read().strip()
verbose(v, level=2)

View file

@ -0,0 +1,81 @@
diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py
index 3f1dcdb538..b6fa8d1fbd 100644
--- a/src/sage/interfaces/tachyon.py
+++ b/src/sage/interfaces/tachyon.py
@@ -261,13 +261,13 @@ written in the sequence they are listed in the examples in this section.
The {\bf PROJECTION} keyword must be followed by one of the supported
camera projection mode identifiers {\bf PERSPECTIVE}, {\bf PERSPECTIVE_DOF},
{\bf ORTHOGRAPHIC}, or {\bf FISHEYE}. The {\bf FISHEYE} projection mode
-requires two extra parameters {\bf FOCALLENGTH} and {\bf APERTURE}
+requires two extra parameters {\bf FOCALDIST} and {\bf APERTURE}
which precede the regular camera options.
\begin{verbatim}
Camera
projection perspective_dof
- focallength 0.75
+ focaldist 0.75
aperture 0.02
Zoom 0.666667
Aspectratio 1.000000
diff --git a/src/sage/plot/plot3d/tachyon.py b/src/sage/plot/plot3d/tachyon.py
index 08caf38d67..3e827411ce 100644
--- a/src/sage/plot/plot3d/tachyon.py
+++ b/src/sage/plot/plot3d/tachyon.py
@@ -92,7 +92,7 @@ angle, right angle)::
Finally there is the ``projection='perspective_dof'`` option. ::
sage: T = Tachyon(xres=800, antialiasing=4, raydepth=10,
- ....: projection='perspective_dof', focallength='1.0', aperture='.0025')
+ ....: projection='perspective_dof', focaldist='1.0', aperture='.0025')
sage: T.light((0,5,7), 1.0, (1,1,1))
sage: T.texture('t1', opacity=1, specular=.3)
sage: T.texture('t2', opacity=1, specular=.3, color=(0,0,1))
@@ -186,7 +186,7 @@ class Tachyon(WithEqualityById, SageObject):
or ``'fisheye'``.
- ``frustum`` - (default ''), otherwise list of four numbers. Only
used with projection='fisheye'.
- - ``focallength`` - (default ''), otherwise a number. Only used
+ - ``focaldist`` - (default ''), otherwise a number. Only used
with projection='perspective_dof'.
- ``aperture`` - (default ''), otherwise a number. Only used
with projection='perspective_dof'.
@@ -331,7 +331,7 @@ class Tachyon(WithEqualityById, SageObject):
Use of the ``projection='perspective_dof'`` option. This may not be
implemented correctly. ::
- sage: T = Tachyon(xres=800,antialiasing=4, raydepth=10, projection='perspective_dof', focallength='1.0', aperture='.0025')
+ sage: T = Tachyon(xres=800,antialiasing=4, raydepth=10, projection='perspective_dof', focaldist='1.0', aperture='.0025')
sage: T.light((0,5,7), 1.0, (1,1,1))
sage: T.texture('t1', opacity=1, specular=.3)
sage: T.texture('t2', opacity=1, specular=.3, color=(0,0,1))
@@ -365,7 +365,7 @@ class Tachyon(WithEqualityById, SageObject):
look_at=[0, 0, 0],
viewdir=None,
projection='PERSPECTIVE',
- focallength='',
+ focaldist='',
aperture='',
frustum=''):
r"""
@@ -391,7 +391,7 @@ class Tachyon(WithEqualityById, SageObject):
self._camera_position = (-3, 0, 0) # default value
self._updir = updir
self._projection = projection
- self._focallength = focallength
+ self._focaldist = focaldist
self._aperture = aperture
self._frustum = frustum
self._objects = []
@@ -624,9 +624,9 @@ class Tachyon(WithEqualityById, SageObject):
camera_out = r"""
camera
projection %s""" % (tostr(self._projection))
- if self._focallength != '':
+ if self._focaldist != '':
camera_out = camera_out + r"""
- focallength %s""" % (float(self._focallength))
+ focaldist %s""" % (float(self._focaldist))
if self._aperture != '':
camera_out = camera_out + r"""
aperture %s""" % (float(self._aperture))