File: schroot-dev-build.sh

package info (click to toggle)
lava 2019.01-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 24,200 kB
  • sloc: python: 57,974; sh: 1,113; makefile: 329
file content (65 lines) | stat: -rwxr-xr-x 1,676 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh

set -e

if [ -z "$3" ]; then
	echo "Usage: <package> <chroot> <suite>"
	echo "A suitable schroot must already have been prepared"
	echo "and the Debian unstable LAVA dependencies made available"
	echo "inside that chroot."
	exit 1
fi

chroot=$2
suite=$3
PWD=`pwd`
NAME=${1}
if [ -x ./version.py ]; then
  VERSION=`python ./version.py`
else
  VERSION=`python setup.py --version`
fi
if [ -d './dist/' ]; then
    rm -f ./dist/*
fi
python setup.py sdist
if [ -d .git ]; then
  LOG=`git log -n1 --pretty=format:"Last change %h by %an, %ar. %s%n" --no-merges`
fi
DIR=`mktemp -d`
if [ -f './dist/${NAME}-${VERSION}.tar.gz' ]; then
  mv -v ./dist/${NAME}-${VERSION}.tar.gz ${DIR}/${NAME}_${VERSION}.orig.tar.gz
else
  echo "WARNING: broken setuptools tarball - Debian bug #786977"
  mv -v ./dist/${NAME}*.tar.gz ${DIR}/${NAME}_${VERSION}.orig.tar.gz
fi
cd ${DIR}
git clone https://github.com/Linaro/pkg-${NAME}.git
tar -xzf ${NAME}_${VERSION}.orig.tar.gz
if [ ! -d ${DIR}/${NAME}-${VERSION} ]; then
  mv -v ${DIR}/${NAME}-* ${DIR}/${NAME}-${VERSION}
fi
cd ${DIR}/pkg-${NAME}/
dpkg-checkbuilddeps
git archive master debian | tar -x -C ../${NAME}-${VERSION}
cd ${DIR}/${NAME}-${VERSION}
dch --force-distribution -v ${VERSION}-1 -D ${suite} "Local developer build"
if [ -n "${LOG}" ]; then
  dch -a ${LOG}
fi
sbuild -A -s -c ${chroot} -d ${suite}
cd ${DIR}
rm -rf ${DIR}/pkg-${NAME}
rm -rf ${DIR}/${NAME}-${VERSION}
echo
echo ${LOG}
echo
echo Use "zless /usr/share/doc/${NAME}/changelog.Debian.gz"
echo to view the changelog, once packages are installed.
echo
if [ -x /usr/bin/dcmd ]; then
    dcmd ls ${DIR}/${NAME}_${VERSION}*.changes
else
    echo ${DIR}
    ls ${DIR}
fi