chiark
/
gitweb
/
~cjwatson
/
bin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e7d312d
)
ubuntu-daily: add -h/--http option
author
Colin Watson
<cjwatson@chiark.greenend.org.uk>
Thu, 18 Nov 2010 12:49:03 +0000
(12:49 +0000)
committer
Colin Watson
<cjwatson@chiark.greenend.org.uk>
Thu, 18 Nov 2010 12:49:03 +0000
(12:49 +0000)
ubuntu-daily
patch
|
blob
|
history
diff --git
a/ubuntu-daily
b/ubuntu-daily
index d1143228264790d474bf73a7a1b9779620ef5572..177160c92fdb57b3b5efa3e8ebbfab32a5758c50 100755
(executable)
--- a/
ubuntu-daily
+++ b/
ubuntu-daily
@@
-5,6
+5,7
@@
CURRENT_DIST=maverick
DIST="$CURRENT_DIST"
BASE=antimony:cdimage/www/full
RSYNC=false
DIST="$CURRENT_DIST"
BASE=antimony:cdimage/www/full
RSYNC=false
+HTTP=false
usage () {
cat <<EOF
usage () {
cat <<EOF
@@
-15,10
+16,11
@@
Options:
-d|--dist DIST Distribution (default: maverick).
-a|--anonymous Don't use privileged access.
-r|--rsync Force rsync.
-d|--dist DIST Distribution (default: maverick).
-a|--anonymous Don't use privileged access.
-r|--rsync Force rsync.
+ -h|--http Force HTTP only (no reuse).
EOF
}
EOF
}
-eval set -- "$(getopt -o f:d:ar
-l help,flavour:,dist:,anonymous,rsync
-- "$@")" || { usage >&2; exit 2; }
+eval set -- "$(getopt -o f:d:ar
h -l help,flavour:,dist:,anonymous,rsync,http
-- "$@")" || { usage >&2; exit 2; }
while :; do
case $1 in
--help)
while :; do
case $1 in
--help)
@@
-44,11
+46,19
@@
while :; do
RSYNC=:
shift
;;
RSYNC=:
shift
;;
+ -h|--http)
+ HTTP=:
+ shift
+ ;;
--) shift; break ;;
*) usage >&2; exit 2;
esac
done
--) 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/
case $2 in
hppa*|ia64*|lpia*|powerpc*|sparc*)
PREFIX=ports/
@@
-94,7
+104,7
@@
esac
case $1 in
install|alternate|server|addon|serveraddon|dvd) ;;
*)
case $1 in
install|alternate|server|addon|serveraddon|dvd) ;;
*)
- RSYNC=:
+
$HTTP ||
RSYNC=:
;;
esac
;;
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"
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
else
rsync -avP "$REMOTE.jigdo" "$LOCAL.jigdo"
if [ "$PROJECT" ]; then