Ticket #10040: trac_10040-untar_non-verbosely_by_default-sage_scripts.patch

File trac_10040-untar_non-verbosely_by_default-sage_scripts.patch, 1.8 KB (added by leif, 9 years ago)

Apply to Sage scripts repository. Based on Sage 4.6.rc0pre1.

  • sage-spkg

    # HG changeset patch
    # User Leif Leonhardy <not.really@online.de>
    # Date 1287748645 -7200
    # Node ID 9743d57baa9d88f27dc2fc5fb82bb0d62cf61ba0
    # Parent  b3f26ac34da42fceae97a6dcc68fea880b9a7404
    #10040 Don't pass 'v' to tar by default (only if SAGE_SPKG_LIST_FILES=yes).
    
    diff -r b3f26ac34da4 -r 9743d57baa9d sage-spkg
    a b  
    127127    fi
    128128fi
    129129
     130# Don't verbosely extract files from spkgs by default (#10040):
     131
     132if [ "$SAGE_SPKG_LIST_FILES" = "yes" ]; then
     133    UNTAR_VERBOSE=v
     134else
     135    unset UNTAR_VERBOSE
     136fi
     137
    130138if [ $INFO -ne 0 ]; then
    131139    if [ ! -f "$PKG_SRC" ]; then
    132140        echo "Package $PKG_NAME not found"
    133141    fi
    134     bunzip2 -c "$PKG_SRC" 2>/dev/null | tar Ofx - $PKG_NAME/SAGE.txt 2>/dev/null
     142    bunzip2 -c "$PKG_SRC" 2>/dev/null | tar Ofx${UNTAR_VERBOSE} - $PKG_NAME/SAGE.txt 2>/dev/null
    135143    if [ $? -ne 0 ]; then
    136         tar Ofx  "$PKG_SRC" "$PKG_NAME/SAGE.txt" 2>/dev/null
     144        tar Ofx${UNTAR_VERBOSE} "$PKG_SRC" "$PKG_NAME/SAGE.txt" 2>/dev/null
    137145    fi
    138146    echo ""
    139147    if [ $? -ne 0 ]; then
     
    239247    rm -rf "$PKG_NAME"
    240248fi
    241249
    242 bunzip2 -c "$PKG_SRC" 2>/dev/null | tar fxv -  2>/dev/null
     250bunzip2 -c "$PKG_SRC" 2>/dev/null | tar fx${UNTAR_VERBOSE} -  2>/dev/null
    243251if [ ! -d "$PKG_NAME" ]; then
    244     tar fxv "$PKG_SRC"
     252    tar fx${UNTAR_VERBOSE} "$PKG_SRC"
    245253fi
    246254echo "Finished extraction"
    247255
     
    261269    fi
    262270    sage-download_package "$PKG_NAME"
    263271    echo `pwd`
    264     bunzip2 -c "$PKG_NAME.spkg"  | tar fxv -
     272    bunzip2 -c "$PKG_NAME.spkg"  | tar fx${UNTAR_VERBOSE} -
    265273    if [ ! -d "$PKG_NAME.spkg" ]; then
    266         tar fxv "$PKG_NAME.spkg"
     274        tar fx${UNTAR_VERBOSE} "$PKG_NAME.spkg"
    267275    fi
    268276    if [ ! -d "$PKG_NAME" ]; then
    269277        echo "Second download resulted in a corrupted package."