Stefano Lattarini wrote: ... >> However, if you know of such test failures, it'd be nice to mark >> them as XFAIL as soon as you can -- even if just for a few days -- >> to avoid wasted effort. >> > But by doing so we would risk to let such failures "slips through the > cracks"... Still, having the affected tests printing a proper message > "I'm temporary failing due to commit ..." might help saving wasted > work. I'll try to be more careful next time. Sorry for the confusion > and sloppiness.
I don't want to slow you down, but if you were to simply add e.g. XFAIL_TESTS += name-of-temporarily-broken-test # FIXME: just temporary there would be little risk of forgetting about it. If you think that's too risky, I volunteer to write a crontab-run script that will mail to the list whenever such a line remains for more than a week in maint or master. ... >> with these envvar settings: >> >> update-copyright-env = \ >> UPDATE_COPYRIGHT_FORCE=1 \ >> UPDATE_COPYRIGHT_USE_INTERVALS=2 \ >> > Why the "2" here? The documentation in update-copyright reads: > > If UPDATE_COPYRIGHT_USE_INTERVALS=1, every series of consecutive That's only the first part of its documentation. Just below that, it says this: # If UPDATE_COPYRIGHT_USE_INTERVALS=2, convert a sequence with gaps # to the minimal containing range. For example, convert # 2000, 2004-2007, 2009 to 2000-2009. > So we should just export UPDATE_COPYRIGHT_USE_INTERVALS to "1", > right? No. As you see, we both want =2 ;-) > But then, a more serious issue: are we truly and legally allowed to transform > a copyright notice like: > > Copyright (C) 1998, 2002, 2010, 2011 Free Software Foundation, Inc. > > into this: > > Copyright (C) 1998-2012 Free Software Foundation, Inc. > > without problems? (I hope so, because I'd love the gain in compactness and > consistency). Yes, per this (the commit log for the gnulib change): update-copyright: accept new option: UPDATE_COPYRIGHT_USE_INTERVALS=2 * build-aux/update-copyright: When UPDATE_COPYRIGHT_USE_INTERVALS=2, convert a sequence with gaps to the minimal containing range. For example, convert 2000, 2004-2007, 2009 to 2000-2009. * tests/test-update-copyright.sh: Test for this. The FSF confirmed it is ok to do this, assuming there is at least one significant change per year in the affected range: http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/29554/focus=29860 >> UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79 >> > I'd rather keep all the lines shorter than 76 chars if possible (this leaves > room for leading line numbers in a vim buffer, even for terminals with only > 80 chars per line). Maybe leaving the default of 72 here would be even > better. And BTW, if we go on with collapsing the ranges of copyright years, > all of this becomes moot, because then all the lines containing the copyright > years will simply be 54 characters long, no? Good point. We can indeed remove the UPDATE_COPYRIGHT_MAX_LINE_LENGTH setting. >> Then I would propose the large, boring change induced >> by running "make update-copyright". >> > I agree it's a good idea to keep this change separate. > >> Here's the first patch: >> (I don't particularly like to copy update-copyright from gnulib and >> VC it here in automake, but that's the current method. Addressing that, >> if desired, would be a separate issue. ) >> > Agreed. What would you propose to address that? (I'm assuming you'll agree > with me that having gnulib as an automake git submodule would be a *gross* > overkill). Perhaps (some day) a submodule with the bits from gnulib's build-aux/ and top/ directories. But that might mean moving them from gnulib proper to a submodule of gnulib. I don't want to go there right now ;-) >> From fd93630e5c6aa9a9775ae945787b9903bab2f6c6 Mon Sep 17 00:00:00 2001 >> From: Jim Meyering <meyer...@redhat.com> >> Date: Sun, 12 Feb 2012 16:57:42 +0100 >> Subject: [PATCH] maint: add a rule to use gnulib's update-copyright >> > I assume this patch is for the 'maint' branch, right? Now it is. I've amended with this: diff --git a/Makefile.am b/Makefile.am index 6a6631f..496675e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -405,8 +405,7 @@ release-stats: ps update_copyright_env = \ UPDATE_COPYRIGHT_FORCE=1 \ - UPDATE_COPYRIGHT_USE_INTERVALS=2 \ - UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79 + UPDATE_COPYRIGHT_USE_INTERVALS=2 .PHONY: update-copyright update-copyright: Here's the adjusted c-set: >From 21b627dbec3347c2befde186c65592b9f177cd8d Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Sun, 12 Feb 2012 16:57:42 +0100 Subject: [PATCH] maint: add a rule to use gnulib's update-copyright * lib/update-copyright: New file, from gnulib. * Makefile.am (FETCHFILES): Add update-copyright to the list. (fetch): Fetch it. (update-copyright): New rule. --- Makefile.am | 13 ++- lib/update-copyright | 274 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 286 insertions(+), 1 deletions(-) create mode 100755 lib/update-copyright diff --git a/Makefile.am b/Makefile.am index 56784ca..76c3e69 100644 --- a/Makefile.am +++ b/Makefile.am @@ -752,7 +752,8 @@ config.guess \ config.sub \ gnupload \ gitlog-to-changelog \ -texinfo.tex +texinfo.tex \ +update-copyright ## Fetch the latest versions of files we care about. fetch: @@ -765,6 +766,7 @@ fetch: $(WGET_SV_CVS)texinfo/texinfo/doc/texinfo.tex -O texinfo.tex && \ $(WGET_SV_GIT_GL)doc/INSTALL -O INSTALL && \ $(WGET_SV_GIT_GL)build-aux/gnupload -O gnupload && \ + $(WGET_SV_GIT_GL)build-aux/update-copyright -O update-copyright && \ $(WGET_SV_GIT_GL)build-aux/gitlog-to-changelog -O gitlog-to-changelog) ## Don't exit after test because we want to give as many errors as ## possible. @@ -812,3 +814,12 @@ release-stats: ps printf '@item %s @tab %-6s @tab %4d @tab %4d @tab %4d @tab %4d %-4s @tab %4d %-4s @tab %3d @tab %d %-4s\n' \ $$today $(VERSION) $$am $$acl $$pm $$aml "($$amf)" $$m4l "($$m4f)" $$doc $$t "($$tgen)" .PHONY: release-stats + +update_copyright_env = \ + UPDATE_COPYRIGHT_FORCE=1 \ + UPDATE_COPYRIGHT_USE_INTERVALS=2 + +.PHONY: update-copyright +update-copyright: + git ls-files | grep -Ev 'COPYING|INSTALL' \ + | $(update_copyright_env) xargs $(srcdir)/lib/$@ diff --git a/lib/update-copyright b/lib/update-copyright new file mode 100755 index 0000000..082b749 --- /dev/null +++ b/lib/update-copyright @@ -0,0 +1,274 @@ +eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" ${1+"$@"}' + & eval 'exec perl -wS -0777 -pi "$0" $argv:q' + if 0; +# Update an FSF copyright year list to include the current year. + +my $VERSION = '2012-02-05.21:39'; # UTC + +# Copyright (C) 2009-2012 Free Software Foundation, Inc. +# +# This program 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, or (at your option) +# any later version. +# +# This program 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 this program. If not, see <http://www.gnu.org/licenses/>. + +# Written by Jim Meyering and Joel E. Denny + +# The arguments to this script should be names of files that contain +# copyright statements to be updated. The copyright holder's name +# defaults to "Free Software Foundation, Inc." but may be changed to +# any other name by using the "UPDATE_COPYRIGHT_HOLDER" environment +# variable. +# +# For example, you might wish to use the update-copyright target rule +# in maint.mk from gnulib's maintainer-makefile module. +# +# Iff a copyright statement is recognized in a file and the final +# year is not the current year, then the statement is updated for the +# new year and it is reformatted to: +# +# 1. Fit within 72 columns. +# 2. Convert 2-digit years to 4-digit years by prepending "19". +# 3. Expand copyright year intervals. (See "Environment variables" +# below.) +# +# A warning is printed for every file for which no copyright +# statement is recognized. +# +# Each file's copyright statement must be formatted correctly in +# order to be recognized. For example, each of these is fine: +# +# Copyright @copyright{} 1990-2005, 2007-2009 Free Software +# Foundation, Inc. +# +# # Copyright (C) 1990-2005, 2007-2009 Free Software +# # Foundation, Inc. +# +# /* +# * Copyright © 90,2005,2007-2009 +# * Free Software Foundation, Inc. +# */ +# +# However, the following format is not recognized because the line +# prefix changes after the first line: +# +# ## Copyright (C) 1990-2005, 2007-2009 Free Software +# # Foundation, Inc. +# +# However, any correctly formatted copyright statement following +# a non-matching copyright statements would be recognized. +# +# The exact conditions that a file's copyright statement must meet +# to be recognized are: +# +# 1. It is the first copyright statement that meets all of the +# following conditions. Subsequent copyright statements are +# ignored. +# 2. Its format is "Copyright (C)", then a list of copyright years, +# and then the name of the copyright holder. +# 3. The "(C)" takes one of the following forms or is omitted +# entirely: +# +# A. (C) +# B. (c) +# C. @copyright{} +# D. © +# +# 4. The "Copyright" appears at the beginning of a line, except that it +# may be prefixed by any sequence (e.g., a comment) of no more than +# 5 characters -- including white space. +# 5. Iff such a prefix is present, the same prefix appears at the +# beginning of each remaining line within the FSF copyright +# statement. There is one exception in order to support C-style +# comments: if the first line's prefix contains nothing but +# whitespace surrounding a "/*", then the prefix for all subsequent +# lines is the same as the first line's prefix except with each of +# "/" and possibly "*" replaced by a " ". The replacement of "*" +# by " " is consistent throughout all subsequent lines. +# 6. Blank lines, even if preceded by the prefix, do not appear +# within the FSF copyright statement. +# 7. Each copyright year is 2 or 4 digits, and years are separated by +# commas or dashes. Whitespace may appear after commas. +# +# Environment variables: +# +# 1. If UPDATE_COPYRIGHT_FORCE=1, a recognized FSF copyright statement +# is reformatted even if it does not need updating for the new +# year. If unset or set to 0, only updated FSF copyright +# statements are reformatted. +# 2. If UPDATE_COPYRIGHT_USE_INTERVALS=1, every series of consecutive +# copyright years (such as 90, 1991, 1992-2007, 2008) in a +# reformatted FSF copyright statement is collapsed to a single +# interval (such as 1990-2008). If unset or set to 0, all existing +# copyright year intervals in a reformatted FSF copyright statement +# are expanded instead. +# If UPDATE_COPYRIGHT_USE_INTERVALS=2, convert a sequence with gaps +# to the minimal containing range. For example, convert +# 2000, 2004-2007, 2009 to 2000-2009. +# 3. For testing purposes, you can set the assumed current year in +# UPDATE_COPYRIGHT_YEAR. +# 4. The default maximum line length for a copyright line is 72. +# Set UPDATE_COPYRIGHT_MAX_LINE_LENGTH to use a different length. +# 5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other +# than "Free Software Foundation, Inc.". + +use strict; +use warnings; + +my $copyright_re = 'Copyright'; +my $circle_c_re = '(?:\([cC]\)|@copyright{}|©)'; +my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER}; +$holder ||= 'Free Software Foundation, Inc.'; +my $prefix_max = 5; +my $margin = $ENV{UPDATE_COPYRIGHT_MAX_LINE_LENGTH}; +!$margin || $margin !~ m/^\d+$/ + and $margin = 72; + +my $tab_width = 8; + +my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR}; +if (!$this_year || $this_year !~ m/^\d{4}$/) + { + my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ()); + $this_year = $year + 1900; + } + +# Unless the file consistently uses "\r\n" as the EOL, use "\n" instead. +my $eol = /(?:^|[^\r])\n/ ? "\n" : "\r\n"; + +my $leading; +my $prefix; +my $ws_re; +my $stmt_re; +while (/(^|\n)(.{0,$prefix_max})$copyright_re/g) + { + $leading = "$1$2"; + $prefix = $2; + if ($prefix =~ /^(\s*\/)\*(\s*)$/) + { + $prefix =~ s,/, ,; + my $prefix_ws = $prefix; + $prefix_ws =~ s/\*/ /; # Only whitespace. + if (/\G(?:[^*\n]|\*[^\/\n])*\*?\n$prefix_ws/) + { + $prefix = $prefix_ws; + } + } + $ws_re = '[ \t\r\f]'; # \s without \n + $ws_re = + "(?:$ws_re*(?:$ws_re|\\n" . quotemeta($prefix) . ")$ws_re*)"; + my $holder_re = $holder; + $holder_re =~ s/\s/$ws_re/g; + my $stmt_remainder_re = + "(?:$ws_re$circle_c_re)?" + . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*" + . "((?:\\d\\d)?\\d\\d)$ws_re$holder_re"; + if (/\G$stmt_remainder_re/) + { + $stmt_re = + quotemeta($leading) . "($copyright_re$stmt_remainder_re)"; + last; + } + } +if (defined $stmt_re) + { + /$stmt_re/ or die; # Should never die. + my $stmt = $1; + my $final_year_orig = $2; + + # Handle two-digit year numbers like "98" and "99". + my $final_year = $final_year_orig; + $final_year <= 99 + and $final_year += 1900; + + if ($final_year != $this_year) + { + # Update the year. + $stmt =~ s/$final_year_orig/$final_year, $this_year/; + } + if ($final_year != $this_year || $ENV{'UPDATE_COPYRIGHT_FORCE'}) + { + # Normalize all whitespace including newline-prefix sequences. + $stmt =~ s/$ws_re/ /g; + + # Put spaces after commas. + $stmt =~ s/, ?/, /g; + + # Convert 2-digit to 4-digit years. + $stmt =~ s/(\b\d\d\b)/19$1/g; + + # Make the use of intervals consistent. + if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS}) + { + $stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg; + } + else + { + $stmt =~ + s/ + (\d{4}) + (?: + (,\ |-) + ((??{ + if ($2 eq '-') { '\d{4}'; } + elsif (!$3) { $1 + 1; } + else { $3 + 1; } + })) + )+ + /$1-$3/gx; + + # When it's 2, emit a single range encompassing all year numbers. + $ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2 + and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/; + } + + # Format within margin. + my $stmt_wrapped; + my $text_margin = $margin - length($prefix); + if ($prefix =~ /^(\t+)/) + { + $text_margin -= length($1) * ($tab_width - 1); + } + while (length $stmt) + { + if (($stmt =~ s/^(.{1,$text_margin})(?: |$)//) + || ($stmt =~ s/^([\S]+)(?: |$)//)) + { + my $line = $1; + $stmt_wrapped .= $stmt_wrapped ? "$eol$prefix" : $leading; + $stmt_wrapped .= $line; + } + else + { + # Should be unreachable, but we don't want an infinite + # loop if it can be reached. + die; + } + } + + # Replace the old copyright statement. + s/$stmt_re/$stmt_wrapped/; + } + } +else + { + print STDERR "$ARGV: warning: copyright statement not found\n"; + } + +# Local variables: +# mode: perl +# indent-tabs-mode: nil +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "my $VERSION = '" +# time-stamp-format: "%:y-%02m-%02d.%02H:%02M" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "'; # UTC" +# End: -- 1.7.9.210.g21ac7a