Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sage -t tests/cmdline.py creates junk file logs/pkgs/sqlite.log #22062

Closed
seblabbe opened this issue Dec 15, 2016 · 4 comments
Closed

sage -t tests/cmdline.py creates junk file logs/pkgs/sqlite.log #22062

seblabbe opened this issue Dec 15, 2016 · 4 comments

Comments

@seblabbe
Copy link
Contributor

As reported on sage-release:

rm -f logs/pkgs/sqlite.log
sage -t src/sage/tests/cmdline.py
ls logs/pkgs/sq*

creates file

logs/pkgs/sqlite.log

... which is not a log file at all.

CC: @jdemeyer @slel @tornaria @mkoeppe

Component: scripts

Reviewer: Michael Orlitzky

Issue created by migration from https://trac.sagemath.org/ticket/22062

@seblabbe seblabbe added this to the sage-7.5 milestone Dec 15, 2016
@jhpalmieri
Copy link
Member

comment:1

I believe that the log file is created by the line

sage: out, err, ret = test_executable(["sage", "-p", "--info", "--info", "sqlite"])

Indeed, running sage --info sqlite just prints the SPKG.txt file to the screen, while sage -p --info sqlite also dumps that to a log file. This is because of the way the script src/bin/sage is written. We could change that:

diff --git a/src/bin/sage b/src/bin/sage
index cb3b611..3fb83ac 100755
--- a/src/bin/sage
+++ b/src/bin/sage
@@ -844,14 +844,19 @@ install() {
                 continue;;
         esac
 
-        PKG_NAME=`echo "$PKG" | sed -e "s/\.spkg$//"`
-        PKG_NAME=`basename "$PKG_NAME"`
-
-        sage-logger \
-            "sage-spkg $INSTALL_OPTIONS '$PKG'" "$SAGE_LOGS/$PKG_NAME.log"
-        # Do not try to install further packages if one failed
-        if [ $? -ne 0 ]; then
-            exit 1
+        if [[ $INSTALL_OPTIONS == *"-info"* ]]; then
+            # Just print the info, don't write a log file.
+            sage-spkg --info "$PKG" || exit $?
+        else
+            PKG_NAME=`echo "$PKG" | sed -e "s/\.spkg$//"`
+            PKG_NAME=`basename "$PKG_NAME"`
+
+            sage-logger \
+                "sage-spkg $INSTALL_OPTIONS '$PKG'" "$SAGE_LOGS/$PKG_NAME.log"
+            # Do not try to install further packages if one failed
+            if [ $? -ne 0 ]; then
+                exit 1
+            fi
         fi
     done
     # Display a message if we actually installed something (using this

@slel slel modified the milestones: sage-7.5, sage-9.5 Dec 24, 2021
@jhpalmieri
Copy link
Member

comment:4

This might also be addressed by #30649, although I haven't tested that.

@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Jan 12, 2022
@jhpalmieri
Copy link
Member

comment:6

This has indeed now been fixed, so I propose closing this.

@jhpalmieri jhpalmieri removed this from the sage-9.6 milestone Mar 3, 2022
@orlitzky
Copy link
Contributor

Reviewer: Michael Orlitzky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants