Commit 8130081d by Antonio Terceiro Committed by Stéphane Graber

lxc-debian: allow not including contrib/non-free

parent 415d3064
...@@ -157,13 +157,19 @@ write_sourceslist() ...@@ -157,13 +157,19 @@ write_sourceslist()
prefix="deb [arch=${arch}]" prefix="deb [arch=${arch}]"
fi fi
if [ "$mainonly" = 1 ]; then
non_main=''
else
non_main=' contrib non-free'
fi
cat >> "${rootfs}/etc/apt/sources.list" << EOF cat >> "${rootfs}/etc/apt/sources.list" << EOF
${prefix} $MIRROR ${release} main contrib non-free ${prefix} $MIRROR ${release} main${non_main}
EOF EOF
if [ "$release" != "unstable" -a "$release" != "sid" ]; then if [ "$release" != "unstable" -a "$release" != "sid" ]; then
cat >> "${rootfs}/etc/apt/sources.list" << EOF 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 EOF
fi fi
} }
...@@ -469,6 +475,7 @@ Options : ...@@ -469,6 +475,7 @@ Options :
--packages=PACKAGE_NAME1,PACKAGE_NAME2,... --packages=PACKAGE_NAME1,PACKAGE_NAME2,...
List of additional packages to install. Comma separated, without space. List of additional packages to install. Comma separated, without space.
-c, --clean only clean up the cache and terminate -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: Environment variables:
...@@ -481,7 +488,7 @@ EOF ...@@ -481,7 +488,7 @@ EOF
return 0 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 if [ $? -ne 0 ]; then
usage $(basename $0) usage $(basename $0)
exit 1 exit 1
...@@ -510,6 +517,7 @@ do ...@@ -510,6 +517,7 @@ do
-a|--arch) arch=$2; shift 2;; -a|--arch) arch=$2; shift 2;;
-c|--clean) clean=1; shift 1;; -c|--clean) clean=1; shift 1;;
--main-only) mainonly=1; shift 1;;
--mirror) MIRROR=$2; shift 2;; --mirror) MIRROR=$2; shift 2;;
-n|--name) name=$2; shift 2;; -n|--name) name=$2; shift 2;;
--packages) packages=$2; shift 2;; --packages) packages=$2; shift 2;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment