Opened 3 years ago

Last modified 3 years ago

#22062 new defect

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

Reported by: slabbe Owned by:
Priority: minor Milestone: sage-7.5
Component: scripts Keywords:
Cc: jdemeyer Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

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.

Change History (2)

comment:1 Changed 3 years ago by jhpalmieri

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:

  • src/bin/sage

    diff --git a/src/bin/sage b/src/bin/sage
    index cb3b611..3fb83ac 100755
    a b install() { 
    844844                continue;;
    845845        esac
    846846
    847         PKG_NAME=`echo "$PKG" | sed -e "s/\.spkg$//"`
    848         PKG_NAME=`basename "$PKG_NAME"`
    849 
    850         sage-logger \
    851             "sage-spkg $INSTALL_OPTIONS '$PKG'" "$SAGE_LOGS/$PKG_NAME.log"
    852         # Do not try to install further packages if one failed
    853         if [ $? -ne 0 ]; then
    854             exit 1
     847        if [[ $INSTALL_OPTIONS == *"-info"* ]]; then
     848            # Just print the info, don't write a log file.
     849            sage-spkg --info "$PKG" || exit $?
     850        else
     851            PKG_NAME=`echo "$PKG" | sed -e "s/\.spkg$//"`
     852            PKG_NAME=`basename "$PKG_NAME"`
     853
     854            sage-logger \
     855                "sage-spkg $INSTALL_OPTIONS '$PKG'" "$SAGE_LOGS/$PKG_NAME.log"
     856            # Do not try to install further packages if one failed
     857            if [ $? -ne 0 ]; then
     858                exit 1
     859            fi
    855860        fi
    856861    done
    857862    # Display a message if we actually installed something (using this

comment:2 Changed 3 years ago by jhpalmieri

  • Cc jdemeyer added
Note: See TracTickets for help on using tickets.