[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#773253: jenkins: please add script to detect dpkg trigger cycles



Hi,

I made a number of modifications to jenkins but I fail to run bin/chroot-run.sh
locally by itself. So I gave up.

Instead, I created a Jessie chroot, copied Jenkins inside it and ran
bin/find_dpkg_trigger_cycles.sh to test.

The attached patch installs apt-file and dose-extra as the two additional
dependencies I had to install for the find_dpkg_trigger_cycles script.

Since this is running in Jessie, I also removed the python-arpy hack and rely
on dpkg instead.

Since I could not test this locally, I didn't touch job-cfg/dpkg.yaml, so this
still has to be done.

One remaining problem could be that there might be no /dev/stdin inside the
chroot.  If this is the case, then we still have to use python-arpy or somehow
mount /dev and /proc (or only /proc and read from /proc/self/fd/0 instead).
This is until bug #616614 is fixed.

Thanks!

cheers, josch
From 7cc8471d3065e7eaba0bed371ecb5325b4977023 Mon Sep 17 00:00:00 2001
From: josch <j.schauer@email.de>
Date: Wed, 31 Dec 2014 09:21:13 +0100
Subject: [PATCH] find_dpkg_trigger_cycles: prepare for being run inside a
 jessie chroot

 - chroot is required because dose-ceve version in wheezy is too old
 - in addition, with jessie the python-arpy hack can be dropped because
   of too old dpkg version in wheezy
---
 bin/find_dpkg_trigger_cycles.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/bin/find_dpkg_trigger_cycles.sh b/bin/find_dpkg_trigger_cycles.sh
index a232f19..c6a8cc5 100755
--- a/bin/find_dpkg_trigger_cycles.sh
+++ b/bin/find_dpkg_trigger_cycles.sh
@@ -100,6 +100,9 @@ DEBUG=false
 . /srv/jenkins/bin/common-functions.sh
 common_init "$@"
 
+# setup dependencies to run this job
+apt-get install -y --no-install-recommends apt-file dose-extra
+
 ARCH="amd64"
 DIST="$1"
 DIRECTORY="`pwd`/debian-$DIST-$ARCH"
@@ -156,10 +159,8 @@ curl "http://binarycontrol.debian.net/?q=&path=%2Ftriggers%24&format=pkglist"; \
 	| while read pkg url; do
 	echo "working on $pkg..." >&2
 	tmpdir=`mktemp -d`
-	# FIXME: please revert 9280f1c87 and following as soon as Jenkins run Jessie
-	# this is about the next line:
 	curl --retry 2 --location --silent "$url" \
-		| python -c 'exec("import arpy,sys,gzip,bz2,lzma,StringIO\nar=arpy.Archive(fileobj=sys.stdin)\nfor f in ar:\n\tif f.header.name == \"control.tar.gz\":\n\t\tsys.stdout.write(gzip.GzipFile(fileobj=StringIO.StringIO(f.read())).read())\n\t\tbreak\n\telif f.header.name == \"control.tar\":\n\t\tsys.stdout.write(f.read())\n\t\tbreak\n\telif f.header.name == \"control.tar.bz2\":\n\t\tsys.stdout.write(bz2.BZ2File(fileobj=StringIO.StringIO(f.read())).read())\n\t\tbreak\n\telif f.header.name == \"control.tar.xz\":\n\t\tsys.stdout.write(lzma.LZMAFile(fileobj=StringIO.StringIO(f.read())).read())\n\t\tbreak")' \
+		| dpkg-deb --ctrl-tarfile /dev/stdin \
 		| tar -C "$tmpdir" --exclude=./md5sums -x
 	if [ ! -f "$tmpdir/triggers" ]; then
 		rm -r "$tmpdir"
-- 
2.0.1


Reply to: