C++ class for reading and writing XML structures. No need for a C++ code parser or special pre compiler. Specify a schema entirly in native C++. The schema is verified when XML is read and exceptions are thrown when the XML to be parse is invalid.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.9 KiB

9 years ago
#! /bin/bash -ex
## @id $Id$
## Resolve Debian Build Dependencies
## Installs all the required packages
## Call: ./resolve-debbuilddeps 'name of build schroot'
## e.g. call: ./resolve-debbuilddeps trusty_amd64
## 1 2 3 4 5 6 7 8
## 45678901234567890123456789012345678901234567890123456789012345678901234567890
SCHROOTNAME="$1"
if test -n "${SCHROOTNAME}"; then
DO="schroot -c "${SCHROOTNAME}" --"
SUDO="schroot -c "${SCHROOTNAME}" -u root -d / --"
else
DO=""
SUDO="sudo"
fi
9 years ago
function install() {
if ${SUDO} apt-get -y install $*; then
return 0
else
return 1
fi
}
TO_INSTALL=
if test -e debian/control.in -a ! -e debian/control; then
for f in $(sed -n 's, *AX_DEB_DEPEND_IFEXISTS(\([^)]*\)).*,\1,p' configure.ac); do
if test -n "$(${DO} apt-cache policy -q ${f})" && ! ${DO} dpkg -l "${f}"; then
TO_INSTALL+=" ${f}"
fi
done
trap "rm debian/control" INT TERM EXIT
sed 's,@DEB_DEPEND_IFEXISTS@,,g' debian/control.in | \
sed 's,@[^@]*@, dummytext,g' > debian/control
fi
9 years ago
install dpkg-dev
DEPS=$(${DO} dpkg-checkbuilddeps 2>&1 || true)
9 years ago
DEPS=$(echo "$DEPS" | sed -n '/Unmet build dependencies/ { s,.*Unmet build dependencies: ,,g; s, ([^)]*),,g; s, *| *,|,g; p}')
for pa in ${DEPS}; do
if test ${pa//|/} = ${pa}; then
TO_INSTALL+=" ${pa}"
continue;
fi
9 years ago
success=0
for p in ${pa//|/ }; do
if install ${TO_INSTALL} ${p}; then
TO_INSTALL+=" ${p}"
success=1
break
9 years ago
fi
done
if test ${success} -eq 0; then
echo "**** Error: Installation Failed: ${pa}"
exit 1
9 years ago
fi
done
if test -n "${TO_INSTALL}" && ! install ${TO_INSTALL}; then
echo "**** Error: Installation Failed: ${TO_INSTALL}"
exit 1
fi
9 years ago
echo "**** Success: All Dependencies Resolved"