Debian Codegraph @

debian/tests/mmdebstrap

raw
1 #!/bin/sh
2 #
3 # Copyright 2022 Johannes Schauer Marin Rodrigues <[email protected]>
4 #
5 # Permission is hereby granted, free of charge, to any person obtaining a copy
6 # of this software and associated documentation files (the "Software"), to deal
7 # in the Software without restriction, including without limitation the rights
8 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 # copies of the Software, and to permit persons to whom the Software is
10 # furnished to do so, subject to the following conditions:
11 #
12 # The above copyright notice and this permission notice shall be included in all
13 # copies or substantial portions of the Software.
14
15 set -eux
16
17 # This test is to prevent bugs like https://bugs.debian.org/1006771
18
19 VERSION="$(dpkg-parsechangelog -SVersion)"
20 apt-cache show "dash=$VERSION" >/dev/null || exit 1
21
22 # We cannot use debootstrap because debootstrap cannot install from multiple
23 # mirrors. Since dash is Essential:yes it does not test the right thing if we
24 # first install with dash from unstable and then upgrade to dash from salsaci.
25 mmdebstrap --debug --variant=essential \
26 --hook-dir=/usr/share/mmdebstrap/hooks/copy-host-apt-sources-and-preferences \
27 --hook-dir=/usr/share/mmdebstrap/hooks/file-mirror-automount \
28 --customize-hook='chroot "$1" dpkg-query --showformat "\${Status} \${Version}\n" --show dash | grep "^install ok installed '"$VERSION"'"' \
29 '' /dev/null ''