File: mmdebstrap

package info (click to toggle)
dash 0.5.12-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,148 kB
  • sloc: ansic: 13,410; sh: 1,414; makefile: 78; perl: 36
file content (29 lines) | stat: -rwxr-xr-x 1,414 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
#
# Copyright 2022 Johannes Schauer Marin Rodrigues <josch@debian.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.

set -eux

# This test is to prevent bugs like https://bugs.debian.org/1006771

VERSION="$(dpkg-parsechangelog -SVersion)"
apt-cache show "dash=$VERSION" >/dev/null || exit 1

# We cannot use debootstrap because debootstrap cannot install from multiple
# mirrors. Since dash is Essential:yes it does not test the right thing if we
# first install with dash from unstable and then upgrade to dash from salsaci.
mmdebstrap --debug --variant=essential \
	--hook-dir=/usr/share/mmdebstrap/hooks/copy-host-apt-sources-and-preferences \
	--hook-dir=/usr/share/mmdebstrap/hooks/file-mirror-automount \
	--customize-hook='chroot "$1" dpkg-query --showformat "\${Status} \${Version}\n" --show dash | grep "^install ok installed '"$VERSION"'"' \
	'' /dev/null ''