Skip to content

Commit 2f47187

Browse files
committed
Add support for virtual packages; drop -x
Signed-off-by: Loïc Minier <[email protected]>
1 parent 9003ee2 commit 2f47187

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

scripts/build-u-boot-rb1.sh

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
set -eux
3+
set -eu
44

55
GIT_REPO="https:////github.com/b49020/u-boot"
66
GIT_BRANCH="qcom-mainline"
@@ -23,18 +23,35 @@ fatal() {
2323
packages="git"
2424
# will pull gcc-aarch64-linux-gnu; should pull a native compiler on arm64 and
2525
# a cross-compiler on other architectures
26-
packages="$packages crossbuild-essential-arm64"
26+
packages="${packages} crossbuild-essential-arm64"
2727
# u-boot build-dependencies
28-
packages="$packages make bison flex bc libssl-dev gnutls-dev"
28+
packages="${packages} make bison flex bc libssl-dev gnutls-dev"
2929
# needed to pack resulting u-boot binary into an Android boot image
30-
packages="$packages gzip mkbootimg"
30+
packages="${packages} gzip mkbootimg"
3131

3232
log_i "Checking build-dependencies ($packages)"
3333
missing=""
34-
for pkg in $packages; do
35-
if ! dpkg -l "${pkg}" 2>&1 | grep -q "^ii ${pkg}"; then
36-
missing="${missing} ${pkg}"
34+
for pkg in ${packages}; do
35+
# check if package with this name is installed
36+
if dpkg -l "${pkg}" 2>&1 | grep -q "^ii ${pkg}"; then
37+
continue
3738
fi
39+
# otherwise, check if it's a virtual package and if some package providing
40+
# it is installed
41+
providers="$(apt-cache showpkg "${pkg}" |
42+
sed -e '1,/^Reverse Provides: *$/ d' -e 's/ .*$//' |
43+
sort -u)"
44+
provider_found="no"
45+
for provider in ${providers}; do
46+
if dpkg -l "${provider}" 2>&1 | grep -q "^ii ${provider}"; then
47+
provider_found="yes"
48+
break
49+
fi
50+
done
51+
if [ "${provider_found}" = yes ]; then
52+
continue
53+
fi
54+
missing="${missing} ${pkg}"
3855
done
3956
if [ -n "${missing}" ]; then
4057
fatal "Missing build-dependencies: ${missing}"

0 commit comments

Comments
 (0)