Ticket #4949: 4949_review.patch

File 4949_review.patch, 1.5 KB (added by jdemeyer, 8 years ago)
  • spkg/bin/sage-spkg

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1329331064 -3600
    # Node ID e555324da8475b1fa0c80aca1208147f02c12b21
    # Parent  a6ab49e09c40710fbae798872391ce7514fe32ca
    Reviewer patch
    
    diff --git a/spkg/bin/sage-spkg b/spkg/bin/sage-spkg
    a b  
    207207    exit 1
    208208fi
    209209
     210# Make absolutely sure that we are in the build directory before doing
     211# a scary "rm -rf" below.
    210212cd "$SAGE_BUILD_DIR"
    211213if [ $? -ne 0 ]; then
    212214    echo >&2 "Unable to find build directory."
     
    215217
    216218if [ $DELETE_TMP -eq 1 ]; then
    217219    echo "Deleting directories from past builds of previous/current versions of $PKG_NAME"
    218     # Make sure that we are in the build directory before doing
    219     # a scary "rm -rf".
    220     cd "$SAGE_BUILD_DIR"
    221220    rm -rf "$PKG_BASE-"*
    222221else
    223222    for dir in "$PKG_BASE-"*
    224223    do
    225         if [ -e "$dir" ]; then
    226             echo "Moving old directory $dir to $SAGE_BUILD_DIR/old..."
    227             mkdir -p old
    228             if [ $? -ne 0 ]; then
    229                 echo >&2 "Error creating directory $SAGE_BUILD_DIR/old."
    230                 exit 1
    231             fi
    232             rm -rf old/"$dir"
    233             mv "$dir" old/
    234         fi
     224        if [ -e "$dir" ]; then
     225            echo "Moving old directory $dir to $SAGE_BUILD_DIR/old..."
     226            mkdir -p old
     227            if [ $? -ne 0 ]; then
     228                echo >&2 "Error creating directory $SAGE_BUILD_DIR/old."
     229                exit 1
     230            fi
     231            rm -rf old/"$dir"
     232            mv "$dir" old/
     233        fi
    235234    done
    236235fi
    237236