From patchwork Mon Jul 17 14:48:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 107993 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp4689162obm; Mon, 17 Jul 2017 08:15:41 -0700 (PDT) X-Received: by 10.55.113.197 with SMTP id m188mr25969481qkc.227.1500304541345; Mon, 17 Jul 2017 08:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500304541; cv=none; d=google.com; s=arc-20160816; b=z87+iOzEkhbQCs5Szq2M8rTMR5XyTQz7rAZKKQx/JdTnzNBBFzUICRlxwbMY9tMnt1 5r+VqfmrPLyluxNxNCHAFrqUA5bMDAiernL2bgos97HHZIaPoKS8Nz4OMwWlmuxeujQU PWVrBCw2OsC3rn1OVXERFOYaIP2Q6HaZut2tmVfRTeYcibLqDCuXVlbwQ4Mls3qOSDwd MtvYh04PvszJ1zKu8hwZuvKzx091QNEfYLHNdGsfyyJOKiu4aW+d+cq2tKkciKFwXMBk Pb8RY9NyUhv0Xo3av7wBCEoXe3DjdQNv+aKAWkAUhgNzsSiCL/bJQuT8hNG+qNfTTgxO u0ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=TxjIaXgJB51VMqenk6t7EypcCEkSUKlFKOuqQKiB9v0=; b=fNfMHwMmA+xfx76Ru7H09xNSvNwESGeNRWxDrWWV7slqBo2gB34uh8Sr5FXTCUZHl5 R4QChFFSszHKTmbDlLKjt26aZq0GFEGvQ/POxs4DLrlIesD82wjpkpgZ7R1d6ygSVlm9 AV7qcpCJWTRKycnQQlaupDMaUFLZjekNufNqREN0iJgAibwtijrjC9Lbvub6XnnKK9fK T4DTliPVXC0Rd1n4hIsFO8jPYVU5KeHlf6ak3mtCNmvEf3MGimD81iE6damFZZPxWDMY HlzdP0orZjSWcvMlbyugBDxVeFLkv7dk2Ajgi5+u81FJ4KlIc5kcUWvC3OhpzDVjnGYc GLWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.b=Outg0RP2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k22si15478658qtc.368.2017.07.17.08.15.40 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 17 Jul 2017 08:15:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.b=Outg0RP2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX7kI-0004Pk-NH for patch@linaro.org; Mon, 17 Jul 2017 11:15:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX7Sk-0005fQ-LB for qemu-devel@nongnu.org; Mon, 17 Jul 2017 10:57:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dX7Si-0005wf-EO for qemu-devel@nongnu.org; Mon, 17 Jul 2017 10:57:30 -0400 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:37214) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dX7Si-0005wP-75 for qemu-devel@nongnu.org; Mon, 17 Jul 2017 10:57:28 -0400 Received: by mail-wm0-x235.google.com with SMTP id b134so50934164wma.0 for ; Mon, 17 Jul 2017 07:57:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TxjIaXgJB51VMqenk6t7EypcCEkSUKlFKOuqQKiB9v0=; b=Outg0RP2K3h/rKFgx1PV9jJnKFmfk+gwCW3uTF6xWV1DJ/Yx/eLF7kvdDki/QsJHas VPkNojRU1vQiFe71UxYT2czPcXBSoHENoLwjy0Kbg4Des9FKMIMl3w2y5JeYQ2U+I/yX ztIoYWiPqqKkh77JPVsCoNt6nTN39NTmVEZ1c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TxjIaXgJB51VMqenk6t7EypcCEkSUKlFKOuqQKiB9v0=; b=En6HFKfusGJM/ijj6Bwp4LZZhymnAekwRSSAuImZxNZ/Ib54ChqYNmoUcyjSjZ2Jl2 XRnua/7FMHu7iB/qcbTu9QI1HCVESuCpgkMMiIPpfodmIinMTnqjBdhDMI6mgOMYoXhe egDar0jqwIeB9yM6M0mreHh4tjAggBOL2rCQZCdQvuTpCERTLeST5zL0fbLPakCXk9tb PDZ5i46QDW4Lnq/+Xa/41KYDMYZjm7neSWRuXgmlDfRTpWzSZj2QJIg41RUzwUdmP9ck gLRWbMd38dt9hG3hxvh2FIBsdkBfxQHE7oNBKNIqMhST752Iwv0iFQE5kxvySkHWHMml JTJg== X-Gm-Message-State: AIVw113Yk2B39/ADEITvrWicOG2i03jYgr9bSDnvgeqEiaKCssJhD/Ln Sr+NP0aJfcYKS3jI X-Received: by 10.28.129.203 with SMTP id c194mr4803946wmd.120.1500303446979; Mon, 17 Jul 2017 07:57:26 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 32sm20703982wry.31.2017.07.17.07.57.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2017 07:57:23 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id C78863E0703; Mon, 17 Jul 2017 15:48:49 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 17 Jul 2017 15:48:45 +0100 Message-Id: <20170717144848.11793-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170717144848.11793-1-alex.bennee@linaro.org> References: <20170717144848.11793-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::235 Subject: [Qemu-devel] [PATCH v1 20/23] docker: add 'apt-fake' script which generate fake debian packages X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée --- tests/docker/dockerfiles/debian-apt-fake.sh | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 tests/docker/dockerfiles/debian-apt-fake.sh -- 2.13.0 diff --git a/tests/docker/dockerfiles/debian-apt-fake.sh b/tests/docker/dockerfiles/debian-apt-fake.sh new file mode 100755 index 0000000000..387522c174 --- /dev/null +++ b/tests/docker/dockerfiles/debian-apt-fake.sh @@ -0,0 +1,46 @@ +#! /bin/sh +# +# Generate fake debian package to resolve unimportant unmet dependencies held +# by upstream multiarch broken packages. +# +# Copyright (c) 2017 Philippe Mathieu-Daudé +# +# This work is licensed under the terms of the GNU GPL, version 2 +# or (at your option) any later version. See the COPYING file in +# the top-level directory. + +test $1 = "install" && shift 1 + +fake_install() +{ + echo "Generating fake $2 $1 $3 ..." + (cd /var/cache/apt/archives + (cat << 'EOF' +Section: misc +Priority: optional +Standards-Version: 3.9.2 + +Package: NAME +Version: VERSION +Maintainer: qemu-devel@nongnu.org +Architecture: any +Multi-Arch: same +Description: fake NAME +EOF + ) | sed s/NAME/$2/g | sed s/VERSION/$3/g > $2.control + equivs-build -a $1 $2.control 1>/dev/null 2>/dev/null + dpkg -i $2_$3_$1.deb + ) +} + +try_install() +{ + name=$(echo $1|sed "s/\(.*\):\(.*\)=\(.*\)/\1/") + arch=$(echo $1|sed "s/\(.*\):\(.*\)=\(.*\)/\2/") + vers=$(echo $1|sed "s/\(.*\):\(.*\)=\(.*\)/\3/") + apt-get install -q -yy $1 || fake_install $arch $name $vers +} + +for package in $*; do + try_install $package +done