parent
b1d7d4bd2c
commit
5ff3469888
4 changed files with 170 additions and 30 deletions
@ -0,0 +1,45 @@ |
||||
#! /bin/bash -ex |
||||
|
||||
## @id $Id$ |
||||
|
||||
## Resolve Debian Build Dependencies |
||||
## Installs all the required packages |
||||
## Call: ./resolve-builddeps 'name of build schroot' |
||||
## e.g. call: ./resolve-builddeps trusty_amd64 |
||||
|
||||
## 1 2 3 4 5 6 7 8 |
||||
## 45678901234567890123456789012345678901234567890123456789012345678901234567890 |
||||
|
||||
SCHROOTNAME="$1" |
||||
|
||||
svn update || true |
||||
./bootstrap -c |
||||
|
||||
if test -n "${SCHROOTNAME}"; then |
||||
DEPS=$(schroot -c "${SCHROOTNAME}" -- dpkg-checkbuilddeps 2>&1) |
||||
else |
||||
DEPS=$(dpkg-checkbuilddeps 2>&1) |
||||
fi |
||||
DEPS=$(echo "$DEPS" | | sed -n '/Unmet build dependencies/ { s,.*Unmet build dependencies: ,,g; s, ([^)]*),,g; s, *| *,|,g; p}') |
||||
|
||||
for pa in ${DEPS}; do |
||||
success=0 |
||||
for p in $(echo "${pa}" | sed 's,|, ,g'); do |
||||
if test -n "${SCHROOTNAME}"; then |
||||
if schroot -c "${SCHROOTNAME}" -u root -d / -- apt-get -y install ${p}; then |
||||
success=1 |
||||
break; |
||||
fi |
||||
else |
||||
if sudo apt-get -y install ${p}; then |
||||
success=1 |
||||
break; |
||||
fi |
||||
fi |
||||
done |
||||
if test ${success} -eq 0; then |
||||
echo "**** Error: Installation Failed: ${pa}" |
||||
fi |
||||
done |
||||
|
||||
echo "**** Success: All Dependencies Resolved" |
Loading…
Reference in new issue