Replace security.ubuntu.com when setting mirror

The current method to rewrite the mirror URL in the ubuntu element will
only rewrite archive.ubuntu.com, which leaves the security URL alone.
This is probably not intended for people who are creating images behind
firewalls.

Change-Id: I54a867e0e9d5a7c94324a5c00ff1a83b4e6e4524
This commit is contained in:
Steve Kowalik 2014-02-19 12:34:25 +11:00
parent 6360b46229
commit a84611d766
2 changed files with 3 additions and 3 deletions

View File

@ -6,5 +6,5 @@ Overrides:
use the environment variable DIB\_CLOUD\_IMAGES use the environment variable DIB\_CLOUD\_IMAGES
* To download a non-default release of Ubuntu cloud images, use the * To download a non-default release of Ubuntu cloud images, use the
environment variable DIB\_RELEASE environment variable DIB\_RELEASE
* To use a different mirror rather than archive.ubuntu.com, use the * To use different mirrors rather than the default of archive.ubuntu.com and
environment variable DIB\_DISTRIBUTION\_MIRROR security.ubuntu.com, use the environment variable DIB\_DISTRIBUTION\_MIRROR

View File

@ -6,5 +6,5 @@ DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-}
[ -n "$DIB_DISTRIBUTION_MIRROR" ] || exit 0 [ -n "$DIB_DISTRIBUTION_MIRROR" ] || exit 0
sudo sed -ie "s&http://archive.ubuntu.com/ubuntu&$DIB_DISTRIBUTION_MIRROR&" \ sudo sed -ie "s&http://\(archive\|security\).ubuntu.com/ubuntu&$DIB_DISTRIBUTION_MIRROR&" \
/etc/apt/sources.list /etc/apt/sources.list