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

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



Hi Holger,

Quoting Holger Levsen (2014-12-23 01:03:12)
> thanks for your bug report with patch. I've picked your commits and added
> some, and now there is an almost working job at
> 
> http://anonscm.debian.org/cgit/qa/jenkins.debian.net.git

thanks a lot!

Please find attached a git format-patch to use python-arpy instead of dpkg
until Jessie is released.

Thanks!

cheers, josch
From dfe27a874ba92fe872a6e1aed6305af2474a86f4 Mon Sep 17 00:00:00 2001
From: josch <j.schauer@email.de>
Date: Thu, 25 Dec 2014 15:36:52 +0100
Subject: [PATCH] Temporary ugly hack until Jenkins runs Debian Jessie

 - workaround for `dpkg-deb --ctrl-tarfile /dev/stdin` not being
   available in Wheezy
 - Python arpy was the only implementation I found which allows to read
   an ar archive from standard input without a filename (thus preserving
   the ability to quit a package download early)
 - since tar cannot transparently decompress content from standard
   input (bug #773912), this has to be done in Python, too
 - this is also ugly because Python does not work well for oneliners
 - please revert this commit as soon as Jenkins run Jessie because dpkg
   is also faster than Python arpy
---
 bin/find_dpkg_trigger_cycles.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/find_dpkg_trigger_cycles.sh b/bin/find_dpkg_trigger_cycles.sh
index d0c9afb..09a7545 100755
--- a/bin/find_dpkg_trigger_cycles.sh
+++ b/bin/find_dpkg_trigger_cycles.sh
@@ -157,7 +157,7 @@ curl "http://binarycontrol.debian.net/?q=&path=%2Ftriggers%24&format=pkglist"; \
 	echo "working on $pkg..." >&2
 	mkdir DEBIAN
 	curl --retry 2 --location --silent "$url" \
-		| dpkg-deb --ctrl-tarfile /dev/stdin \
+		| 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")' \
 		| tar -C "DEBIAN" --exclude=./md5sums -x
 	if [ ! -f DEBIAN/triggers ]; then
 		rm -r DEBIAN
-- 
2.0.1


Reply to: