#!/bin/sh -e if [ "x$1" != "x" ]; then source=$1 fi DEB_HOST_ARCH=`dpkg-architecture -qDEB_HOST_ARCH` if [ "x$arch" = "x"]; then arch=$DEB_HOST_ARCH fi echo "arch: $arch" echo "source: $source" sudo rm -f *.changes sudo rm -f /etc/apt/sources.list.d/local.list rm -rf repo && mkdir repo/ ( cd repo dget --insecure -d -u $source dpkg-scansources . /dev/null > Sources.gz echo "deb-src file:$(pwd) /" > local.list sudo cp local.list /etc/apt/sources.list.d/ ) localdsc=`echo $source|sed -e "s,.*/,$(pwd)/repo/,"` if grep ubuntu.com /etc/apt/sources.list; then if ! grep universe /etc/apt/sources.list; then echo "added universe to sources.list" sudo sed -i -e 's,main,main universe,' /etc/apt/sources.list fi fi sudo apt-get update if [ -z $arch ]; then arch=$DEB_HOST_ARCH fi if [ $DEB_HOST_ARCH = $arch ]; then ./ubuntu-packaging-tools/docker-nativebuild $localdsc $arch else ./ubuntu-packaging-tools/docker-crossbuild $localdsc $arch fi change=`echo *changes` if [ ! -r $change ] then echo "no changes file" exit 1 fi cat > post_build_ppa_parameters << EOF pkg_job_name=${JOB_NAME} key_id=B86C70FE pkg_changes=${change} host_ppa=linaro-overlay EOF ls -la .