#! /bin/sh
PROJECT=
-CURRENT_DIST=maverick
+CURRENT_DIST=oneiric
DIST="$CURRENT_DIST"
-BASE=antimony:cdimage/www/full
+BASE=cdimage.ubuntu.com::cdimage
RSYNC=false
+HTTP=false
usage () {
cat <<EOF
Options:
-f|--flavour FLAVOUR Flavour (default: ubuntu).
- -d|--dist DIST Distribution (default: maverick).
- -a|--anonymous Don't use privileged access.
+ -d|--dist DIST Distribution (default: oneiric).
+ -a|--authenticated 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:,authenticated,rsync,http -- "$@")" || { usage >&2; exit 2; }
while :; do
case $1 in
--help)
DIST="$2"
shift 2
;;
- -a|--anonymous)
- BASE=cdimage.ubuntu.com::cdimage
+ -a|--authenticated)
+ BASE=antimony:cdimage/www/full
shift
;;
-r|--rsync)
RSYNC=:
shift
;;
+ -h|--http)
+ HTTP=:
+ shift
+ ;;
--) shift; break ;;
*) usage >&2; exit 2;
esac
done
-case $2 in
- hppa*|ia64*|lpia*|powerpc*|sparc*)
- PREFIX=ports/
- ;;
- *)
- PREFIX=
- ;;
-esac
+if $HTTP; then
+ BASE="http://cdimage.ubuntu.com"
+fi
+
+PREFIX=
if [ "$DIST" != "$CURRENT_DIST" ]; then
PREFIX="$DIST/$PREFIX"
fi
esac
case $1 in
- install|alternate|server|addon|serveraddon|dvd) ;;
+ install|alternate|server|addon|serveraddon) ;;
*)
- RSYNC=:
+ $HTTP || RSYNC=:
;;
esac
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
EXISTING=:
mv "$LOCAL.iso" "$LOCAL.iso.old"
mkdir -p "old-$2"
- sudo mount -o loop "$LOCAL.iso.old" "old-$2"
+ sudo mount -o loop,ro "$LOCAL.iso.old" "old-$2"
fi
ionice -c2 -n7 jigdo-lite "$LOCAL.jigdo"
if $EXISTING; then