From: Eric Bavier <ericbavier@centurylink.net>
To: Leo Famulari <leo@famulari.name>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] Makefile.am: add a target that lists patches no longer used
Date: Thu, 20 Apr 2017 23:20:23 -0500 [thread overview]
Message-ID: <20170420232023.01bb2e6d@centurylink.net> (raw)
In-Reply-To: <20170420191546.GA7000@jasmine>
[-- Attachment #1.1: Type: text/plain, Size: 4187 bytes --]
On Thu, 20 Apr 2017 15:15:46 -0400
Leo Famulari <leo@famulari.name> 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.
>
> 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
===================
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=?
+ distributed-patches
+ used-patches))
expected-value: ()
actual-value: ("/home/bavier/projects/guix/gnu/packages/patches/ath9k-htc-firmware-binutils.patch" "/home/bavier/projects/guix/gnu/packages/patches/ath9k-htc-firmware-gcc.patch" "/home/bavier/projects/guix/gnu/packages/patches/coreutils-cut-huge-range-test.patch" "/home/bavier/projects/guix/gnu/packages/patches/gawk-shell.patch" "/home/bavier/projects/guix/gnu/packages/patches/gcc-libiberty-printf-decl.patch" "/home/bavier/projects/guix/gnu/packages/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/packages/patches/glibc-bootstrap-system.patch" "/home/bavier/projects/guix/gnu/packages/patches/grub-CVE-2015-8370.patch" "/home/bavier/projects/guix/gnu/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/packages/patches/icu4c-CVE-2017-7867-CVE-2017-7868.patch" "/home/bavier/projects/guix/gnu/packages/patches/icu4c-reset-keyword-list-iterator.patch" "/home/bavier/projects/guix/gnu/packages/patches/ldc-disable-tests.patch" "/home/bavier/projects/guix/gnu/packages/patches/ldc-1.1.0-disable-dmd-tests.patch" "/home/bavier/projects/guix/gnu/packages/patches/ldc-1.1.0-disable-phobos-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/mplayer2-theora-fix.patch" "/home/bavier/projects/guix/gnu/packages/patches/patchelf-rework-for-arm.patch" "/home/bavier/projects/guix/gnu/packages/patches/pcre-CVE-2017-7186.patch" "/home/bavier/projects/guix/gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch" "/home/bavier/projects/guix/gnu/packages/patches/readline-7.0-mingw.patch" "/home/bavier/projects/guix/gnu/packages/patches/soprano-find-clucene.patch" "/home/bavier/projects/guix/gnu/packages/patches/texlive-texmf-CVE-2016-10243.patch" "/home/bavier/projects/guix/gnu/packages/patches/util-linux-CVE-2017-2616.patch" "/home/bavier/projects/guix/gnu/packages/patches/xf86-video-ast-remove-mibstore.patch" "/home/bavier/projects/guix/gnu/packages/patches/xf86-video-intel-compat-api.patch" "/home/bavier/projects/guix/gnu/packages/patches/xf86-video-intel-glibc-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=?
+ 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/patches/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-----------------
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-tests-Add-patch-use-test.patch --]
[-- Type: text/x-patch, Size: 3387 bytes --]
From 751f10e180994db6c0df722c2b226e174d3b7a28 Mon Sep 17 00:00:00 2001
From: Eric Bavier <bavier@member.fsf.org>
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 = \
tests/scripts-build.scm \
tests/containers.scm \
tests/pack.scm \
- tests/import-utils.scm
+ tests/import-utils.scm \
+ tests/patches.scm
if HAVE_GUILE_JSON
@@ -343,7 +344,10 @@ endif BUILD_DAEMON
TESTS = $(SCM_TESTS) $(SH_TESTS)
-AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
+AM_TESTS_ENVIRONMENT = \
+ abs_top_srcdir="$(abs_top_srcdir)" \
+ dist_patch_DATA="$(dist_patch_DATA)" \ #for tests/patches.scm
+ GUILE_AUTO_COMPILE=0
SCM_LOG_DRIVER = \
$(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 © 2017 Eric Bavier <bavier@member.fsf.org>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(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))
+
+\f
+(define used-patches
+ (set->list
+ (fold-packages
+ (lambda (package result)
+ (set-union result
+ (list->set
+ (or (and=> (package-source package)
+ (lambda (o)
+ (filter string? ;ignore origin patches
+ (origin-patches o))))
+ (list)))))
+ (set))))
+
+(define distributed-patches
+ (map (λ (s) (string-append (getenv "abs_top_srcdir") "/" s))
+ (remove string-null? (string-split (getenv "dist_patch_DATA") #\space))))
+
+(test-begin "patches")
+
+(test-equal "distributed patches are used"
+ '()
+ (lset-difference string=? distributed-patches used-patches))
+
+(test-equal "used patches are distributed"
+ '()
+ (lset-difference string=? used-patches distributed-patches))
+
+(test-end)
--
2.12.2
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2017-04-21 4:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-18 23:34 [PATCH] Makefile.am: add a target that lists patches no longer used Cyril Roelandt
2017-04-20 19:15 ` Leo Famulari
2017-04-21 4:20 ` Eric Bavier [this message]
2017-04-21 17:41 ` Leo Famulari
2017-07-19 23:02 ` Ben Woodcroft
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170420232023.01bb2e6d@centurylink.net \
--to=ericbavier@centurylink.net \
--cc=guix-devel@gnu.org \
--cc=leo@famulari.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).