lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [5452] For copyright, use current civil year, not last-mod


From: Greg Chicares
Subject: [lmi-commits] [5452] For copyright, use current civil year, not last-modified year
Date: Fri, 04 May 2012 11:20:20 +0000

Revision: 5452
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5452
Author:   chicares
Date:     2012-05-04 11:20:19 +0000 (Fri, 04 May 2012)
Log Message:
-----------
For copyright, use current civil year, not last-modified year

Modified Paths:
--------------
    lmi/trunk/test_coding_rules.cpp
    lmi/trunk/test_coding_rules_test.sh

Modified: lmi/trunk/test_coding_rules.cpp
===================================================================
--- lmi/trunk/test_coding_rules.cpp     2012-05-04 10:30:13 UTC (rev 5451)
+++ lmi/trunk/test_coding_rules.cpp     2012-05-04 11:20:19 UTC (rev 5452)
@@ -422,9 +422,22 @@
         }
 }
 
-// SOMEDAY !! This test could be liberalized to permit copyright
-// notices to span multiple lines. For now, it is assumed that the
-// year appears on the same line as the word "Copyright".
+/// Check required copyright notices; report if absent or not current.
+///
+/// References:
+///   http://www.gnu.org/licenses/gpl-howto.html
+/// | The copyright notice should include the year in which you
+/// | finished preparing the release
+///   http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices
+/// | When you add the new year, it is not required to keep track of
+/// | which files have seen significant changes in the new year and
+/// | which have not. It is recommended and simpler to add the new
+/// | year to all files in the package, and be done with it for the
+/// | rest of the year.
+///
+/// SOMEDAY !! This test could be liberalized to permit copyright
+/// notices to span multiple lines. For now, it is assumed that the
+/// year appears on the same line as the word "Copyright".
 
 void check_copyright(file const& f)
 {
@@ -439,8 +452,8 @@
         return;
         }
 
-    std::time_t const t0 = fs::last_write_time(f.path());
-    std::tm const*const t1 = std::gmtime(&t0);
+    std::time_t const t0 = std::time(0);
+    std::tm const*const t1 = std::localtime(&t0);
     LMI_ASSERT(NULL != t1);
     int const year = 1900 + t1->tm_year;
     std::ostringstream oss;

Modified: lmi/trunk/test_coding_rules_test.sh
===================================================================
--- lmi/trunk/test_coding_rules_test.sh 2012-05-04 10:30:13 UTC (rev 5451)
+++ lmi/trunk/test_coding_rules_test.sh 2012-05-04 11:20:19 UTC (rev 5452)
@@ -62,15 +62,6 @@
 "(c) 1999": lower-case 'c' is incorrect in ASCII copyright symbol.
 EOF
 
-cat >eraseme_copyright_002 <<EOF
-$good_rcsid $good_url
-This would seem to be all right:
-// Copyright (C) 1900, `date -u +'%Y'`, 2100
-but the datestamp is changed to the beginning of the msw epoch.
-Don't use the unix epoch, because that causes mayhem on msw.
-EOF
-touch --date=19800102 eraseme_copyright_002
-
 # Files in general: defect markers.
 
 Q='?'
@@ -406,7 +397,6 @@
 Exception--file 'another.unexpected.file': File is unexpectedly 
uncategorizable.
 File 'eraseme_copyright_001' lacks current copyright.
 File 'eraseme_copyright_001' breaks taboo '\(c\) *[0-9]'.
-File 'eraseme_copyright_002' lacks current copyright.
 File 'eraseme_cpp_001.cpp' must not include 'config.hpp'.
 File 'eraseme_cpp_002.cpp' has misindented label ' wrong   :'.
 File 'eraseme_cpp_002.cpp' has misindented label '   No2   :'.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]