Mercurial > ec-dotfiles
diff moefetch.sh @ 152:67df02877319
added quickfetch for skipping file checking
author | edhoprima |
---|---|
date | Sat, 25 Apr 2009 15:57:29 +0000 |
parents | 3d6b2152f4a3 |
children | 7b07448e46f1 |
line wrap: on
line diff
--- a/moefetch.sh Sat Apr 25 15:47:27 2009 +0000 +++ b/moefetch.sh Sat Apr 25 15:57:29 2009 +0000 @@ -96,7 +96,11 @@ echo "`echo \`ls | wc -l\`` file(s) available locally" cd .. else - echo "Empty local repository" + if [ $ISQUICK -eq 1 ]; then + echo "quick mode selected. Skipping check" + else + echo "Empty local repository" + fi cat "$outdir-list" > "$outdir-newlist" fi } @@ -109,7 +113,7 @@ else echo "Starting wget" cd "../$outdir" - wget -bi "../temp/$outdir-newlist" -o "../temp/$outdir.log" + wget -bi -e continue=on "../temp/$outdir-newlist" -o "../temp/$outdir.log" fi } @@ -146,17 +150,19 @@ # initialization # are we really doing it? +HELP="Usage: moefetch (quick)fetch|status <tags>" + if [ $# -lt 2 ]; then - echo "Usage: moefetch status|fetch|update <tags>" + echo "$HELP" exit 1 fi case "$1" in - status|get|update) + status|fetch|quickfetch) echo "Starting..." ;; *) - echo "Usage: moefetch status|fetch|update <tags>" + echo "$HELP" exit 1 ;; esac @@ -169,6 +175,7 @@ echo "Tags: $tags" # slash do not want outdir=`echo "$tags" | sed -e 's/\//_/g'` +ISNEW=0 if [ -O "$basedir" ]; then if [ ! -d "$basedir/$outdir" ]; then ISNEW=1 @@ -201,17 +208,21 @@ # # let's do the job! +ISQUICK=0 case "$1" in status) GENERATE CHECK ;; - get) + fetch) GENERATE CHECK FETCH ;; - update) + quickfetch) + GENERATE + ISNEW=1 + ISQUICK=1 + CHECK FETCH - ;; esac