[sagemath] 01/01: Organise patches

Ximin Luo infinity0 at debian.org
Mon Dec 12 02:52:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository sagemath.

commit 9f8539107bb0ee3e6e416028919e47fec79531b8
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon Dec 12 03:51:42 2016 +0100

    Organise patches
---
 debian/patches/{debian-arb.patch => d0-arb.patch}  |   4 +-
 ...hon-sys-path.patch => d0-cython-sys-path.patch} |   4 +-
 ...-disable-jsmol.patch => d0-disable-jsmol.patch} |   0
 .../{debian-gsl-cblas.patch => d0-gsl-cblas.patch} |   0
 ...bian-libgap-sage.patch => d0-libgap-sage.patch} |   6 +-
 .../{debian-maxima.patch => d0-maxima.patch}       |   4 +-
 .../patches/{debian-nauty.patch => d0-nauty.patch} |  26 ++--
 ...ari-stackwarn.patch => d0-pari-stackwarn.patch} |   2 +-
 .../patches/{debian-pari.patch => d0-pari.patch}   |   0
 ...debian-paths.patch => d0-paths-sharedata.patch} | 135 +--------------------
 debian/patches/d0-paths.patch                      | 128 +++++++++++++++++++
 .../{debian-rubiks.patch => d0-rubiks.patch}       |   0
 .../{debian-singular.patch => d0-singular.patch}   |   2 +-
 .../{debian-fakeroot.patch => d1-fakeroot.patch}   |   1 +
 ...-install-paths.patch => d1-install-paths.patch} |  15 ++-
 .../{debian-exec.patch => d1-sage-cli.patch}       |   2 +-
 .../{debian-sage-env.patch => d1-sage-env.patch}   |   2 +
 ...bian-scripts-dir.patch => d1-scripts-dir.patch} |   8 +-
 ...-test-optional.patch => d1-test-optional.patch} |   0
 ...patch => df-disable-custom-sphinx-logger.patch} |   2 +-
 ...hon_security.patch => df-python_security.patch} |   2 +-
 ...rt-lazy-import-dependent-on-python-patch.patch} |   0
 ...-minor-feature-dependent-on-python-patch.patch} |   0
 ...reset.patch => df-sage-gap-reset-doctest.patch} |   0
 ...tion.patch => df-sagedoc_avoid_exception.patch} |   0
 ...86.patch => df-silence_debian_bug_780186.patch} |   0
 ...nals.patch => df-silence_ecl_opt_signals.patch} |   0
 ...hinx.patch => dt-disable-parallel-sphinx.patch} |   0
 ...st-cases.patch => dt-more-fix-test-cases.patch} |   0
 ...-r-no-readline.patch => dt-r-no-readline.patch} |   0
 ...> dt-version-glpk-4.60-extra-hacky-fixes.patch} |   0
 ...tch => dt-version-singular-4-extra-fixes.patch} |  16 ---
 debian/patches/series                              | 130 +++++++++++---------
 .../{trac_21749.patch => u0-distutils-fixes.patch} |  10 +-
 .../{temp-pip-nowarn.patch => u0-pip-nowarn.patch} |   0
 ...-2.7.11.patch => u0-timeit-python-2.7.11.patch} |   0
 ...hon-0.25.patch => u0-version-cython-0.25.patch} |  26 +---
 ...-glpk-4.60.patch => u0-version-glpk-4.60.patch} |   0
 ....patch => u0-version-pari-2.9-trac-21765.patch} |   7 +-
 ...on-pari-2.9.patch => u0-version-pari-2.9.patch} |  14 +--
 ...ingular-4.patch => u0-version-singular-4.patch} |   1 +
 ...LAY.patch => u1-fix-dont-require-DISPLAY.patch} |   0
 ...emwide.patch => u1-fix-libgap-systemwide.patch} |   0
 ...ge-preexec-fn.patch => u1-fix-preexec-fn.patch} |   0
 ...y-rtol.patch => u1-fix-proper-scipy-rtol.patch} |   0
 ...s.patch => u1-fix-use-lexists-not-exists.patch} |   0
 ...lib-094h.patch => u1-version-cddlib-094h.patch} |   0
 ...{version-ecm-7.patch => u1-version-ecm-7.patch} |   0
 ...tch => u1-version-pbori-boost1.62-hashes.patch} |   6 +-
 ...narity-3.patch => u1-version-planarity-3.patch} |   0
 ...al.patch => u2-allow-override-sage-local.patch} |   2 +-
 ....patch => u2-fix-less-trivial-test-cases.patch} |   4 +-
 ...cases.patch => u2-fix-trivial-test-cases.patch} |  32 +----
 53 files changed, 279 insertions(+), 312 deletions(-)

diff --git a/debian/patches/debian-arb.patch b/debian/patches/d0-arb.patch
similarity index 98%
rename from debian/patches/debian-arb.patch
rename to debian/patches/d0-arb.patch
index 3f558ec..fa46242 100644
--- a/debian/patches/debian-arb.patch
+++ b/debian/patches/d0-arb.patch
@@ -6,7 +6,7 @@ Forwarded: not-needed
 
 --- a/sage/src/module_list.py
 +++ b/sage/src/module_list.py
-@@ -140,7 +140,7 @@
+@@ -131,7 +131,7 @@
      "ec", "ecm",
  ] + linbox_libs  + gsl_libs + [
      "pari", "flint", "ratpoints", "ecl", "glpk", "ppl",
@@ -15,7 +15,7 @@ Forwarded: not-needed
      "brial",
      "brial_groebner",
      "m4rie",
-@@ -866,7 +866,7 @@
+@@ -856,7 +856,7 @@
  
      Extension("sage.matrix.matrix_complex_ball_dense",
                ["sage/matrix/matrix_complex_ball_dense.pyx"],
diff --git a/debian/patches/debian-cython-sys-path.patch b/debian/patches/d0-cython-sys-path.patch
similarity index 95%
rename from debian/patches/debian-cython-sys-path.patch
rename to debian/patches/d0-cython-sys-path.patch
index adbf1d9..9848a57 100644
--- a/debian/patches/debian-cython-sys-path.patch
+++ b/debian/patches/d0-cython-sys-path.patch
@@ -5,7 +5,7 @@ Origin: https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/s
 
 --- a/sage/src/setup.py
 +++ b/sage/src/setup.py
-@@ -604,6 +604,7 @@
+@@ -598,6 +598,7 @@
          build_dir=SAGE_CYTHONIZED,
          force=force,
          aliases=aliases,
@@ -15,7 +15,7 @@ Origin: https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/s
              'cdivision': True,
 --- a/sage/src/sage/misc/cython.py
 +++ b/sage/src/sage/misc/cython.py
-@@ -242,6 +242,7 @@
+@@ -245,6 +245,7 @@
  
      # Add cysignals directory to includes
      for path in sys.path:
diff --git a/debian/patches/debian-disable-jsmol.patch b/debian/patches/d0-disable-jsmol.patch
similarity index 100%
rename from debian/patches/debian-disable-jsmol.patch
rename to debian/patches/d0-disable-jsmol.patch
diff --git a/debian/patches/debian-gsl-cblas.patch b/debian/patches/d0-gsl-cblas.patch
similarity index 100%
rename from debian/patches/debian-gsl-cblas.patch
rename to debian/patches/d0-gsl-cblas.patch
diff --git a/debian/patches/debian-libgap-sage.patch b/debian/patches/d0-libgap-sage.patch
similarity index 98%
rename from debian/patches/debian-libgap-sage.patch
rename to debian/patches/d0-libgap-sage.patch
index 730d3bc..be7934c 100644
--- a/debian/patches/debian-libgap-sage.patch
+++ b/debian/patches/d0-libgap-sage.patch
@@ -34,7 +34,7 @@ Forwarded: not-needed
  	rm main.o main *~
 --- a/sage/src/module_list.py
 +++ b/sage/src/module_list.py
-@@ -46,6 +46,10 @@
+@@ -45,6 +45,10 @@
  gsl_library_dirs = list(gsl_pc['library_dirs'])
  gsl_include_dirs = list(gsl_pc['include_dirs'])
  
@@ -45,7 +45,7 @@ Forwarded: not-needed
  # GD image library
  gd_pc = pkgconfig.parse('gdlib')
  gd_libs = list(gd_pc['libraries'])
-@@ -142,8 +146,8 @@
+@@ -135,8 +139,8 @@
      "brial_groebner",
      "m4rie",
  ] + m4ri_libs + [
@@ -56,7 +56,7 @@ Forwarded: not-needed
      "m", "readline", "Lfunction" ,
  ] + cblas_libs + [
      "cryptominisat",
-@@ -710,15 +714,15 @@
+@@ -702,15 +706,15 @@
  
      Extension('sage.libs.gap.util',
                sources = ["sage/libs/gap/util.pyx"],
diff --git a/debian/patches/debian-maxima.patch b/debian/patches/d0-maxima.patch
similarity index 98%
rename from debian/patches/debian-maxima.patch
rename to debian/patches/d0-maxima.patch
index 47b3caa..97b93e1 100644
--- a/debian/patches/debian-maxima.patch
+++ b/debian/patches/d0-maxima.patch
@@ -73,7 +73,7 @@ Author: Tobias Hansen <thansen at debian.org>
 +    os.system('maxima-sage')
 --- a/sage/src/sage/interfaces/expect.py
 +++ b/sage/src/sage/interfaces/expect.py
-@@ -563,7 +563,7 @@
+@@ -565,7 +565,7 @@
  
              sage: a = maxima('y')
              sage: maxima.quit(verbose=True)
@@ -84,7 +84,7 @@ Author: Tobias Hansen <thansen at debian.org>
              ...
 --- a/sage/src/bin/sage
 +++ b/sage/src/bin/sage
-@@ -328,7 +328,7 @@
+@@ -512,7 +512,7 @@
  
  if [ "$1" = '-maxima' -o "$1" = '--maxima' ]; then
      shift
diff --git a/debian/patches/debian-nauty.patch b/debian/patches/d0-nauty.patch
similarity index 87%
rename from debian/patches/debian-nauty.patch
rename to debian/patches/d0-nauty.patch
index aaa2cbb..374263f 100644
--- a/debian/patches/debian-nauty.patch
+++ b/debian/patches/d0-nauty.patch
@@ -1,3 +1,18 @@
+--- a/sage/src/sage/graphs/graph_generators.py
++++ b/sage/src/sage/graphs/graph_generators.py
+@@ -869,10 +869,10 @@
+ 
+             sage: gen = graphs.nauty_geng("4", debug=True)
+             sage: print(next(gen))
+-            >A geng -d0D3 n=4 e=0-6
++            >A nauty-geng -d0D3 n=4 e=0-6
+         """
+         import subprocess
+-        sp = subprocess.Popen("geng {0}".format(options), shell=True,
++        sp = subprocess.Popen("nauty-geng {0}".format(options), shell=True,
+                               stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+                               stderr=subprocess.PIPE, close_fds=True)
+         if debug:
 --- a/sage/src/sage/graphs/digraph_generators.py
 +++ b/sage/src/sage/graphs/digraph_generators.py
 @@ -484,7 +484,7 @@
@@ -9,17 +24,6 @@
                                stdin=subprocess.PIPE, stdout=subprocess.PIPE,
                                stderr=subprocess.PIPE, close_fds=True)
  
---- a/sage/src/sage/graphs/graph_generators.py
-+++ b/sage/src/sage/graphs/graph_generators.py
-@@ -872,7 +872,7 @@
-             >A geng -d0D3 n=4 e=0-6
-         """
-         import subprocess
--        sp = subprocess.Popen("geng {0}".format(options), shell=True,
-+        sp = subprocess.Popen("nauty-geng {0}".format(options), shell=True,
-                               stdin=subprocess.PIPE, stdout=subprocess.PIPE,
-                               stderr=subprocess.PIPE, close_fds=True)
-         if debug:
 --- a/sage/src/sage/graphs/hypergraph_generators.py
 +++ b/sage/src/sage/graphs/hypergraph_generators.py
 @@ -137,7 +137,7 @@
diff --git a/debian/patches/debian-pari-stackwarn.patch b/debian/patches/d0-pari-stackwarn.patch
similarity index 99%
rename from debian/patches/debian-pari-stackwarn.patch
rename to debian/patches/d0-pari-stackwarn.patch
index 2f82981..1d7a237 100644
--- a/debian/patches/debian-pari-stackwarn.patch
+++ b/debian/patches/d0-pari-stackwarn.patch
@@ -119,7 +119,7 @@ Author: Tobias Hansen <thansen at debian.org>
          Graphics object consisting of 1 graphics primitive
 --- a/sage/src/sage/rings/integer.pyx
 +++ b/sage/src/sage/rings/integer.pyx
-@@ -6511,6 +6511,7 @@
+@@ -6520,6 +6520,7 @@
              ....:         (2^100).binomial(2^22, algorithm='pari')
              ....:     except AlarmInterrupt:
              ....:         pass
diff --git a/debian/patches/debian-pari.patch b/debian/patches/d0-pari.patch
similarity index 100%
rename from debian/patches/debian-pari.patch
rename to debian/patches/d0-pari.patch
diff --git a/debian/patches/debian-paths.patch b/debian/patches/d0-paths-sharedata.patch
similarity index 57%
rename from debian/patches/debian-paths.patch
rename to debian/patches/d0-paths-sharedata.patch
index 335e791..1732ff5 100644
--- a/debian/patches/debian-paths.patch
+++ b/debian/patches/d0-paths-sharedata.patch
@@ -1,123 +1,9 @@
-Description: Hard-code paths to external system run-time dependencies
- TODO: some of this could be made generic and forwarded upstream. For example,
- add another SAGE_SHARE_DATA directory, which for upstream would be the same
- as SAGE_SHARE and for us would be /usr/share/sagemeth.
-Author: Tobias Hansen <thansen at debian.org>
+Description: Hard-code paths to system shared data
+ This could be made generic and forwarded upstream. For example, add another
+ SAGE_SHARE_DATA directory, which for upstream would be the same as SAGE_SHARE
+ and for us would be /usr/share/sagemeth.
 Author: Ximin Luo <infinity0 at debian.org>
-Forwarded: not-needed
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/sage/src/sage/ext/pselect.pyx
-+++ b/sage/src/sage/ext/pselect.pyx
-@@ -290,7 +290,7 @@
-         writing, but not reading (since nothing has been written)::
- 
-             sage: f = open(os.devnull, "r")
--            sage: g = open(os.path.join(SAGE_LOCAL, 'bin', 'python'), "r")
-+            sage: g = open('/usr/bin/python2.7', "r")
-             sage: (pr, pw) = os.pipe()
-             sage: r, w, x, t = PSelecter().pselect([f,g,pr,pw], [pw], [pr,pw])
-             sage: len(r), len(w), len(x), t
---- a/sage/src/sage/interfaces/gap.py
-+++ b/sage/src/sage/interfaces/gap.py
-@@ -194,7 +194,7 @@
- 
- WORKSPACE = os.path.join(GAP_DIR, 'workspace-%s'%abs(hash(SAGE_LOCAL)))
- 
--GAP_BINARY = os.path.join(SAGE_LOCAL, 'bin', 'gap')
-+GAP_BINARY = '/usr/bin/gap'
- 
- first_try = True
- 
---- a/sage/src/sage/libs/gap/util.pyx
-+++ b/sage/src/sage/libs/gap/util.pyx
-@@ -157,7 +157,7 @@
-         '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
-     """
-     import os.path
--    gapdir = os.path.join(SAGE_LOCAL, 'gap', 'latest')
-+    gapdir = '/usr/share/gap'
-     if os.path.exists(gapdir):
-         return gapdir
-     print('The gap-4.5.5.spkg (or later) seems to be not installed!')
---- a/sage/src/sage/misc/cython.py
-+++ b/sage/src/sage/misc/cython.py
-@@ -413,7 +413,7 @@
-     file_list = []
-     for fname in additional_source_files:
-         fname = fname.replace("$SAGE_SRC", SAGE_SRC)
--        fname = fname.replace("$SAGE_LOCAL", SAGE_LOCAL)
-+        fname = fname.replace("$SAGE_LOCAL", '/usr/include')
-         if fname.startswith(os.path.sep):
-             file_list.append("'"+fname+"'")
-         else:
---- a/sage/src/sage/tests/cmdline.py
-+++ b/sage/src/sage/tests/cmdline.py
-@@ -561,12 +561,6 @@
-         sage: ret
-         0
- 
--    Check that ``sage-location`` did its job in making Python scripts
--    relative.  We test it on the ``ipython`` script::
--
--        sage: open(os.path.join(SAGE_LOCAL, "bin", "ipython")).readline()
--        '#!/usr/bin/env python\n'
--
-     Test GP using the ``-f`` option which prevents the reading of a ``.gprc``
-     configuration file::
- 
---- a/sage/src/sage/interfaces/qepcad.py
-+++ b/sage/src/sage/interfaces/qepcad.py
-@@ -528,11 +528,6 @@
- 
- TESTS:
- 
--Check the qepcad configuration file::
--
--    sage: open('%s/default.qepcadrc'%SAGE_LOCAL).readlines()[-1]
--    'SINGULAR .../bin\n'
--
- Tests related to the not tested examples (nondeterministic order of atoms)::
- 
-     sage: from sage.interfaces.qepcad import _qepcad_atoms
---- a/sage/src/sage/libs/lcalc/lcalc_sage.h
-+++ b/sage/src/sage/libs/lcalc/lcalc_sage.h
-@@ -1,4 +1,4 @@
--#include "libLfunction/L.h"
-+#include "Lfunction/L.h"
- 
- int *new_ints(int l)
- {
---- a/sage/src/sage/all.py
-+++ b/sage/src/sage/all.py
-@@ -15,27 +15,6 @@
-     sage: from sage import *
-     sage: frames = [x for x in gc.get_objects() if inspect.isframe(x)]
- 
--We exclude the known files and check to see that there are no others::
--
--    sage: import os
--    sage: allowed = [os.path.join("lib","python","threading.py")]
--    sage: allowed.append(os.path.join("lib","python","multiprocessing"))
--    sage: allowed.append(os.path.join("sage","doctest"))
--    sage: allowed.append(os.path.join("bin","sage-runtests"))
--    sage: allowed.append(os.path.join("site-packages","IPython"))
--    sage: allowed.append(os.path.join("bin","sage-ipython"))
--    sage: allowed.append("<ipython console>")
--    sage: allowed.append("<doctest sage.all[3]>")
--    sage: allowed.append(os.path.join("sage","combinat","species","generating_series.py"))
--    sage: for i in frames:
--    ....:     filename, lineno, funcname, linelist, indx = inspect.getframeinfo(i)
--    ....:     for nm in allowed:
--    ....:         if nm in filename:
--    ....:             break
--    ....:     else:
--    ....:         print(filename)
--    ....:
--
- Check that the Sage Notebook is not imported at startup (see
- :trac:`15335`)::
- 
+Forwarded: TODO
 --- a/sage/src/sage/combinat/designs/latin_squares.py
 +++ b/sage/src/sage/combinat/designs/latin_squares.py
 @@ -544,8 +544,7 @@
@@ -279,14 +165,3 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
  
  def degseq_to_data(degree_sequence):
      """
---- a/sage/src/sage/interfaces/jmoldata.py
-+++ b/sage/src/sage/interfaces/jmoldata.py
-@@ -148,7 +148,7 @@
-             True
-         """
-         # Set up paths, file names and scripts
--        jmolpath = os.path.join(SAGE_LOCAL, "share", "jmol", "JmolData.jar")
-+        jmolpath = os.path.join("/usr", "share", "jmol", "JmolData.jar")
-         target_native = targetfile
-         import sys
-         if sys.platform == 'cygwin':
diff --git a/debian/patches/d0-paths.patch b/debian/patches/d0-paths.patch
new file mode 100644
index 0000000..9d33f30
--- /dev/null
+++ b/debian/patches/d0-paths.patch
@@ -0,0 +1,128 @@
+Description: Hard-code paths to external system run-time dependencies
+Author: Tobias Hansen <thansen at debian.org>
+Author: Ximin Luo <infinity0 at debian.org>
+Forwarded: not-needed
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/sage/src/sage/ext/pselect.pyx
++++ b/sage/src/sage/ext/pselect.pyx
+@@ -290,7 +290,7 @@
+         writing, but not reading (since nothing has been written)::
+ 
+             sage: f = open(os.devnull, "r")
+-            sage: g = open(os.path.join(SAGE_LOCAL, 'bin', 'python'), "r")
++            sage: g = open('/usr/bin/python2.7', "r")
+             sage: (pr, pw) = os.pipe()
+             sage: r, w, x, t = PSelecter().pselect([f,g,pr,pw], [pw], [pr,pw])
+             sage: len(r), len(w), len(x), t
+--- a/sage/src/sage/interfaces/gap.py
++++ b/sage/src/sage/interfaces/gap.py
+@@ -194,7 +194,7 @@
+ 
+ WORKSPACE = os.path.join(GAP_DIR, 'workspace-%s'%abs(hash(SAGE_LOCAL)))
+ 
+-GAP_BINARY = os.path.join(SAGE_LOCAL, 'bin', 'gap')
++GAP_BINARY = '/usr/bin/gap'
+ 
+ first_try = True
+ 
+--- a/sage/src/sage/libs/gap/util.pyx
++++ b/sage/src/sage/libs/gap/util.pyx
+@@ -157,7 +157,7 @@
+         '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
+     """
+     import os.path
+-    gapdir = os.path.join(SAGE_LOCAL, 'gap', 'latest')
++    gapdir = '/usr/share/gap'
+     if os.path.exists(gapdir):
+         return gapdir
+     print('The gap-4.5.5.spkg (or later) seems to be not installed!')
+--- a/sage/src/sage/misc/cython.py
++++ b/sage/src/sage/misc/cython.py
+@@ -415,7 +415,7 @@
+     file_list = []
+     for fname in additional_source_files:
+         fname = fname.replace("$SAGE_SRC", SAGE_SRC)
+-        fname = fname.replace("$SAGE_LOCAL", SAGE_LOCAL)
++        fname = fname.replace("$SAGE_LOCAL", '/usr/include')
+         if fname.startswith(os.path.sep):
+             file_list.append("'"+fname+"'")
+         else:
+--- a/sage/src/sage/libs/lcalc/lcalc_sage.h
++++ b/sage/src/sage/libs/lcalc/lcalc_sage.h
+@@ -1,4 +1,4 @@
+-#include "libLfunction/L.h"
++#include "Lfunction/L.h"
+ 
+ int *new_ints(int l)
+ {
+--- a/sage/src/sage/interfaces/qepcad.py
++++ b/sage/src/sage/interfaces/qepcad.py
+@@ -528,11 +528,6 @@
+ 
+ TESTS:
+ 
+-Check the qepcad configuration file::
+-
+-    sage: open('%s/default.qepcadrc'%SAGE_LOCAL).readlines()[-1]
+-    'SINGULAR .../bin\n'
+-
+ Tests related to the not tested examples (nondeterministic order of atoms)::
+ 
+     sage: from sage.interfaces.qepcad import _qepcad_atoms
+--- a/sage/src/sage/tests/cmdline.py
++++ b/sage/src/sage/tests/cmdline.py
+@@ -560,12 +560,6 @@
+         sage: ret
+         0
+ 
+-    Check that ``sage-location`` did its job in making Python scripts
+-    relative.  We test it on the ``ipython`` script::
+-
+-        sage: open(os.path.join(SAGE_LOCAL, "bin", "ipython")).readline()
+-        '#!/usr/bin/env python\n'
+-
+     Test GP using the ``-f`` option which prevents the reading of a ``.gprc``
+     configuration file::
+ 
+--- a/sage/src/sage/all.py
++++ b/sage/src/sage/all.py
+@@ -15,27 +15,6 @@
+     sage: from sage import *
+     sage: frames = [x for x in gc.get_objects() if inspect.isframe(x)]
+ 
+-We exclude the known files and check to see that there are no others::
+-
+-    sage: import os
+-    sage: allowed = [os.path.join("lib","python","threading.py")]
+-    sage: allowed.append(os.path.join("lib","python","multiprocessing"))
+-    sage: allowed.append(os.path.join("sage","doctest"))
+-    sage: allowed.append(os.path.join("bin","sage-runtests"))
+-    sage: allowed.append(os.path.join("site-packages","IPython"))
+-    sage: allowed.append(os.path.join("bin","sage-ipython"))
+-    sage: allowed.append("<ipython console>")
+-    sage: allowed.append("<doctest sage.all[3]>")
+-    sage: allowed.append(os.path.join("sage","combinat","species","generating_series.py"))
+-    sage: for i in frames:
+-    ....:     filename, lineno, funcname, linelist, indx = inspect.getframeinfo(i)
+-    ....:     for nm in allowed:
+-    ....:         if nm in filename:
+-    ....:             break
+-    ....:     else:
+-    ....:         print(filename)
+-    ....:
+-
+ Check that the Sage Notebook is not imported at startup (see
+ :trac:`15335`)::
+ 
+--- a/sage/src/sage/interfaces/jmoldata.py
++++ b/sage/src/sage/interfaces/jmoldata.py
+@@ -148,7 +148,7 @@
+             True
+         """
+         # Set up paths, file names and scripts
+-        jmolpath = os.path.join(SAGE_LOCAL, "share", "jmol", "JmolData.jar")
++        jmolpath = os.path.join("/usr", "share", "jmol", "JmolData.jar")
+         target_native = targetfile
+         import sys
+         if sys.platform == 'cygwin':
diff --git a/debian/patches/debian-rubiks.patch b/debian/patches/d0-rubiks.patch
similarity index 100%
rename from debian/patches/debian-rubiks.patch
rename to debian/patches/d0-rubiks.patch
diff --git a/debian/patches/debian-singular.patch b/debian/patches/d0-singular.patch
similarity index 99%
rename from debian/patches/debian-singular.patch
rename to debian/patches/d0-singular.patch
index 888904a..bc8bc32 100644
--- a/debian/patches/debian-singular.patch
+++ b/debian/patches/d0-singular.patch
@@ -36,7 +36,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
          raise ImportError("cannot locate Singular library ({})".format(lib))
 --- a/sage/src/sage/misc/cython.py
 +++ b/sage/src/sage/misc/cython.py
-@@ -307,10 +307,10 @@
+@@ -309,10 +309,10 @@
      Before :trac:`12975`, it would have been needed to write ``#clang c++``,
      but upper case ``C++`` has resulted in an error::
  
diff --git a/debian/patches/debian-fakeroot.patch b/debian/patches/d1-fakeroot.patch
similarity index 86%
rename from debian/patches/debian-fakeroot.patch
rename to debian/patches/d1-fakeroot.patch
index 3d843ec..e259817 100644
--- a/debian/patches/debian-fakeroot.patch
+++ b/debian/patches/d1-fakeroot.patch
@@ -1,4 +1,5 @@
 Description: We are building with fakeroot which makes this check fail.
+ dpkg-buildpackage uses `fakeroot debian/rules clean` so this is needed
 Author: Tobias Hansen <thansen at debian.org>
 
 --- a/sage/configure.ac
diff --git a/debian/patches/debian-install-paths.patch b/debian/patches/d1-install-paths.patch
similarity index 95%
rename from debian/patches/debian-install-paths.patch
rename to debian/patches/d1-install-paths.patch
index aa0e59d..957be05 100644
--- a/debian/patches/debian-install-paths.patch
+++ b/debian/patches/d1-install-paths.patch
@@ -5,8 +5,6 @@ Description: Install to Debian paths
  .
  The multidocs.py patch looks like a Sage upstream bug, that probably needs to
  be forwarded.
- .
- The LD_LIBRARY_PATH can probably be forwarded upstream, either way is fine.
 Author: Tobias Hansen <thansen at debian.org>
 Author: Ximin Luo <infinity0 at debian.org>
 Forwarded: not-needed
@@ -80,9 +78,20 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
  
  _add_variable_or_fallback('SAGE_CYTHONIZED', opj('$SAGE_ROOT', 'src', 'build', 'cythonized'))
  
+@@ -193,8 +193,8 @@
+         ['.../include',
+         '.../include/python...',
+         '.../python.../numpy/core/include',
+-        '.../python.../site-packages',
+-        '.../python.../site-packages/sage/ext']
++        '.../python.../dist-packages',
++        '.../python.../dist-packages/sage/ext']
+     """
+     import os, numpy
+     import distutils.sysconfig
 --- a/sage/configure.ac
 +++ b/sage/configure.ac
-@@ -1003,8 +1003,7 @@
+@@ -1004,8 +1004,7 @@
                  AC_MSG_ERROR([[Cannot perform incremental update, run "make distclean && make"]])
              fi
          else
diff --git a/debian/patches/debian-exec.patch b/debian/patches/d1-sage-cli.patch
similarity index 99%
rename from debian/patches/debian-exec.patch
rename to debian/patches/d1-sage-cli.patch
index cfbf0cb..3e2dfb1 100644
--- a/debian/patches/debian-exec.patch
+++ b/debian/patches/d1-sage-cli.patch
@@ -309,7 +309,7 @@ Forwarded: not-needed
 -
  if [ "$1" = '-maxima' -o "$1" = '--maxima' ]; then
      shift
-     exec maxima "$@"
+     exec maxima-sage "$@"
 @@ -525,21 +341,6 @@
      exec M2 "$@"
  fi
diff --git a/debian/patches/debian-sage-env.patch b/debian/patches/d1-sage-env.patch
similarity index 95%
rename from debian/patches/debian-sage-env.patch
rename to debian/patches/d1-sage-env.patch
index 225f8f9..4d3294c 100644
--- a/debian/patches/debian-sage-env.patch
+++ b/debian/patches/d1-sage-env.patch
@@ -1,6 +1,8 @@
 Description: Patch sage-env
  Note that this file is only used during the package build and not installed.
  Instead the file debian/adhoc/sage-env is installed.
+ .
+ The LD_LIBRARY_PATH can probably be forwarded upstream, either way is fine.
 Author: Tobias Hansen <thansen at debian.org>, Ximin Luo <infinity0 at debian.org>
 
 --- a/sage/src/bin/sage-env
diff --git a/debian/patches/debian-scripts-dir.patch b/debian/patches/d1-scripts-dir.patch
similarity index 98%
rename from debian/patches/debian-scripts-dir.patch
rename to debian/patches/d1-scripts-dir.patch
index dbdd330..91d98dd 100644
--- a/debian/patches/debian-scripts-dir.patch
+++ b/debian/patches/d1-scripts-dir.patch
@@ -24,14 +24,14 @@ Author: Tobias Hansen <thansen at debian.org>
  
  if [ "$1" = '-dumpversion' -o "$1" = '--dumpversion' ]; then
 -	. "$SAGE_LOCAL"/bin/sage-version.sh
-+	. "$SAGE_SCRIPTS_DIR/sage-version.sh
++	. "$SAGE_SCRIPTS_DIR"/sage-version.sh
  	echo ${SAGE_VERSION}
  	exit 0
  fi
  
  if [ "$1" = '-v' -o "$1" = '-version' -o "$1" = '--version' ]; then
 -	. "$SAGE_LOCAL"/bin/sage-version.sh
-+	. "$SAGE_SCRIPTS_DIR/sage-version.sh
++	. "$SAGE_SCRIPTS_DIR"/sage-version.sh
  	echo "SageMath version ${SAGE_VERSION}, Release Date: ${SAGE_RELEASE_DATE}"
  	exit 0
  fi
@@ -163,7 +163,7 @@ Author: Tobias Hansen <thansen at debian.org>
                       or a DocTestDefaults object (possibly with some entries modified)
          - args -- a list of filenames to doctest
  
-@@ -935,9 +935,9 @@
+@@ -950,9 +950,9 @@
              sage: from sage.doctest.control import DocTestDefaults, DocTestController
              sage: DC = DocTestController(DocTestDefaults(timeout=123), ["hello_world.py"])
              sage: print(DC._assemble_cmd())
@@ -175,7 +175,7 @@ Author: Tobias Hansen <thansen at debian.org>
          opt = dict_difference(self.options.__dict__, DocTestDefaults().__dict__)
          for o in ("all", "sagenb"):
              if o in opt:
-@@ -971,14 +971,14 @@
+@@ -986,14 +986,14 @@
              sage: DD = DocTestDefaults(gdb=True)
              sage: DC = DocTestController(DD, ["hello_world.py"])
              sage: DC.run_val_gdb(testing=True)
diff --git a/debian/patches/debian-test-optional.patch b/debian/patches/d1-test-optional.patch
similarity index 100%
rename from debian/patches/debian-test-optional.patch
rename to debian/patches/d1-test-optional.patch
diff --git a/debian/patches/fixsage-sphinx.patch b/debian/patches/df-disable-custom-sphinx-logger.patch
similarity index 97%
rename from debian/patches/fixsage-sphinx.patch
rename to debian/patches/df-disable-custom-sphinx-logger.patch
index 1f6185e..cd33277 100644
--- a/debian/patches/fixsage-sphinx.patch
+++ b/debian/patches/df-disable-custom-sphinx-logger.patch
@@ -1,6 +1,6 @@
 Description: Disable a convoluted "build log buffering" mechanism which was causing problems.
 Author: Ximin Luo <infinity0 at debian.org>
-Forwarded: TODO
+Forwarded: not-needed
 ---
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- a/sage/src/sage_setup/docbuild/sphinxbuild.py
diff --git a/debian/patches/python_security.patch b/debian/patches/df-python_security.patch
similarity index 99%
rename from debian/patches/python_security.patch
rename to debian/patches/df-python_security.patch
index 46db283..4daefc2 100644
--- a/debian/patches/python_security.patch
+++ b/debian/patches/df-python_security.patch
@@ -1,6 +1,6 @@
 --- a/sage/src/sage/doctest/control.py
 +++ b/sage/src/sage/doctest/control.py
-@@ -558,19 +558,20 @@
+@@ -542,19 +542,20 @@
          ``sage/tests/cmdline.py`` for a doctest that this works, see
          also :trac:`13579`.
  
diff --git a/debian/patches/fixsage-revert-lazy-import-dependent-on-python-patch.patch b/debian/patches/df-revert-lazy-import-dependent-on-python-patch.patch
similarity index 100%
rename from debian/patches/fixsage-revert-lazy-import-dependent-on-python-patch.patch
rename to debian/patches/df-revert-lazy-import-dependent-on-python-patch.patch
diff --git a/debian/patches/fixsage-revert-minor-feature-dependent-on-python-patch.patch b/debian/patches/df-revert-minor-feature-dependent-on-python-patch.patch
similarity index 100%
rename from debian/patches/fixsage-revert-minor-feature-dependent-on-python-patch.patch
rename to debian/patches/df-revert-minor-feature-dependent-on-python-patch.patch
diff --git a/debian/patches/debian-sage-gap-reset.patch b/debian/patches/df-sage-gap-reset-doctest.patch
similarity index 100%
rename from debian/patches/debian-sage-gap-reset.patch
rename to debian/patches/df-sage-gap-reset-doctest.patch
diff --git a/debian/patches/sagedoc_avoid_exception.patch b/debian/patches/df-sagedoc_avoid_exception.patch
similarity index 100%
rename from debian/patches/sagedoc_avoid_exception.patch
rename to debian/patches/df-sagedoc_avoid_exception.patch
diff --git a/debian/patches/silence_debian_bug_780186.patch b/debian/patches/df-silence_debian_bug_780186.patch
similarity index 100%
rename from debian/patches/silence_debian_bug_780186.patch
rename to debian/patches/df-silence_debian_bug_780186.patch
diff --git a/debian/patches/silence_ecl_opt_signals.patch b/debian/patches/df-silence_ecl_opt_signals.patch
similarity index 100%
rename from debian/patches/silence_ecl_opt_signals.patch
rename to debian/patches/df-silence_ecl_opt_signals.patch
diff --git a/debian/patches/temp-disable-parallel-sphinx.patch b/debian/patches/dt-disable-parallel-sphinx.patch
similarity index 100%
rename from debian/patches/temp-disable-parallel-sphinx.patch
rename to debian/patches/dt-disable-parallel-sphinx.patch
diff --git a/debian/patches/temp-fix-test-cases.patch b/debian/patches/dt-more-fix-test-cases.patch
similarity index 100%
rename from debian/patches/temp-fix-test-cases.patch
rename to debian/patches/dt-more-fix-test-cases.patch
diff --git a/debian/patches/debian-temp-r-no-readline.patch b/debian/patches/dt-r-no-readline.patch
similarity index 100%
rename from debian/patches/debian-temp-r-no-readline.patch
rename to debian/patches/dt-r-no-readline.patch
diff --git a/debian/patches/version-temp-glpk-4.60-extra-hacky-fixes.patch b/debian/patches/dt-version-glpk-4.60-extra-hacky-fixes.patch
similarity index 100%
rename from debian/patches/version-temp-glpk-4.60-extra-hacky-fixes.patch
rename to debian/patches/dt-version-glpk-4.60-extra-hacky-fixes.patch
diff --git a/debian/patches/version-temp-singular-4-extra-fixes.patch b/debian/patches/dt-version-singular-4-extra-fixes.patch
similarity index 65%
rename from debian/patches/version-temp-singular-4-extra-fixes.patch
rename to debian/patches/dt-version-singular-4-extra-fixes.patch
index b6486c2..63ec33b 100644
--- a/debian/patches/version-temp-singular-4-extra-fixes.patch
+++ b/debian/patches/dt-version-singular-4-extra-fixes.patch
@@ -8,22 +8,6 @@ Forwarded: TODO, to Sage
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- a/sage/src/bin/sage
 +++ b/sage/src/bin/sage
-@@ -256,13 +256,13 @@
- #####################################################################
- 
- if [ "$1" = '-dumpversion' -o "$1" = '--dumpversion' ]; then
--	. "$SAGE_SCRIPTS_DIR/sage-version.sh
-+	. "$SAGE_SCRIPTS_DIR"/sage-version.sh
- 	echo ${SAGE_VERSION}
- 	exit 0
- fi
- 
- if [ "$1" = '-v' -o "$1" = '-version' -o "$1" = '--version' ]; then
--	. "$SAGE_SCRIPTS_DIR/sage-version.sh
-+	. "$SAGE_SCRIPTS_DIR"/sage-version.sh
- 	echo "SageMath version ${SAGE_VERSION}, Release Date: ${SAGE_RELEASE_DATE}"
- 	exit 0
- fi
 @@ -298,7 +298,7 @@
  
  if [ "$1" = '-singular' -o "$1" = '--singular' ]; then
diff --git a/debian/patches/series b/debian/patches/series
index 658f94c..adfb9ea 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,63 +1,73 @@
-# fixes to Sage's code, an inherent problem on their side
-# we should probably forward these upstream
-python_security.patch
-silence_debian_bug_780186.patch
-silence_ecl_opt_signals.patch
-sagedoc_avoid_exception.patch
-fixsage-sphinx.patch
-fixsage-libgap-systemwide.patch
-fixsage-use-lexists-not-exists.patch
-fixsage-proper-scipy-rtol.patch
-fixsage-revert-lazy-import-dependent-on-python-patch.patch
-fixsage-revert-minor-feature-dependent-on-python-patch.patch
-fixsage-dont-require-DISPLAY.patch
-fixsage-allow-override-sage-local.patch
-fixsage-pbori-boost1.62-hashes.patch
+# Patches already applied upstream or committed in a side branch
+# Or nearly-finished patches that they'll very probably merge.
+u0-version-cython-0.25.patch
+u0-version-glpk-4.60.patch
+u0-version-pari-2.9-trac-21765.patch
+u0-version-pari-2.9.patch
+u0-version-singular-4.patch
+u0-distutils-fixes.patch
+u0-pip-nowarn.patch
+u0-timeit-python-2.7.11.patch
 
-# due to us using a different version of a dependency than what Sage uses
-# we'll probably drop these when importing the next version of Sage
-version-python-2.7.11.patch
-version-ecm-7.patch
-version-singular-4.patch
-version-cddlib-094h.patch
-version-cython-0.25.patch
-version-glpk-4.60.patch
-version-pari-2.9-trac-21765.patch
-version-pari-2.9.patch
-version-planarity-3.patch
+# Uncontroversial fixes to Sage's code
+# We should forward these upstream, and they would probably accept
+u1-version-planarity-3.patch
+u1-version-pbori-boost1.62-hashes.patch
+u1-version-ecm-7.patch
+u1-version-cddlib-094h.patch
+u1-fix-libgap-systemwide.patch
+u1-fix-use-lexists-not-exists.patch
+u1-fix-proper-scipy-rtol.patch
+u1-fix-preexec-fn.patch
+u1-fix-dont-require-DISPLAY.patch
 
-# due to Debian's inherent differences with upstream;
-# we're unlikely to forward these upstream
-debian-fakeroot.patch
-debian-paths.patch
-debian-disable-jsmol.patch
-debian-sage-env.patch
-debian-exec.patch
-debian-maxima.patch
-debian-singular.patch
-debian-libgap-sage.patch
-debian-rubiks.patch
-debian-pari.patch
-debian-pari-stackwarn.patch
-debian-nauty.patch
-debian-gsl-cblas.patch
-debian-arb.patch
-debian-cython-sys-path.patch
-debian-sage-gap-reset.patch
-debian-test-optional.patch
-# this next one contains some stuff that should be forwarded upstream
-debian-fix-trivial-test-cases.patch
-debian-install-paths.patch
-debian-scripts-dir.patch
+# Patches that should be upstreamed, but need a bit more work first
+u2-allow-override-sage-local.patch
+u2-fix-trivial-test-cases.patch
+u2-fix-less-trivial-test-cases.patch
 
-# temporary patches for whatever reason
-# they will eventually be gotten rid of
-temp-pip-nowarn.patch
-temp-disable-parallel-sphinx.patch
-version-temp-singular-4-extra-fixes.patch
-version-temp-glpk-4.60-extra-hacky-fixes.patch
-debian-temp-r-no-readline.patch
-trac_21749.patch
-fixsage-preexec-fn.patch
-debian-fix-less-trivial-test-cases.patch
-temp-fix-test-cases.patch
+# Patch Sage to work with dependency Debian packages
+# These won't change even if Debian and Sage use the same version
+# Not suitable for upstreaming
+d0-arb.patch
+d0-cython-sys-path.patch
+d0-gsl-cblas.patch
+d0-libgap-sage.patch
+d0-maxima.patch
+d0-nauty.patch
+d0-pari.patch
+d0-pari-stackwarn.patch
+d0-rubiks.patch
+d0-singular.patch
+d0-disable-jsmol.patch
+d0-paths-sharedata.patch
+d0-paths.patch
+
+# Patch Sage to behave as a Debian package
+# Not suitable for upstreaming
+d1-install-paths.patch # many things in here could be split into an upstreamable patch
+d1-sage-cli.patch
+d1-sage-env.patch
+d1-scripts-dir.patch
+d1-fakeroot.patch
+d1-test-optional.patch
+
+# Potentially controversial fixes
+# We had to do these to make things work, at some time in the past
+# It may be possible to drop these now or in the future; test that first.
+df-revert-lazy-import-dependent-on-python-patch.patch
+df-revert-minor-feature-dependent-on-python-patch.patch
+df-disable-custom-sphinx-logger.patch
+df-python_security.patch
+df-sagedoc_avoid_exception.patch
+df-sage-gap-reset-doctest.patch
+df-silence_debian_bug_780186.patch
+df-silence_ecl_opt_signals.patch
+
+# Temporary patches for whatever reason
+# They will eventually be gotten rid of
+dt-disable-parallel-sphinx.patch
+dt-version-singular-4-extra-fixes.patch
+dt-version-glpk-4.60-extra-hacky-fixes.patch
+dt-r-no-readline.patch
+dt-more-fix-test-cases.patch
diff --git a/debian/patches/trac_21749.patch b/debian/patches/u0-distutils-fixes.patch
similarity index 98%
rename from debian/patches/trac_21749.patch
rename to debian/patches/u0-distutils-fixes.patch
index f199cfd..552cab2 100644
--- a/debian/patches/trac_21749.patch
+++ b/debian/patches/u0-distutils-fixes.patch
@@ -22,7 +22,7 @@ Subject: Clean up some # distutils directives
 
 --- a/sage/src/module_list.py
 +++ b/sage/src/module_list.py
-@@ -103,12 +103,6 @@
+@@ -100,12 +100,6 @@
  )
  
  #########################################################
@@ -35,7 +35,7 @@ Subject: Clean up some # distutils directives
  ### M4RI flags
  #########################################################
  
-@@ -451,8 +445,7 @@
+@@ -448,8 +442,7 @@
                sources = ['sage/graphs/base/dense_graph.pyx']),
  
      Extension('sage.graphs.base.boost_graph',
@@ -45,7 +45,7 @@ Subject: Clean up some # distutils directives
  
      ################################
      ##
-@@ -892,7 +885,7 @@
+@@ -889,7 +882,7 @@
  
      Extension('sage.matrix.matrix_integer_dense',
                sources = ['sage/matrix/matrix_integer_dense.pyx'],
@@ -54,7 +54,7 @@ Subject: Clean up some # distutils directives
                libraries = ['iml', 'ntl', 'gmp', 'm', 'flint'] + cblas_libs,
                library_dirs = cblas_library_dirs,
                include_dirs = cblas_include_dirs),
-@@ -1012,9 +1005,7 @@
+@@ -1009,9 +1002,7 @@
                sources = ['sage/modular/arithgroup/congroup.pyx']),
  
      Extension('sage.modular.arithgroup.farey_symbol',
@@ -65,7 +65,7 @@ Subject: Clean up some # distutils directives
  
      Extension('sage.modular.arithgroup.arithgroup_element',
                sources = ['sage/modular/arithgroup/arithgroup_element.pyx']),
-@@ -1601,8 +1592,7 @@
+@@ -1598,8 +1589,7 @@
                include_dirs = m4ri_include_dirs + png_include_dirs,
                depends = [SAGE_INC + "/polybori/" + hd + ".h" for hd in ["polybori", "config"] ] +
                          [SAGE_INC + '/m4ri/m4ri.h'],
diff --git a/debian/patches/temp-pip-nowarn.patch b/debian/patches/u0-pip-nowarn.patch
similarity index 100%
rename from debian/patches/temp-pip-nowarn.patch
rename to debian/patches/u0-pip-nowarn.patch
diff --git a/debian/patches/version-python-2.7.11.patch b/debian/patches/u0-timeit-python-2.7.11.patch
similarity index 100%
rename from debian/patches/version-python-2.7.11.patch
rename to debian/patches/u0-timeit-python-2.7.11.patch
diff --git a/debian/patches/version-cython-0.25.patch b/debian/patches/u0-version-cython-0.25.patch
similarity index 77%
rename from debian/patches/version-cython-0.25.patch
rename to debian/patches/u0-version-cython-0.25.patch
index 2dce607..b0abbd9 100644
--- a/debian/patches/version-cython-0.25.patch
+++ b/debian/patches/u0-version-cython-0.25.patch
@@ -18,8 +18,6 @@ Subject: [PATCH 1/2] Move old_style_globals to individual modules
 Note: In addition to this sagemath commit, this patch also contains a change to setup.py
 regarding the missing Cython.Compiler.Options.directive_defaults not being defined anymore. --TH
 
-diff --git a/src/sage/calculus/var.pyx b/src/sage/calculus/var.pyx
-index b11b111..0a18f68 100644
 --- a/sage/src/sage/calculus/var.pyx
 +++ b/sage/src/sage/calculus/var.pyx
 @@ -1,6 +1,8 @@
@@ -31,8 +29,6 @@ index b11b111..0a18f68 100644
  from sage.symbolic.function_factory import function as new_function
  from sage.symbolic.ring import SR
  
-diff --git a/src/sage/ext/interactive_constructors_c.pyx b/src/sage/ext/interactive_constructors_c.pyx
-index 321e368..a9b9bea 100644
 --- a/sage/src/sage/ext/interactive_constructors_c.pyx
 +++ b/sage/src/sage/ext/interactive_constructors_c.pyx
 @@ -1,3 +1,4 @@
@@ -40,8 +36,6 @@ index 321e368..a9b9bea 100644
  r"""
  Constructors that automatically inject variables into the global module scope
  """
-diff --git a/src/sage/misc/citation.pyx b/src/sage/misc/citation.pyx
-index 77454aa..2053074 100644
 --- a/sage/src/sage/misc/citation.pyx
 +++ b/sage/src/sage/misc/citation.pyx
 @@ -1,4 +1,7 @@
@@ -53,8 +47,6 @@ index 77454aa..2053074 100644
  
  from sage.misc.all import tmp_filename
  from sage.env import SAGE_ROOT
-diff --git a/src/sage/misc/fpickle.pyx b/src/sage/misc/fpickle.pyx
-index 79520b1..c6d0d74 100644
 --- a/sage/src/sage/misc/fpickle.pyx
 +++ b/sage/src/sage/misc/fpickle.pyx
 @@ -1,3 +1,4 @@
@@ -62,8 +54,6 @@ index 79520b1..c6d0d74 100644
  """
  Function pickling
  
-diff --git a/src/sage/misc/reset.pyx b/src/sage/misc/reset.pyx
-index bd6bc78..bd7c94b 100644
 --- a/sage/src/sage/misc/reset.pyx
 +++ b/sage/src/sage/misc/reset.pyx
 @@ -1,4 +1,7 @@
@@ -75,8 +65,6 @@ index bd6bc78..bd7c94b 100644
  
  import sys
  
-diff --git a/src/sage/misc/sage_timeit_class.pyx b/src/sage/misc/sage_timeit_class.pyx
-index 4c369f8..82f421f 100644
 --- a/sage/src/sage/misc/sage_timeit_class.pyx
 +++ b/sage/src/sage/misc/sage_timeit_class.pyx
 @@ -1,3 +1,5 @@
@@ -85,7 +73,7 @@ index 4c369f8..82f421f 100644
  """
  The ``timeit`` command
  
-@@ -5,8 +7,6 @@ This uses the function :func:`~sage.misc.sage_timeit.sage_timeit`.
+@@ -5,8 +7,6 @@
  """
  from __future__ import absolute_import
  
@@ -94,8 +82,6 @@ index 4c369f8..82f421f 100644
  from . import sage_timeit
  
  
-diff --git a/src/sage/structure/category_object.pyx b/src/sage/structure/category_object.pyx
-index d9ef9c5..97930d3 100644
 --- a/sage/src/sage/structure/category_object.pyx
 +++ b/sage/src/sage/structure/category_object.pyx
 @@ -1,3 +1,4 @@
@@ -103,8 +89,6 @@ index d9ef9c5..97930d3 100644
  r"""
  Base class for objects of a category
  
-diff --git a/src/sage/structure/sage_object.pyx b/src/sage/structure/sage_object.pyx
-index c931a64..4caf4ae 100644
 --- a/sage/src/sage/structure/sage_object.pyx
 +++ b/sage/src/sage/structure/sage_object.pyx
 @@ -1,4 +1,5 @@
@@ -113,10 +97,8 @@ index c931a64..4caf4ae 100644
  r"""
  Abstract base class for Sage objects
  """
-diff --git a/src/setup.py b/src/setup.py
-index c26639d..f094700 100755
---- a/sage/src/setup.py	2016-11-05 19:34:44.701025334 +0000
-+++ b/sage/src/setup.py	2016-11-05 19:46:00.706210289 +0000
+--- a/sage/src/setup.py
++++ b/sage/src/setup.py
 @@ -562,16 +562,7 @@
      import Cython.Compiler.Options
      import Cython.Compiler.Main
@@ -134,7 +116,7 @@ index c26639d..f094700 100755
      debug = False
      if os.environ.get('SAGE_DEBUG', None) != 'no':
          print('Enabling Cython debugging support')
-@@ -608,7 +598,10 @@
+@@ -608,7 +599,10 @@
          force=force,
          aliases=aliases,
          compiler_directives={
diff --git a/debian/patches/version-glpk-4.60.patch b/debian/patches/u0-version-glpk-4.60.patch
similarity index 100%
rename from debian/patches/version-glpk-4.60.patch
rename to debian/patches/u0-version-glpk-4.60.patch
diff --git a/debian/patches/version-pari-2.9-trac-21765.patch b/debian/patches/u0-version-pari-2.9-trac-21765.patch
similarity index 79%
rename from debian/patches/version-pari-2.9-trac-21765.patch
rename to debian/patches/u0-version-pari-2.9-trac-21765.patch
index 7565e4a..33b701f 100644
--- a/debian/patches/version-pari-2.9-trac-21765.patch
+++ b/debian/patches/u0-version-pari-2.9-trac-21765.patch
@@ -7,11 +7,9 @@ Subject: Simplify relative_discriminant()
  src/sage/rings/number_field/number_field_rel.py | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
 
-diff --git a/src/sage/rings/number_field/number_field_rel.py b/src/sage/rings/number_field/number_field_rel.py
-index ca2b20e..cb9f346 100644
 --- a/sage/src/sage/rings/number_field/number_field_rel.py
 +++ b/sage/src/sage/rings/number_field/number_field_rel.py
-@@ -2282,12 +2282,10 @@ class NumberField_relative(NumberField_generic):
+@@ -2282,12 +2282,10 @@
              sage: L.relative_discriminant()
              Fractional ideal (2)
          """
@@ -26,6 +24,3 @@ index ca2b20e..cb9f346 100644
  
      def discriminant(self):
          """
--- 
-cgit v1.0-1-gd88e
-
diff --git a/debian/patches/version-pari-2.9.patch b/debian/patches/u0-version-pari-2.9.patch
similarity index 99%
rename from debian/patches/version-pari-2.9.patch
rename to debian/patches/u0-version-pari-2.9.patch
index d194562..36bba5a 100644
--- a/debian/patches/version-pari-2.9.patch
+++ b/debian/patches/u0-version-pari-2.9.patch
@@ -854,7 +854,7 @@ Applied-Upstream: 7.5, commit:920252a6c8fe46490410c84ca508381e7f08393a
              sage: UK = K.unit_group(); UK
 --- a/sage/src/sage/rings/polynomial/polynomial_quotient_ring.py
 +++ b/sage/src/sage/rings/polynomial/polynomial_quotient_ring.py
-@@ -1081,7 +1081,21 @@
+@@ -1080,7 +1080,21 @@
              sage: R.<x> = K[]
              sage: S.<xbar> = R.quotient((x^2 + 23)*(x^2 + 31))
              sage: S.S_class_group([])
@@ -877,7 +877,7 @@ Applied-Upstream: 7.5, commit:920252a6c8fe46490410c84ca508381e7f08393a
  
          By using the ideal `(a)`, we cut the part of the class group coming from
          `x^2 + 31` from 12 to 2, i.e. we lose a generator of order 6 (this was
-@@ -1200,7 +1214,21 @@
+@@ -1199,7 +1213,21 @@
              sage: R.<x> = K[]
              sage: S.<xbar> = R.quotient((x^2 + 23)*(x^2 + 31))
              sage: S.class_group()
@@ -900,7 +900,7 @@ Applied-Upstream: 7.5, commit:920252a6c8fe46490410c84ca508381e7f08393a
  
          Note that all the returned values live where we expect them to::
  
-@@ -1238,13 +1266,13 @@
+@@ -1237,13 +1265,13 @@
              Unit group with structure C6 of Number Field in a with defining polynomial x^2 + 3
              sage: K.<a> = QQ['x'].quotient(x^2 + 3)
              sage: u,o = K.S_units([])[0]; u, o
@@ -916,7 +916,7 @@ Applied-Upstream: 7.5, commit:920252a6c8fe46490410c84ca508381e7f08393a
  
          ::
  
-@@ -1253,11 +1281,21 @@
+@@ -1252,11 +1280,21 @@
              sage: L.<b> = K['y'].quotient(y^3 + 5); L
              Univariate Quotient Polynomial Ring in b over Number Field in a with defining polynomial x^2 + 3 with modulus y^3 + 5
              sage: L.S_units([])
@@ -941,7 +941,7 @@ Applied-Upstream: 7.5, commit:920252a6c8fe46490410c84ca508381e7f08393a
  
          Note that all the returned values live where we expect them to::
  
-@@ -1315,13 +1353,13 @@
+@@ -1314,13 +1352,13 @@
              Unit group with structure C6 of Number Field in a with defining polynomial x^2 + 3
              sage: K.<a> = QQ['x'].quotient(x^2 + 3)
              sage: u = K.units()[0][0]; u
@@ -957,7 +957,7 @@ Applied-Upstream: 7.5, commit:920252a6c8fe46490410c84ca508381e7f08393a
              sage: K.<a> = QQ['x'].quotient(x^2 + 5)
              sage: K.units(())
              [(-1, 2)]
-@@ -1333,14 +1371,16 @@
+@@ -1332,14 +1370,16 @@
              sage: L.<b> = K['y'].quotient(y^3 + 5); L
              Univariate Quotient Polynomial Ring in b over Number Field in a with defining polynomial x^2 + 3 with modulus y^3 + 5
              sage: L.units()
@@ -976,7 +976,7 @@ Applied-Upstream: 7.5, commit:920252a6c8fe46490410c84ca508381e7f08393a
  
          Note that all the returned values live where we expect them to::
  
-@@ -1387,15 +1427,15 @@
+@@ -1386,15 +1426,15 @@
              sage: D.selmer_group([K.ideal(2, -a+1)], 2)
              [2, -1]
              sage: D.selmer_group([K.ideal(2, -a+1), K.ideal(3, a+1)], 2)
diff --git a/debian/patches/version-singular-4.patch b/debian/patches/u0-version-singular-4.patch
similarity index 99%
rename from debian/patches/version-singular-4.patch
rename to debian/patches/u0-version-singular-4.patch
index 9cf0eac..a7c0aea 100644
--- a/debian/patches/version-singular-4.patch
+++ b/debian/patches/u0-version-singular-4.patch
@@ -1,5 +1,6 @@
 Description: Necessary changes to work with singular 4.
 Origin: https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/sagemath
+Bug: https://trac.sagemath.org/ticket/17254
 
 --- a/sage/src/bin/sage
 +++ b/sage/src/bin/sage
diff --git a/debian/patches/fixsage-dont-require-DISPLAY.patch b/debian/patches/u1-fix-dont-require-DISPLAY.patch
similarity index 100%
rename from debian/patches/fixsage-dont-require-DISPLAY.patch
rename to debian/patches/u1-fix-dont-require-DISPLAY.patch
diff --git a/debian/patches/fixsage-libgap-systemwide.patch b/debian/patches/u1-fix-libgap-systemwide.patch
similarity index 100%
rename from debian/patches/fixsage-libgap-systemwide.patch
rename to debian/patches/u1-fix-libgap-systemwide.patch
diff --git a/debian/patches/fixsage-preexec-fn.patch b/debian/patches/u1-fix-preexec-fn.patch
similarity index 100%
rename from debian/patches/fixsage-preexec-fn.patch
rename to debian/patches/u1-fix-preexec-fn.patch
diff --git a/debian/patches/fixsage-proper-scipy-rtol.patch b/debian/patches/u1-fix-proper-scipy-rtol.patch
similarity index 100%
rename from debian/patches/fixsage-proper-scipy-rtol.patch
rename to debian/patches/u1-fix-proper-scipy-rtol.patch
diff --git a/debian/patches/fixsage-use-lexists-not-exists.patch b/debian/patches/u1-fix-use-lexists-not-exists.patch
similarity index 100%
rename from debian/patches/fixsage-use-lexists-not-exists.patch
rename to debian/patches/u1-fix-use-lexists-not-exists.patch
diff --git a/debian/patches/version-cddlib-094h.patch b/debian/patches/u1-version-cddlib-094h.patch
similarity index 100%
rename from debian/patches/version-cddlib-094h.patch
rename to debian/patches/u1-version-cddlib-094h.patch
diff --git a/debian/patches/version-ecm-7.patch b/debian/patches/u1-version-ecm-7.patch
similarity index 100%
rename from debian/patches/version-ecm-7.patch
rename to debian/patches/u1-version-ecm-7.patch
diff --git a/debian/patches/fixsage-pbori-boost1.62-hashes.patch b/debian/patches/u1-version-pbori-boost1.62-hashes.patch
similarity index 95%
rename from debian/patches/fixsage-pbori-boost1.62-hashes.patch
rename to debian/patches/u1-version-pbori-boost1.62-hashes.patch
index d9635e6..491b7b1 100644
--- a/debian/patches/fixsage-pbori-boost1.62-hashes.patch
+++ b/debian/patches/u1-version-pbori-boost1.62-hashes.patch
@@ -12,7 +12,7 @@ Author: Tobias Hansen <thansen at debian.org>
 
 --- a/sage/src/sage/rings/polynomial/pbori.pyx
 +++ b/sage/src/sage/rings/polynomial/pbori.pyx
-@@ -2340,7 +2340,7 @@
+@@ -2341,7 +2341,7 @@
              sage: m = x.lm()
              sage: m.stable_hash()
              -845955105                 # 32-bit
@@ -21,7 +21,7 @@ Author: Tobias Hansen <thansen at debian.org>
  
          .. note::
  
-@@ -4648,7 +4648,7 @@
+@@ -4649,7 +4649,7 @@
              sage: B.<x,y> = BooleanPolynomialRing()
              sage: x.stable_hash()
              -845955105                 # 32-bit
@@ -30,7 +30,7 @@ Author: Tobias Hansen <thansen at debian.org>
  
          .. note::
  
-@@ -5732,7 +5732,7 @@
+@@ -5733,7 +5733,7 @@
              sage: s = x.set()
              sage: s.stable_hash()
              -845955105                 # 32-bit
diff --git a/debian/patches/version-planarity-3.patch b/debian/patches/u1-version-planarity-3.patch
similarity index 100%
rename from debian/patches/version-planarity-3.patch
rename to debian/patches/u1-version-planarity-3.patch
diff --git a/debian/patches/fixsage-allow-override-sage-local.patch b/debian/patches/u2-allow-override-sage-local.patch
similarity index 99%
rename from debian/patches/fixsage-allow-override-sage-local.patch
rename to debian/patches/u2-allow-override-sage-local.patch
index 4aa0240..207fb73 100644
--- a/debian/patches/fixsage-allow-override-sage-local.patch
+++ b/debian/patches/u2-allow-override-sage-local.patch
@@ -103,7 +103,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
  AX_CHECK_ROOT([AC_MSG_ERROR([You cannot build Sage as root, switch to an unpriviledged user])], [])
 --- a/sage/src/setup.py
 +++ b/sage/src/setup.py
-@@ -631,7 +631,7 @@
+@@ -625,7 +625,7 @@
  python_packages, python_modules = find_python_sources(
      SAGE_SRC, ['sage', 'sage_setup'])
  python_data_files = find_extra_files(python_packages,
diff --git a/debian/patches/debian-fix-less-trivial-test-cases.patch b/debian/patches/u2-fix-less-trivial-test-cases.patch
similarity index 98%
rename from debian/patches/debian-fix-less-trivial-test-cases.patch
rename to debian/patches/u2-fix-less-trivial-test-cases.patch
index d7b9ba7..e8b729a 100644
--- a/debian/patches/debian-fix-less-trivial-test-cases.patch
+++ b/debian/patches/u2-fix-less-trivial-test-cases.patch
@@ -39,7 +39,7 @@ to reduce the noise in our test results.
      numerical integration::
 --- a/sage/src/sage/graphs/strongly_regular_db.pyx
 +++ b/sage/src/sage/graphs/strongly_regular_db.pyx
-@@ -3134,12 +3134,12 @@
+@@ -3135,12 +3135,12 @@
  
          sage: from sage.graphs.strongly_regular_db import _check_database
          sage: _check_database() # long time
@@ -58,7 +58,7 @@ to reduce the noise in our test results.
      global _brouwer_database
 --- a/sage/src/sage/rings/integer.pyx
 +++ b/sage/src/sage/rings/integer.pyx
-@@ -6062,8 +6062,7 @@
+@@ -6072,8 +6072,7 @@
              sage: 1 << (2^60)
              Traceback (most recent call last):
              ...
diff --git a/debian/patches/debian-fix-trivial-test-cases.patch b/debian/patches/u2-fix-trivial-test-cases.patch
similarity index 89%
rename from debian/patches/debian-fix-trivial-test-cases.patch
rename to debian/patches/u2-fix-trivial-test-cases.patch
index d210a50..2dd9219 100644
--- a/debian/patches/debian-fix-trivial-test-cases.patch
+++ b/debian/patches/u2-fix-trivial-test-cases.patch
@@ -19,7 +19,7 @@ Forwarded: TODO
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- a/sage/src/sage/interfaces/maxima_abstract.py
 +++ b/sage/src/sage/interfaces/maxima_abstract.py
-@@ -1516,7 +1516,7 @@
+@@ -1519,7 +1519,7 @@
          EXAMPLES::
  
              sage: maxima('exp(-sqrt(x))').nintegral('x',0,1)
@@ -28,17 +28,6 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
  
          Note that GP also does numerical integration, and can do so to very
          high precision very quickly::
---- a/sage/src/sage/graphs/graph_generators.py
-+++ b/sage/src/sage/graphs/graph_generators.py
-@@ -869,7 +869,7 @@
- 
-             sage: gen = graphs.nauty_geng("4", debug=True)
-             sage: print(next(gen))
--            >A geng -d0D3 n=4 e=0-6
-+            >A nauty-geng -d0D3 n=4 e=0-6
-         """
-         import subprocess
-         sp = subprocess.Popen("nauty-geng {0}".format(options), shell=True,
 --- a/sage/src/sage/calculus/calculus.py
 +++ b/sage/src/sage/calculus/calculus.py
 @@ -723,7 +723,7 @@
@@ -154,22 +143,9 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
      """
      pass
  
---- a/sage/src/sage/env.py
-+++ b/sage/src/sage/env.py
-@@ -193,8 +193,8 @@
-         ['.../include',
-         '.../include/python...',
-         '.../python.../numpy/core/include',
--        '.../python.../site-packages',
--        '.../python.../site-packages/sage/ext']
-+        '.../python.../dist-packages',
-+        '.../python.../dist-packages/sage/ext']
-     """
-     import os, numpy
-     import distutils.sysconfig
 --- a/sage/src/sage/misc/cython.py
 +++ b/sage/src/sage/misc/cython.py
-@@ -172,14 +172,15 @@
+@@ -173,14 +173,15 @@
          'm',
          'ec',
          'gsl',
@@ -188,7 +164,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
          'c',
          [], ['-w', '-O2'],...)
          sage: s, libs, inc, lang, f, args, libdirs = pyx_preparse("# clang c++\n #clib foo\n # cinclude bar\n")
-@@ -194,7 +195,7 @@
+@@ -195,7 +196,7 @@
          'm',
          'ec',
          'gsl',
@@ -197,7 +173,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
          'ntl']
          sage: libs[1:] == sage.misc.cython.standard_libs
          True
-@@ -204,9 +205,10 @@
+@@ -205,9 +206,10 @@
          '.../include',
          '.../include/python...',
          '.../python.../numpy/core/include',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath.git



More information about the debian-science-commits mailing list