From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: Re: [PATCH] Makefile.am: add a target that lists patches no longer used Date: Thu, 20 Apr 2017 23:20:23 -0500 Message-ID: <20170420232023.01bb2e6d@centurylink.net> References: <1431992050-18271-1-git-send-email-tipecaml@gmail.com> <20170420191546.GA7000@jasmine> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/9rxMKJtcHcWx6993__p2Wbz"; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1Q3b-0002oE-TD for guix-devel@gnu.org; Fri, 21 Apr 2017 00:20:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1Q3X-0004yH-S1 for guix-devel@gnu.org; Fri, 21 Apr 2017 00:20:31 -0400 Received: from mail.centurylink.net ([205.219.233.9]:53742 helo=smtp.centurylink.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1Q3X-0004y5-Hw for guix-devel@gnu.org; Fri, 21 Apr 2017 00:20:27 -0400 In-Reply-To: <20170420191546.GA7000@jasmine> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Leo Famulari Cc: guix-devel@gnu.org --Sig_/9rxMKJtcHcWx6993__p2Wbz Content-Type: multipart/mixed; boundary="MP_/JziLrHMwS=L9TjF0O/BCkuV" --MP_/JziLrHMwS=L9TjF0O/BCkuV Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thu, 20 Apr 2017 15:15:46 -0400 Leo Famulari wrote: > On Tue, May 19, 2015 at 01:34:10AM +0200, Cyril Roelandt wrote: > > * list-useless-patches.sh: New file. > > * Makefile.am (check-for-useless-patches): New target. =20 >=20 > We should make use of this somehow! Attached is my own shot at this. It does not make use of git, so should be fine as a regular test. It doesn't check whether the files listed in dist_patch_DATA actually exist, because `make dist` already checks that. I suppose it might be nice, if git a git checkout, to check whether the used patches are all known to git... Anyhow, currently the test fails with the following log output: -----------BEGIN test-suite.log---------------- FAIL: tests/patches =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D test-name: distributed patches are used location: /home/bavier/projects/guix/tests/patches.scm:50 source: + (test-equal + "distributed patches are used" + '() + (lset-difference + string=3D? + distributed-patches + used-patches)) expected-value: () actual-value: ("/home/bavier/projects/guix/gnu/packages/patches/ath9k-htc-f= irmware-binutils.patch" "/home/bavier/projects/guix/gnu/packages/patches/at= h9k-htc-firmware-gcc.patch" "/home/bavier/projects/guix/gnu/packages/patche= s/coreutils-cut-huge-range-test.patch" "/home/bavier/projects/guix/gnu/pack= ages/patches/gawk-shell.patch" "/home/bavier/projects/guix/gnu/packages/pat= ches/gcc-libiberty-printf-decl.patch" "/home/bavier/projects/guix/gnu/packa= ges/patches/gcc-4.9.3-mingw-gthr-default.patch" "/home/bavier/projects/guix= /gnu/packages/patches/gcj-arm-mode.patch" "/home/bavier/projects/guix/gnu/p= ackages/patches/glibc-bootstrap-system.patch" "/home/bavier/projects/guix/g= nu/packages/patches/grub-CVE-2015-8370.patch" "/home/bavier/projects/guix/g= nu/packages/patches/grub-gets-undeclared.patch" "/home/bavier/projects/guix= /gnu/packages/patches/grub-freetype.patch" "/home/bavier/projects/guix/gnu/= packages/patches/guile-arm-fixes.patch" "/home/bavier/projects/guix/gnu/pac= kages/patches/icu4c-CVE-2017-7867-CVE-2017-7868.patch" "/home/bavier/projec= ts/guix/gnu/packages/patches/icu4c-reset-keyword-list-iterator.patch" "/hom= e/bavier/projects/guix/gnu/packages/patches/ldc-disable-tests.patch" "/home= /bavier/projects/guix/gnu/packages/patches/ldc-1.1.0-disable-dmd-tests.patc= h" "/home/bavier/projects/guix/gnu/packages/patches/ldc-1.1.0-disable-phobo= s-tests.patch" "/home/bavier/projects/guix/gnu/packages/patches/libgit2-use= -after-free.patch" "/home/bavier/projects/guix/gnu/packages/patches/libxslt= -CVE-2016-4738.patch" "/home/bavier/projects/guix/gnu/packages/patches/mpla= yer2-theora-fix.patch" "/home/bavier/projects/guix/gnu/packages/patches/pat= chelf-rework-for-arm.patch" "/home/bavier/projects/guix/gnu/packages/patche= s/pcre-CVE-2017-7186.patch" "/home/bavier/projects/guix/gnu/packages/patche= s/perl-net-ssleay-disable-ede-test.patch" "/home/bavier/projects/guix/gnu/p= ackages/patches/readline-7.0-mingw.patch" "/home/bavier/projects/guix/gnu/p= ackages/patches/soprano-find-clucene.patch" "/home/bavier/projects/guix/gnu= /packages/patches/texlive-texmf-CVE-2016-10243.patch" "/home/bavier/project= s/guix/gnu/packages/patches/util-linux-CVE-2017-2616.patch" "/home/bavier/p= rojects/guix/gnu/packages/patches/xf86-video-ast-remove-mibstore.patch" "/h= ome/bavier/projects/guix/gnu/packages/patches/xf86-video-intel-compat-api.p= atch" "/home/bavier/projects/guix/gnu/packages/patches/xf86-video-intel-gli= bc-2.20.patch") result: FAIL test-name: used patches are distributed location: /home/bavier/projects/guix/tests/patches.scm:54 source: + (test-equal + "used patches are distributed" + '() + (lset-difference + string=3D? + used-patches + distributed-patches)) expected-value: () actual-value: ("/home/bavier/projects/guix/gnu/packages/patches/python-pbr-= fix-man-page-support.patch" "/home/bavier/projects/guix/gnu/packages/patche= s/jacal-fix-texinfo.patch" "/home/bavier/projects/guix/gnu/packages/patches= /vsearch-unbundle-cityhash.patch" "/home/bavier/projects/guix/gnu/packages/= patches/hmmer-remove-cpu-specificity.patch") result: FAIL --------------END test-suite.log----------------- --MP_/JziLrHMwS=L9TjF0O/BCkuV Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-tests-Add-patch-use-test.patch =46rom 751f10e180994db6c0df722c2b226e174d3b7a28 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Thu, 20 Apr 2017 23:17:14 -0500 Subject: [PATCH] tests: Add patch use test. * tests/patches.scm: New test. * Makefile.am (SCM_TESTS): Add it. (AM_TESTS_ENVIRONMENT): Export dist_patch_DATA. --- Makefile.am | 8 ++++++-- tests/patches.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++= +++ 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 tests/patches.scm diff --git a/Makefile.am b/Makefile.am index a997ed8b9..5cd9be814 100644 --- a/Makefile.am +++ b/Makefile.am @@ -307,7 +307,8 @@ SCM_TESTS =3D \ tests/scripts-build.scm \ tests/containers.scm \ tests/pack.scm \ - tests/import-utils.scm + tests/import-utils.scm \ + tests/patches.scm =20 if HAVE_GUILE_JSON =20 @@ -343,7 +344,10 @@ endif BUILD_DAEMON =20 TESTS =3D $(SCM_TESTS) $(SH_TESTS) =20 -AM_TESTS_ENVIRONMENT =3D abs_top_srcdir=3D"$(abs_top_srcdir)" GUILE_AUTO_C= OMPILE=3D0 +AM_TESTS_ENVIRONMENT =3D \ + abs_top_srcdir=3D"$(abs_top_srcdir)" \ + dist_patch_DATA=3D"$(dist_patch_DATA)" \ #for tests/patches.scm + GUILE_AUTO_COMPILE=3D0 =20 SCM_LOG_DRIVER =3D \ $(top_builddir)/test-env --quiet-stderr \ diff --git a/tests/patches.scm b/tests/patches.scm new file mode 100644 index 000000000..4c5a0c44a --- /dev/null +++ b/tests/patches.scm @@ -0,0 +1,54 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2017 Eric Bavier +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (test-patches) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-64) + #:use-module (gnu packages) + #:use-module (guix packages) + #:use-module (guix sets))=20 + +=0C +(define used-patches + (set->list + (fold-packages=20 + (lambda (package result)=20 + (set-union result=20 + (list->set=20 + (or (and=3D> (package-source package)=20 + (lambda (o)=20 + (filter string? ;ignore origin patches + (origin-patches o))))=20 + (list)))))=20 + (set)))) + +(define distributed-patches + (map (=CE=BB (s) (string-append (getenv "abs_top_srcdir") "/" s)) + (remove string-null? (string-split (getenv "dist_patch_DATA") #\spa= ce)))) + +(test-begin "patches") + +(test-equal "distributed patches are used" + '() + (lset-difference string=3D? distributed-patches used-patches)) + +(test-equal "used patches are distributed" + '() + (lset-difference string=3D? used-patches distributed-patches)) + +(test-end) --=20 2.12.2 --MP_/JziLrHMwS=L9TjF0O/BCkuV-- --Sig_/9rxMKJtcHcWx6993__p2Wbz Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEP6ffQNOS1+XjkicBHrvSBHgfliwFAlj5iIcACgkQHrvSBHgf liwjdgf/UJsPmELV3PVXG9ju5ubI4jp2eLuBYwMAOgkBElPKzONf0kNcA2kzG1IG 0VExsSbjCu1ma6LdqDSozN8jC10hz+JdEF+F+KKcuHx0qm+JOh1v6ji8V4UEloYD f3OV1SR/ycEMD+b/j6TyGwDa2JxeQKcmUpxlid4aC3+QgXOW+fxiQU0TXyyoj3sd jThlsLxG6WjLpvo5OmsYfM2A81cl1VqKdv45f/Samx/JXUyp94UKlJSlFjJRMl8w whOFawg8nzMIIuQgf9GuKpPUknnA56ypmuMvyIqQtHuKQ36GNfnNkD/dXVxRDjy3 pca4fLz4o7FIVNj1p0IotR+pKVKQfQ== =iWlA -----END PGP SIGNATURE----- --Sig_/9rxMKJtcHcWx6993__p2Wbz--