chiark / gitweb /
ubuntu-daily: default to natty
[bin.git] / ubuntu-daily
index d1143228264790d474bf73a7a1b9779620ef5572..9a41f4c4c2e11449ab24f511a953b460dbefc27e 100755 (executable)
@@ -1,10 +1,11 @@
 #! /bin/sh
 
 PROJECT=
-CURRENT_DIST=maverick
+CURRENT_DIST=natty
 DIST="$CURRENT_DIST"
 BASE=antimony:cdimage/www/full
 RSYNC=false
+HTTP=false
 
 usage () {
        cat <<EOF
@@ -12,13 +13,14 @@ Usage: $0 [options] image_type architecture
 
 Options:
   -f|--flavour FLAVOUR         Flavour (default: ubuntu).
-  -d|--dist DIST               Distribution (default: maverick).
+  -d|--dist DIST               Distribution (default: natty).
   -a|--anonymous               Don't use privileged access.
   -r|--rsync                   Force rsync.
+  -h|--http                    Force HTTP only (no reuse).
 EOF
 }
 
-eval set -- "$(getopt -o f:d:ar -l help,flavour:,dist:,anonymous,rsync -- "$@")" || { usage >&2; exit 2; }
+eval set -- "$(getopt -o f:d:arh -l help,flavour:,dist:,anonymous,rsync,http -- "$@")" || { usage >&2; exit 2; }
 while :; do
        case $1 in
                --help)
@@ -44,11 +46,19 @@ while :; do
                        RSYNC=:
                        shift
                        ;;
+               -h|--http)
+                       HTTP=:
+                       shift
+                       ;;
                --)     shift; break ;;
                *)      usage >&2; exit 2;
        esac
 done
 
+if $HTTP; then
+       BASE="http://cdimage.ubuntu.com"
+fi
+
 case $2 in
        hppa*|ia64*|lpia*|powerpc*|sparc*)
                PREFIX=ports/
@@ -94,7 +104,7 @@ esac
 case $1 in
        install|alternate|server|addon|serveraddon|dvd) ;;
        *)
-               RSYNC=:
+               $HTTP || RSYNC=:
                ;;
 esac
 
@@ -103,6 +113,8 @@ REMOTE="$BASE/${PROJECT:+$PROJECT/}$IMAGE_TYPE/current/$DIST-$1-$2"
 
 if $RSYNC; then
        ionice -c2 -n7 rsync -avP "$REMOTE.$EXTENSION" "$LOCAL.$EXTENSION"
+elif $HTTP; then
+       wget -O "$LOCAL.$EXTENSION" "$REMOTE.$EXTENSION"
 else
        rsync -avP "$REMOTE.jigdo" "$LOCAL.jigdo"
        if [ "$PROJECT" ]; then