[--dsc=dscfile]
[--dist=distribution]
[--arch=architecture]
+ [--home=home]
+
+This script is should be called with root privilege. It is meant to be
+called by id-pbuild.sh.
EOF
exit $1
}
--dsc=*)
dsc=$optarg
;;
+ --home=*)
+ HOME=$optarg
+ ;;
-*)
- do_help=yes
+ usage 1
;;
esac
shift
PBUILDER=/usr/sbin/pbuilder
+if test -z "$dist" -o -z "$arch"; then
+ echo "dist and arch must be given"
+ usage 1
+fi
rm -fr ${dist}-${arch}
+if test ! -f $HOME/.pbuilderrc; then
+ echo "$HOME/.pbuilderrc missing"
+ exit 1
+fi
if test "$dsc"; then
if test ! -f /var/cache/pbuilder/${dist}-${arch}-base.tgz; then
DIST=$dist ARCH=$arch $PBUILDER --create
echo "Dsc $PKG . Product $PRODUCT"
echo "Ubuntu distros: $UBUNTU_DIST"
echo "Debian distros: $DEBIAN_DIST"
+if test "${SUDO_USER}"; then
+ echo "Running as sudo."
+ echo "You can avoid it by adding the following in /etc/sudoers"
+ echo "${SUDO_USER} ALL=NOPASSWD: /home/${SUDO_USER}/proj/git-tools/id-deb-build/id-pbuild-root.sh"
+ HOME_EXPORT=/home/${SUDO_USER}
+else
+ HOME_EXPORT=$HOME
+fi
+if test ! -f ${HOME_EXPORT}/.pbuilderrc; then
+ echo "${HOME_EXPORT}/.pbuilderrc missing"
+ exit 1
+fi
+
if $upload; then
for dist in ${UBUNTU_DIST}; do
scp ${dist}-*/* ftp.indexdata.dk:/home/ftp/pub/${PRODUCT}/ubuntu/${dist}
# call our privileged wrapper to clean the directories, no --dsc option
for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do
for arch in ${USE_ARCHS}; do
- sudo -n $PBUILDROOT --dist=$dist --arch=$arch
+ sudo -n $PBUILDROOT --home=${HOME_EXPORT} --dist=$dist --arch=$arch
done
done
date
for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do
for arch in ${USE_ARCHS}; do
- sudo -n $PBUILDROOT \
+ sudo -n $PBUILDROOT --home=${HOME_EXPORT} \
--dist=$dist --arch=$arch --dsc=$PKG >${dist}-${arch}.log 2>&1 &
i=`expr $i + 1`
if test $i -eq $concurrency; then