[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#868678: autopkgtest: Support Kali in setup-testbed

Package: autopkgtest
Version: 4.4
Severity: wishlist
Tags: patch
User: devel at kali.org
Usertags: origin-kali kali-patch

/usr/share/autopkgtest/setup-commands/setup-testbed rewrites
/etc/apt/sources.list in a way that only works with mirrors whose URL
contains "ubuntu" or "debian".

I would like the script to also work for Kali so I propose the following

--- /usr/share/autopkgtest/setup-commands/setup-testbed	2017-04-30 19:09:57.000000000 +0200
+++ /home/rhertzog/tmp/setup-testbed	2017-07-17 16:36:23.615997961 +0200
@@ -122,21 +122,21 @@
 # set up apt sources
 if [ -z "${MIRROR:-}" ]; then
-    MIRROR=`awk '/^deb .*(debian|ubuntu)/ { sub(/\[.*\]/, "", $0); print $2; exit }' "$root/etc/apt/sources.list"`
+    MIRROR=`awk '/^deb .*(debian|ubuntu|kali)/ { sub(/\[.*\]/, "", $0); print $2; exit }' "$root/etc/apt/sources.list"`
 if [ -z "${RELEASE:-}" ]; then
-    RELEASE=`awk '/^deb .*(debian|ubuntu)/ { sub(/\[.*\]/, "", $0); print $3; exit }' "$root/etc/apt/sources.list"`
+    RELEASE=`awk '/^deb .*(debian|ubuntu|kali)/ { sub(/\[.*\]/, "", $0); print $3; exit }' "$root/etc/apt/sources.list"`
 if [ "${MIRROR%ubuntu*}" != "$MIRROR" ]; then
     cat << EOF > "$root/etc/apt/sources.list"

But it should probably also be smarter for the benefits of all other derivatives:

- not do anything if $MIRROR or $RELEASE is empty

- rely on /etc/os-release (within the image) to identify the distribution and
  use the first entry in /etc/apt/sources.list to find the mirror to use (that
  way you can have a mirror like and still have a
  working setup-testbed even if your ubuntu mirror does not contain the string


-- System Information:
Debian Release: buster/sid
  APT prefers oldoldstable
  APT policy: (500, 'oldoldstable'), (500, 'unstable'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages autopkgtest depends on:
ii  apt-utils       1.5~beta1
ii  libdpkg-perl    1.18.24
ii  procps          2:3.3.12-3
ii  python3         3.5.3-3
ii  python3-debian  0.1.30

Versions of packages autopkgtest recommends:
ii  autodep8  0.9

Versions of packages autopkgtest suggests:
pn  lxc          <none>
pn  lxd-client   <none>
pn  qemu-system  <none>
ii  qemu-utils   1:2.8+dfsg-6
ii  schroot      1.6.10-4

-- no debconf information

Reply to: