From patchwork Mon Dec 16 20:46:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov via arch-projects X-Patchwork-Id: 1410 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 473D015AF8BEE for ; Mon, 16 Dec 2019 20:46:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1, MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001, T_DMARC_POLICY_NONE=0.01 autolearn=ham autolearn_force=no version=3.4.3 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Mon, 16 Dec 2019 20:46:40 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 1E79717468DACC; Mon, 16 Dec 2019 20:46:34 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id F297017468DACA; Mon, 16 Dec 2019 20:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1576529194; bh=m/kPXoGlMXOqZ0K0ob6+WWJhvg3qpXPX2yRiezOQAjk=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc; b=L3JUdlNIT1yu93ngI9iuQYjly83xN1tuB5DcyJfeeWOIumAnGdm19SXNhPjKAllNf w6CdMKQSBAGJnxkwaWWtExliBB08sUHMXSJVWpMcTrLQoPSY9qbysj8+unphRzFxwC tg4hmqV+p0RBBHKgEL172+HbbR7S/5l+LCdu8UhpRYHjijQB8h6uysaUMD6Gzz91O2 OqUdJkywkGwyYkfDdpnulH6Ym2wlR4N5jqtMwccHlPPrv5U6AvL6B4O2IH5+Vmsz1t +687Zhzm/yOLlF/EMuK8C4+TLBV33u5+BspfoB22ry8dALSV22ob9kbZwRRmRHOgMJ qSWFtTYQeM+JSgzenbna6BEdaQX5RRkl+c7teIaB2KSvsb5uNEx4doPdHjWvXqp/wr H40d+Km/wGHahMWWVUY9Hl/QGLJ45SjP4V74vbzX1dm/CO4dIm0ygF/MMEeDUHeB79 bU/L6ddnF9vw680jSvnSim/v9KGW+v3qxpKY9x+5g+jSwDuGL//FO6/Pc5FCOjTV7G nWa93zZy9FCKkuOwe1o2DgmkCMB1dPXXligia7v8aej+CrcYBdw0RgF7O5/yqFIJW4 4nsw04Ze9DQdUNc7pfj7LnX0/mYbVr3kS50ihMb7VrHRCghfngoaAbw57k+3tJqatC KbH3Kf8SFYOGq/9lKT3Gr4lI= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id BD2292B78C; Mon, 16 Dec 2019 20:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1576529193; bh=m/kPXoGlMXOqZ0K0ob6+WWJhvg3qpXPX2yRiezOQAjk=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc; b=oOqDv8q3smGKyiVY2uc6X5FB+gHNClbTW/UB45/AfL760bDjotrTmbIw+o4JI54lO HVaWOZhUVlz1JVHTaxLWbdSOpcIRfca70ZSo1+d4dQyRVj7tmWMKZg3qCAg5N+u0g3 aL2GpvER6KE4vVQkD0kuNeCGHNLTPpSS97RmLhTVGy5qc9Di4FmDUnSbTCJW7EI+lJ fG3Fx45diR7BlMfi9VEzRj8Ry/KbZ/kBhMKm5IY3/Ds5RVmld1jLG4rdYtdbsp/kHP bnX+dzzFzcZHTHM4HWmrMJEQhvjJfkyGqinH2rMFwoR5WG95rdW0MYyDDL3L339Yc9 C67YU755JOLhuzAsfJ7WYV88n3MbpcE4SGRGglZV43yKUy0lEpY8I/viXmzX4G0aXk 4KyXf5DFaB4OOjeosKESeZS37dghdfCfMYr8rOoZ3kZrJDO1qw5TjUK5RexXbv9pdn 5bWnFXrGedLj7aUvoj+yzwd0sjtLjc/euQ2qTCyQq6uh/LQOxyMH1UBig/Jba3upvf SlJXzuENRgWfX7oYJNHSHi5hZlxWetR9gmS/MbaSegrlKgiPGbSN8ytusMw0q0tEFd D4CXzOTNs2zf8UDqz06NZv3NTHmbyf6c/c2sBmmo1nwj2RYlLzr4Kl6eCsNr/Dyb9K pyBb1E7cgrNbUnwiEVY79168= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 1ABFD2B789 for ; Mon, 16 Dec 2019 20:46:30 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Mon, 16 Dec 2019 20:46:30 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id F25EF17468DABA; Mon, 16 Dec 2019 20:46:28 +0000 (UTC) Received: from didactylos.attlocal.net (unknown [IPv6:2600:1700:57f0:ca20:763a:c795:fcf6:91ea]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: eschwartz) by orion.archlinux.org (Postfix) with ESMTPSA id 6CEBB17468DAB9; Mon, 16 Dec 2019 20:46:28 +0000 (UTC) To: arch-projects@archlinux.org Date: Mon, 16 Dec 2019 15:46:07 -0500 Message-Id: <20191216204609.111647-2-eschwartz@archlinux.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216204609.111647-1-eschwartz@archlinux.org> References: <20191216204609.111647-1-eschwartz@archlinux.org> MIME-Version: 1.0 Subject: [arch-projects] [devtools] [PATCH 1/3] makerepropkg: fix wonky indent X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Arch Linux projects development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Eli Schwartz via arch-projects Reply-To: Arch Linux projects development discussion Cc: Eli Schwartz Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" Signed-off-by: Eli Schwartz --- makerepropkg.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/makerepropkg.in b/makerepropkg.in index 710f3ca..2b0945e 100755 --- a/makerepropkg.in +++ b/makerepropkg.in @@ -101,12 +101,12 @@ __EOF__ } while getopts 'M:c:h' arg; do - case "$arg" in - M) archroot_args+=(-M "$OPTARG") ;; - c) cache_dirs+=("$OPTARG") ;; - h) usage; exit 0 ;; - *|?) usage; exit 1 ;; - esac + case "$arg" in + M) archroot_args+=(-M "$OPTARG") ;; + c) cache_dirs+=("$OPTARG") ;; + h) usage; exit 0 ;; + *|?) usage; exit 1 ;; + esac done shift $((OPTIND - 1)) From patchwork Mon Dec 16 20:46:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov via arch-projects X-Patchwork-Id: 1411 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id D49D615AF8C50 for ; Mon, 16 Dec 2019 20:47:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1, MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001, T_DMARC_POLICY_NONE=0.01 autolearn=ham autolearn_force=no version=3.4.3 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Mon, 16 Dec 2019 20:47:04 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 4294017468DB25; Mon, 16 Dec 2019 20:46:41 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id 75E4517468DAD5; Mon, 16 Dec 2019 20:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1576529194; bh=eUN3eWBQMMAe+prMVHGB56+Sr0zuEnUWZiI4TNgvoAg=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc; b=Uuy+oh+qhPKbNUHF5l0fNQ7m8/plcpCBAMPxA/pTRlFMbyEz7hKSFNnAvQM3LZq9T E8LAS4QlZefoG0VS/KL8B1cdurx8SvxP+t6rBEPhtvnnfNMY5HI2tobV/WKVjj/ZyI 2aLq0IZA/B+aMfESytPyz57+Pm1sFqnUDe90OfJE6tbiFK3+lX6t18BlB43rvqj4jf RoDC2hMWqv6E9UFPmKJGaBLN17IEnb4raHE7qlEqzGMdCjaQjZEIUctMqv8HDk8nVX bcf26FX4e8YfigUJTrQgjkH2VuoCk0LzBd1mxF12dhMAMm38HpKfQ8im+CQ82LQNgf 88Og/hZJCWU7oszx0spro25RgqKCk1ZvPxiY+lvENQjMUOe3ZzWSEerJOMHo4BkYQQ AMT9lW4i6PGUtQrBX2y6R3Hes+r1+omxV4kOqV26HCn1gbQ/Kw2fcnK2r3dM70Gowm ivPJVJAg8ac2bO6xPVSrhWgAqTTwL5BgK2li8V0/X9CLLyrGLyQpzCUqBgWTpd7NiN 9JoVdGPDkOjYdRyX8wZt5wPjoYdjbCnY7GRxclyU8+XP/nplU67T0J+wv5XarY1eZg 06NojE1GXQYiSraREXUL1TqxQb9FhLhVo/dZz2f513RBEi22DlQcPtWmDsC19/4if7 GR8KQtzEXNyu0fO9bZKcvIZE= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 407762B794; Mon, 16 Dec 2019 20:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1576529194; bh=eUN3eWBQMMAe+prMVHGB56+Sr0zuEnUWZiI4TNgvoAg=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc; b=GcxlxNsqhhkOOEA4KTDYT1pkSbX3pc04pQ9ShCYUc4Z++Uz2FFHWSTv78ZS28s+PM 5iHjfNRNOvueS2/1i6EHpamqWeBCfJbB3lZx+BxAtAGL2+enBAzaUTxT3EED9M2vqI coLsnBFShHbSY+3j7FEGxZfwp+FuXAKAxiboEfeEkRj80vk41GkTm61JeYuvfq7TMC UY1LGstBDihNFoNGnLwkM9lc/t+saLoBHrYGPhskJiP0ghVjtXBxPXpiFZj5x7ufRy 1nLcQMQurXeREtm2tNmB0c964rpCtXvT0/tlTfa+Y6dCBmkuYCAgVx16IpdILLt2Aj FChfwdbXbn3WAivFmUwcoQVZhXWKxlKlOr92lEzBv0mx9kqkwOjCdiIJ3DLOHsrFYv XnujhFS3asBFnJ3J5lzE8Wm68VaTWzaDIQU//wHR743Z0N3PB7scVoLMexAZtLjyLS ApMGD8cPGjBxxhSZNLR4oLcn9PmCyfcT+CWkaDw1hS7byE0sxEOVXOcEe3RI2JvkFY xqEYwvgZX1Kb2lNPqGuq/zhlsVBrcqxZbQ3MTIDWA/pdCaK18s8gVBjMhsZAO0BTSC uDjnA5+LmBcK6fxA8aIlLbtBSj74bWhgfc/9UkT0siNkjVG5JmbTpzjU/RQsDDtYcX P5FnSO8SwVaKJHq4RJlfqECc= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 2DE5E2B78C for ; Mon, 16 Dec 2019 20:46:31 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Mon, 16 Dec 2019 20:46:31 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id BE28617468DABD; Mon, 16 Dec 2019 20:46:29 +0000 (UTC) Received: from didactylos.attlocal.net (unknown [IPv6:2600:1700:57f0:ca20:763a:c795:fcf6:91ea]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: eschwartz) by orion.archlinux.org (Postfix) with ESMTPSA id 2F35B17468DABB; Mon, 16 Dec 2019 20:46:29 +0000 (UTC) To: arch-projects@archlinux.org Date: Mon, 16 Dec 2019 15:46:08 -0500 Message-Id: <20191216204609.111647-3-eschwartz@archlinux.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216204609.111647-1-eschwartz@archlinux.org> References: <20191216204609.111647-1-eschwartz@archlinux.org> MIME-Version: 1.0 Subject: [arch-projects] [devtools] [PATCH 2/3] makerepropkg: add support to check unreproducible packages using diffoscope X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Arch Linux projects development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Eli Schwartz via arch-projects Reply-To: Arch Linux projects development discussion Cc: Eli Schwartz Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" Signed-off-by: Eli Schwartz --- doc/makerepropkg.1.asciidoc | 3 +++ makerepropkg.in | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/makerepropkg.1.asciidoc b/doc/makerepropkg.1.asciidoc index 7d68e5e..301b73e 100644 --- a/doc/makerepropkg.1.asciidoc +++ b/doc/makerepropkg.1.asciidoc @@ -26,6 +26,9 @@ link:https://reproducible-builds.org/[Reproducible Builds] project. Options ------- +*-d*:: + If packages are not reproducible, compare them using diffoscope. + *-c*:: Set the pacman cache directory. diff --git a/makerepropkg.in b/makerepropkg.in index 2b0945e..60fee95 100755 --- a/makerepropkg.in +++ b/makerepropkg.in @@ -29,6 +29,7 @@ declare -a buildenv buildopts installed installpkgs archiveurl='https://archive.archlinux.org/packages' buildroot=/var/lib/archbuild/reproducible chroot=testenv +diffoscope=0 parse_buildinfo() { local line var val @@ -94,14 +95,16 @@ package, including the .PKGINFO as well as the buildinfo. For more details see https://reproducible-builds.org/ OPTIONS + -d Run diffoscope if the package is unreproducible -c Set pacman cache -M Location of a makepkg config file -h Show this usage message __EOF__ } -while getopts 'M:c:h' arg; do +while getopts 'dM:c:h' arg; do case "$arg" in + d) diffoscope=1 ;; M) archroot_args+=(-M "$OPTARG") ;; c) cache_dirs+=("$OPTARG") ;; h) usage; exit 0 ;; @@ -177,12 +180,17 @@ arch-nspawn "${buildroot}/${chroot}" \ if (( $? == 0 )); then msg2 "built succeeded! built packages can be found in ${buildroot}/${chroot}/pkgdest" msg "comparing artifacts..." - if cmp -s "${pkgfile}" "${buildroot}/${chroot}/pkgdest/${pkgfile##*/}"; then + + comparefiles=("${pkgfile}" "${buildroot}/${chroot}/pkgdest/${pkgfile##*/}") + if cmp -s "${comparefiles[@]}"; then msg2 "Package successfully reproduced!" exit 0 else warning "Package is not reproducible. :(" - sha256sum "${pkgfile}" "${buildroot}/${chroot}/pkgdest/${pkgfile##*/}" + sha256sum "${comparefiles[@]}" + if (( diffoscope )); then + diffoscope "${comparefiles[@]}" + fi fi fi From patchwork Mon Dec 16 20:46:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov via arch-projects X-Patchwork-Id: 1412 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id AD32715AF8C5D for ; Mon, 16 Dec 2019 20:47:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1, MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001, T_DMARC_POLICY_NONE=0.01 autolearn=ham autolearn_force=no version=3.4.3 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Mon, 16 Dec 2019 20:47:09 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 41CB317468DB3B; Mon, 16 Dec 2019 20:46:44 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id BE86F17468DAE5; Mon, 16 Dec 2019 20:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1576529195; bh=287GbpEFfUYXQ7duoU92aDJxrYDVtnAu142Z5vBAHD8=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc; b=A1IhFSz2+EF9EtOuyKPqjcF4rqW89mkApSFN27uKLe5Ss4DdFpX45/eQSy2QHgl08 8rGyNhC8ybi/fn9CugreBbMBWMWaP1WRRZmwb7nzjvEu5MhJAnkJnvKvLtCgZidBeJ YcaTTtVBfd0QUaPDp4XvdgIosArLEbZk+sCxMOvd5H/wxEu1aIAjNXOkrQZsQCwMt/ M3MFQeyisToiBHz/Bl//OQkYIFb3LX+kidtTh2uukorPCbRJIDqqyTuE0gCVqV9eHX ykNly/9UOBAr0UVl7M10j5OD9pxi/t//istE5Gk6ax3MGhOHn+kv5CtBz3G19AN6rI WpO4yKsNxEFJax5EzywrBYDay9q0uxTq6HraG0Ww3mf08rznvQaLl+cLRyb3Mxbmsy ap/GnwoeJSrdzdyMsvYi7ooDalPR5CJTmNOncljkRHFI44aheiOxFnh2Tlt+CN3kQi wIjvTVV+TUPg1lNX9BPkbcfjZAR04YhRC3Gs7lagcjabq7Zf/2ZQpkkzzTLeBFvQxw r2mQFqAFHz9DlMDhYKX7ErI0Nf+WwlIjYFdkgROQSIOmD7Lj/B+JpWo1RCUlnyrHB6 OvziwdRrxrDBTq4e6T3vDPX37wtJBeHK/DQaUavaG6ECB3MClvvE6dLiC72xFDoseh y0egbUjY03/5oa73sdMdlAJM= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id AE0342B79A; Mon, 16 Dec 2019 20:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1576529195; bh=287GbpEFfUYXQ7duoU92aDJxrYDVtnAu142Z5vBAHD8=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc; b=RY1u8RSCDryH4hNvb3L9aO3vTG/otxF0oWccp/MHstMf/1rijyzcSLzX7LoEKY68D +zBcl7Plfu8InjTsT1Slo4hxSX/dQfwYasGw0dmI1vi8Jm6thRWfVlB6BSGYr8MUmD 0BRBlPRYuzlvmeKsgGZ0es/TmQNl0zlo4eCwMMKauMGYxAxRmUov2aPFmS3BKxj1+v vtlLxwVGi1q8j11Ki/XjoOBFvup5xogYhXJk/SmApv52mHPE6XjTqN9q4fdh4IcX5G rW/dF9J/HvPXlIYvGk3Qww/KpZ6fl8zLDUBte07mvbFkmYTZ5W73oQgb0OcPCY0W0I T8R96WfTuKWAlFtHDFxAhviBk9aWuXBKskmarn8jT5WemjQYlt3qkvmKPLcVyzrzMK 5jZogWv8N8/yOdI/iKAuyN5jTNxhKy9KwKaT0I3fS/a5ZcaIkp2aNKsoiKoUmf5GxN 7eeXFveOl3r6LO0kax3WsYfojrHqw7JfNVAE+Sq+9ELyxogDn+z5Prl1+Pq49DUB25 DFxfR+tiXyLihsb1yYTf1Gm/7r4pN/h/OUaI3kJ4UDSxFVqEwfctDb0upqmzp/GKg4 kmPHaU0anr9CGbByrnMEnmmNR2hVGHXIEPvCxO+35bwLoKtDplDHTNy5V7Iqkhlo67 i2JQGAJ6K1+Sx4ByCtUNYPw0= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id DDFD22B794 for ; Mon, 16 Dec 2019 20:46:31 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTPS for ; Mon, 16 Dec 2019 20:46:31 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 79CE517468DAC0; Mon, 16 Dec 2019 20:46:30 +0000 (UTC) Received: from didactylos.attlocal.net (unknown [IPv6:2600:1700:57f0:ca20:763a:c795:fcf6:91ea]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: eschwartz) by orion.archlinux.org (Postfix) with ESMTPSA id EAE6917468DABE; Mon, 16 Dec 2019 20:46:29 +0000 (UTC) To: arch-projects@archlinux.org Date: Mon, 16 Dec 2019 15:46:09 -0500 Message-Id: <20191216204609.111647-4-eschwartz@archlinux.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216204609.111647-1-eschwartz@archlinux.org> References: <20191216204609.111647-1-eschwartz@archlinux.org> MIME-Version: 1.0 Subject: [arch-projects] [devtools] [PATCH 3/3] makerepropkg: support checking multiple split packages X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Arch Linux projects development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Eli Schwartz via arch-projects Reply-To: Arch Linux projects development discussion Cc: Eli Schwartz Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" By specifying multiple package files, we assume they are all from the same PKGBUILD, and try to check them all against the produced artifacts. Since the buildinfo should be comparable for all of them, we simply use the first one passed on the command line. Signed-off-by: Eli Schwartz --- doc/makerepropkg.1.asciidoc | 8 ++++++-- makerepropkg.in | 40 +++++++++++++++++++++---------------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/doc/makerepropkg.1.asciidoc b/doc/makerepropkg.1.asciidoc index 301b73e..0d7ddcb 100644 --- a/doc/makerepropkg.1.asciidoc +++ b/doc/makerepropkg.1.asciidoc @@ -7,12 +7,12 @@ makerepropkg - Rebuild a package to see if it is reproducible Synopsis -------- -makerepropkg [OPTIONS] +makerepropkg [OPTIONS] ... Description ----------- -Given the path to a built pacman package, attempt to rebuild it using the +Given the path to a built pacman package(s), attempt to rebuild it using the PKGBUILD in the current directory. The package will be built in an environment as closely matching the environment of the initial package as possible, by building up a chroot to match the information exposed in the package's @@ -20,6 +20,10 @@ linkman:BUILDINFO[5] manifest. On success, the resulting package will be compared to the input package, and makerepropkg will report whether the artifacts are identical. +When given multiple packages, additional package files are assumed to be split +packages and will be treated as additional artifacts to compare during the +verification step. + This implements a verifier for pacman/libalpm packages in accordance with the link:https://reproducible-builds.org/[Reproducible Builds] project. diff --git a/makerepropkg.in b/makerepropkg.in index 60fee95..51c2dd2 100755 --- a/makerepropkg.in +++ b/makerepropkg.in @@ -117,10 +117,13 @@ check_root if [[ -n $1 ]]; then pkgfile="$1" - if ! bsdtar -tqf "${pkgfile}" .BUILDINFO >/dev/null 2>&1; then - error "file is not a valid pacman package: '%s'" "${pkgfile}" - exit 1 - fi + splitpkgs=("$@") + for f in "${splitpkgs[@]}"; do + if ! bsdtar -tqf "${f}" .BUILDINFO >/dev/null 2>&1; then + error "file is not a valid pacman package: '%s'" "${f}" + exit 1 + fi + done else error "no package file specified. Try '${BASH_SOURCE[0]##*/} -h' for more information. " exit 1 @@ -176,23 +179,26 @@ arch-nspawn "${buildroot}/${chroot}" \ --bind="${PWD}:/startdir" \ --bind="${SRCDEST}:/srcdest" \ /chrootbuild -C --noconfirm --log --holdver --skipinteg +ret=$? -if (( $? == 0 )); then +if (( ${ret} == 0 )); then msg2 "built succeeded! built packages can be found in ${buildroot}/${chroot}/pkgdest" msg "comparing artifacts..." - comparefiles=("${pkgfile}" "${buildroot}/${chroot}/pkgdest/${pkgfile##*/}") - if cmp -s "${comparefiles[@]}"; then - msg2 "Package successfully reproduced!" - exit 0 - else - warning "Package is not reproducible. :(" - sha256sum "${comparefiles[@]}" - if (( diffoscope )); then - diffoscope "${comparefiles[@]}" + for pkgfile in "${splitpkgs[@]}"; do + comparefiles=("${pkgfile}" "${buildroot}/${chroot}/pkgdest/${pkgfile##*/}") + if cmp -s "${comparefiles[@]}"; then + msg2 "Package '%s' successfully reproduced!" "${pkgfile}" + else + ret=1 + warning "Package '%s' is not reproducible. :(" "${pkgfile}" + sha256sum "${comparefiles[@]}" + if (( diffoscope )); then + diffoscope "${comparefiles[@]}" + fi fi - fi + done fi -# the package either failed to build, or was unreproducible -exit 1 +# return failure from chrootbuild, or the reproducibility status +exit ${ret}