Changeset 475


Ignore:
Timestamp:
Oct 28, 2012, 11:46:52 PM (7 years ago)
Author:
amain
Message:

bitten: fix bug in clean.sh which couldn't handle the new dir layout

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/contrib/bitten/scripts/clean.sh

    r462 r475  
    2323Cleans builds in ${work:-<buildir>}.
    2424
    25    method       keep-last: keep last build
    26                 keep-none: clean all builds
     25   method       keep-previous: keep previous build
     26                keep-none: clean all previous builds
    2727   config       Bitten Recipe Config short name
    2828   architecture mips, mipsel, ...
     
    4545function keep()
    4646{
    47    local method=${1:-keep-last}
     47   local method=${1:-keep-previous}
    4848   local keep_last=${2:-2}
    4949
    5050   echo "I: cleaning builds in ${work} using method '${method}'"
    5151
    52    find ${work} -maxdepth 1 -name "build_user*"  \
     52   find ${work} -maxdepth 1 -regex ".*/[0-9]+"  \
    5353     | sort -V \
    5454     | head -n -${keep_last} \
     
    6363case ${method} in
    6464   keep-none) keep ${method} 1;;
    65    keep-last) keep ${method} 2;;
     65   keep-previous) keep ${method} 2;;
    6666   *) echo "E: method '${method} not found";;
    6767esac
Note: See TracChangeset for help on using the changeset viewer.