summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRelease Manager <release@sagemath.org>2015-08-05 20:41:53 +0200
committerVolker Braun <vbraun.name@gmail.com>2015-08-05 20:41:53 +0200
commitd585e9cdf232971320bbdc8194cc07aa00942ffa (patch)
tree99adf7ab6f84c8fc62b3d79c224f35f1d00bcb40
parentTrac #18991: Remove useful doctest (diff)
parentIgnore files in spkg directory (diff)
Trac #18993: sage-list-packages should ignore files in build/pkgs/
At the moment, {{{sage-list-packages}}} does not ignore files in {{{build/pkgs}}}, which can lead to errors if, say, your browser has automatically created a file after viewing this folder: {{{ jkeitel@pcl337b:~/sage/sage_optional> ./sage -optional Traceback (most recent call last): File "/home/pcl337b/jkeitel/sage/sage_optional/src/bin/sage-list- packages", line 57, in <module> with open(os.path.join(SAGE_PKGS, p, "package-version.txt")) as f: IOError: [Errno 20] Not a directory: '/home/pcl337b/jkeitel/sage/sage_optional/build/pkgs/.directory/package- version.txt' }}} I am attaching a simple patch that ignores files and only checks folders. URL: http://trac.sagemath.org/18993 Reported by: jkeitel Ticket author(s): Jan Keitel Reviewer(s): Volker Braun
-rwxr-xr-xsrc/bin/sage-list-packages2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bin/sage-list-packages b/src/bin/sage-list-packages
index 88f0f55..e809e40 100755
--- a/src/bin/sage-list-packages
+++ b/src/bin/sage-list-packages
@@ -52,6 +52,8 @@ installed = dict(pkgname_split(pkgname)
SAGE_PKGS = os.path.join(SAGE_ROOT, "build", "pkgs")
local = {}
for p in os.listdir(SAGE_PKGS):
+ if not os.path.isdir(os.path.join(SAGE_PKGS, p)):
+ continue
with open(os.path.join(SAGE_PKGS, p, "package-version.txt")) as f:
version = f.read().strip()
with open(os.path.join(SAGE_PKGS, p, "type")) as f: