-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdpkg-wrapper.sh
More file actions
executable file
·50 lines (45 loc) · 945 Bytes
/
dpkg-wrapper.sh
File metadata and controls
executable file
·50 lines (45 loc) · 945 Bytes
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
set -eo pipefail
fatal() {
echo "$@" 1>&2
exit 1
}
# Make sure the environment contains sane configuration.
test -d "${DEBOCI_ROOTFS}" || \
fatal "\${DEBOCI_ROOTFS} must be a directory: ${DEBOCI_ROOTFS}"
# Parse the command line to figure out what we're supposed to do.
declare -a args
operation=
while test "$#" -ge 1; do
case "$1" in
--unpack|--configure)
operation="$1"
;;
--status-fd)
shift
;;
--*)
;;
*)
args+=("$1")
;;
esac
shift
done
case "${operation}" in
--unpack)
for debfile in "${args[@]}"; do
dpkg --extract "${debfile}" "${DEBOCI_ROOTFS}"
done
exit 0
;;
--configure)
# Ignore - package configuration scripts don't run properly
# outside a chroot but we're not privileged. Most packages work
# just fine even without getting configured, in particular
# since we don't require a working init system etc.
;;
*)
fatal "$0: Don't know what to do!"
;;
esac