From: Antonio Terceiro Date: Wed, 19 Aug 2015 21:06:50 +0000 (+0200) Subject: lxc-debian: allow not including contrib/non-free X-Git-Tag: lxc-2.0.0.beta1~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2a85d043b35d82087b85f8bfb75ae578f3d9ac3;p=thirdparty%2Flxc.git lxc-debian: allow not including contrib/non-free Signed-off-by: Antonio Terceiro Acked-by: Serge E. Hallyn --- diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in index a6a17784c..7da0f700d 100644 --- a/templates/lxc-debian.in +++ b/templates/lxc-debian.in @@ -159,13 +159,19 @@ write_sourceslist() prefix="deb [arch=${arch}]" fi + if [ "$mainonly" = 1 ]; then + non_main='' + else + non_main=' contrib non-free' + fi + cat >> "${rootfs}/etc/apt/sources.list" << EOF -${prefix} $MIRROR ${release} main contrib non-free +${prefix} $MIRROR ${release} main${non_main} EOF if [ "$release" != "unstable" -a "$release" != "sid" ]; then cat >> "${rootfs}/etc/apt/sources.list" << EOF -${prefix} $SECURITY_MIRROR ${release}/updates main contrib non-free +${prefix} $SECURITY_MIRROR ${release}/updates main${non_main} EOF fi } @@ -471,6 +477,7 @@ Options : --packages=PACKAGE_NAME1,PACKAGE_NAME2,... List of additional packages to install. Comma separated, without space. -c, --clean only clean up the cache and terminate + --main-only include only Debian's main repository (i.e. no contrib and non-free). Environment variables: @@ -483,7 +490,7 @@ EOF return 0 } -options=$(getopt -o hp:n:a:r:c -l arch:,clean,help,mirror:,name:,packages:,path:,release:,rootfs:,security-mirror: -- "$@") +options=$(getopt -o hp:n:a:r:c -l arch:,clean,help,main-only,mirror:,name:,packages:,path:,release:,rootfs:,security-mirror: -- "$@") if [ $? -ne 0 ]; then usage $(basename $0) exit 1 @@ -512,6 +519,7 @@ do -a|--arch) arch=$2; shift 2;; -c|--clean) clean=1; shift 1;; + --main-only) mainonly=1; shift 1;; --mirror) MIRROR=$2; shift 2;; -n|--name) name=$2; shift 2;; --packages) packages=$2; shift 2;;