|
|
@ -12,14 +12,28 @@ |
|
|
|
|
|
|
|
|
|
|
|
SCHROOTNAME="$1" |
|
|
|
SCHROOTNAME="$1" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function install() { |
|
|
|
|
|
|
|
if test -n "${SCHROOTNAME}"; then |
|
|
|
|
|
|
|
if schroot -c "${SCHROOTNAME}" -u root -d / -- apt-get -y install $*; then |
|
|
|
|
|
|
|
return 0 |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
if apt-get -y install $*; then |
|
|
|
|
|
|
|
return 0 |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if test -e debian/control.in -a ! -e debian/control; then |
|
|
|
if test -e debian/control.in -a ! -e debian/control; then |
|
|
|
sed 's,@[^@]*@, dummytext,g' debian/control.in > debian/control |
|
|
|
sed 's,@[^@]*@, dummytext,g' debian/control.in > debian/control |
|
|
|
trap "rm debian/control" INT TERM EXIT |
|
|
|
trap "rm debian/control" INT TERM EXIT |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if test -n "${SCHROOTNAME}"; then |
|
|
|
if test -n "${SCHROOTNAME}"; then |
|
|
|
|
|
|
|
schroot -c "${SCHROOTNAME}" -u root -d / -- apt-get -y install dpkg-dev |
|
|
|
DEPS=$(schroot -c "${SCHROOTNAME}" -- dpkg-checkbuilddeps 2>&1 || true) |
|
|
|
DEPS=$(schroot -c "${SCHROOTNAME}" -- dpkg-checkbuilddeps 2>&1 || true) |
|
|
|
else |
|
|
|
else |
|
|
|
|
|
|
|
apt-get -y install dpkg-dev |
|
|
|
DEPS=$(dpkg-checkbuilddeps 2>&1 || true) |
|
|
|
DEPS=$(dpkg-checkbuilddeps 2>&1 || true) |
|
|
|
fi |
|
|
|
fi |
|
|
|
DEPS=$(echo "$DEPS" | sed -n '/Unmet build dependencies/ { s,.*Unmet build dependencies: ,,g; s, ([^)]*),,g; s, *| *,|,g; p}') |
|
|
|
DEPS=$(echo "$DEPS" | sed -n '/Unmet build dependencies/ { s,.*Unmet build dependencies: ,,g; s, ([^)]*),,g; s, *| *,|,g; p}') |
|
|
@ -32,16 +46,10 @@ for pa in ${DEPS}; do |
|
|
|
fi |
|
|
|
fi |
|
|
|
success=0 |
|
|
|
success=0 |
|
|
|
for p in ${pa//|/ }; do |
|
|
|
for p in ${pa//|/ }; do |
|
|
|
if test -n "${SCHROOTNAME}"; then |
|
|
|
if install ${TO_INSTALL} ${p}; then |
|
|
|
if schroot -c "${SCHROOTNAME}" -u root -d / -- apt-get -y install ${p}; then |
|
|
|
TO_INSTALL+=" ${p}" |
|
|
|
success=1 |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
if apt-get -y install ${p}; then |
|
|
|
|
|
|
|
success=1 |
|
|
|
success=1 |
|
|
|
break; |
|
|
|
break |
|
|
|
fi |
|
|
|
|
|
|
|
fi |
|
|
|
fi |
|
|
|
done |
|
|
|
done |
|
|
|
if test ${success} -eq 0; then |
|
|
|
if test ${success} -eq 0; then |
|
|
@ -50,18 +58,8 @@ for pa in ${DEPS}; do |
|
|
|
fi |
|
|
|
fi |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
success=0 |
|
|
|
if test -n "${TO_INSTALL}" && ! install ${TO_INSTALL}; then |
|
|
|
if test -n "${SCHROOTNAME}"; then |
|
|
|
echo "**** Error: Installation Failed: ${TO_INSTALL}" |
|
|
|
if schroot -c "${SCHROOTNAME}" -u root -d / -- apt-get -y install ${TO_INSTALL}; then |
|
|
|
|
|
|
|
success=1 |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
if apt-get -y install ${TO_INSTALL}; then |
|
|
|
|
|
|
|
success=1 |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
if test ${success} -eq 0; then |
|
|
|
|
|
|
|
echo "**** Error: Installation Failed: ${pa}" |
|
|
|
|
|
|
|
exit 1 |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|