update for focal, also to support source mirror

This commit is contained in:
2020-02-15 09:55:25 -08:00
parent 9cbf6878fd
commit 7083e9c0f1
2 changed files with 28 additions and 7 deletions

View File

@@ -4,19 +4,24 @@ set -x
THISDIR="$(cd $(dirname "$BASH_SOURCE") && pwd -P)"
DST="/var/mirror"
echo "http://172.17.0.1/ubuntu/" > $DST/mirrors.txt
echo "$THIS_MIRROR_URL" > $DST/mirrors.txt
chmod a+r $DST/mirrors.txt
mkdir -p "$DST/ubuntu"
export GNUPGHOME="/etc/debmirror/ubuntu"
SOURCEOPT="--nosource"
if [[ ! -z "$UBUNTU_SOURCE_MIRROR" ]]; then
SOURCEOPT="--source"
fi
debmirror \
-a ${MIRROR_ARCHITECTURES:-amd64} \
--no-source \
-s ${MIRROR_CATEGORIES:-main,universe,multiverse,restricted} \
-h ${UBUNTU_MIRROR_SOURCE:-archive.ubuntu.com} \
-d ${UBUNTU_MIRROR_PROJECTS:-focal,focal-updates,focal-security,focal-backports} \
-a ${MIRROR_ARCHITECTURES} \
$SOURCEOPT \
-s ${MIRROR_CATEGORIES} \
-h ${UBUNTU_MIRROR_SOURCE} \
-d ${UBUNTU_MIRROR_PROJECTS} \
--ignore-small-errors \
-r /ubuntu \
--getcontents \