[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Copyright year displayed by command-line tools

From: Branko Čibej <brane_at_wandisco.com>
Date: Fri, 20 Mar 2015 14:33:57 +0100

On 20.03.2015 14:31, Stefan Fuhrmann wrote:
> On Fri, Mar 20, 2015 at 8:47 AM, Stefan Sperling <stsp_at_elego.de
> <mailto:stsp_at_elego.de>> wrote:
>
> On Fri, Mar 20, 2015 at 08:34:00AM +0100, Branko Čibej wrote:
> > I just noticed that we forgot to bump the displayed copyright year.
> > Fixed in r1667941 and nominated for backport to 1.9.x, 1.8.x and
> 1.7.x.
> > I also vetoed the 1.7.20 and 1.8.13 releases because of the
> wrong year
> > ... we really shouldn't release with wrong legalese, and we already
> > allowed 1.9.0-beta1 to slip through with that buglet.
> >
> > Sorry about not noticing this earlier, I realize we already have
> enough
> > votes tor 1.7.20 and 1.8.13; but I really think we should pull these
> > tarballs.
> >
> > -- Brane
>
> If we decide to pull these releases based on this problem, then I'm
> against making everyone re-run tests for this. Just allow people to
> diff the tarballs and submit a new signature based on that.
>
> Could we have a buildbot test for this kind of problem?
> Should our rat-report bot (which I can't seem to locate in the maze
> of buildbot right now) perhaps check for this?
>
>
> Yes, I think we should add a simple C test calling svn_version_extended.
> If the year differs from the actual, FAIL. Have a grace period from Dec 15
> to Jan 15. That test would act as a simple reminder.
>
> I'd be happy to implement it.

Don't need a C test for that, just tweak the getopt tests. Haven't
committed this yet because we might end up removing the copyright blurb
altogether.

$ svn diff
Index: Makefile.in
===================================================================
--- Makefile.in (revision 1667950)
+++ Makefile.in (working copy)
@@ -556,6 +556,9 @@
           if test "$(PARALLEL)" != ""; then \
             flags="--parallel $(PARALLEL) $$flags"; \
           fi; \
+ if test "$(COPYRIGHT)" != ""; then \
+ flags="--copyright $(COPYRIGHT) $$flags"; \
+ fi; \
           if test "$(LOG_TO_STDOUT)" != ""; then \
             flags="--log-to-stdout $$flags"; \
           fi; \
Index: build/run_tests.py
===================================================================
--- build/run_tests.py (revision 1667950)
+++ build/run_tests.py (working copy)
@@ -30,7 +30,7 @@
             [--list] [--milestone-filter=<regex>] [--mode-filter=<type>]
             [--server-minor-version=<version>] [--http-proxy=<host>:<port>]
             [--httpd-version=<version>]
- [--config-file=<file>] [--ssl-cert=<file>]
+ [--copyright=<year>] [--config-file=<file>] [--ssl-cert=<file>]
             [--exclusive-wc-locks] [--memcached-server=<url:port>]
             <abs_srcdir> <abs_builddir>
             <prog ...>
@@ -123,7 +123,8 @@
   def __init__(self, abs_srcdir, abs_builddir, logfile, faillogfile,
                base_url=None, fs_type=None, http_library=None,
                server_minor_version=None, verbose=None,
- cleanup=None, enable_sasl=None, parallel=None, config_file=None,
+ cleanup=None, enable_sasl=None, parallel=None,
+ copyright_year=None, config_file=None,
                fsfs_sharding=None, fsfs_packing=None,
                list_tests=None, svn_bin=None, mode_filter=None,
                milestone_filter=None, set_log_level=None, ssl_cert=None,
@@ -175,6 +176,7 @@
     self.fsfs_packing = fsfs_packing
     if fsfs_packing is not None and fsfs_sharding is None:
       raise Exception('--fsfs-packing requires --fsfs-sharding')
+ self.copyright_year = copyright_year
     self.config_file = None
     if config_file is not None:
       self.config_file = os.path.abspath(config_file)
@@ -506,6 +508,8 @@
         svntest.main.options.parallel = num_parallel
       else:
         svntest.main.options.parallel = svntest.main.default_num_threads
+ if self.copyright_year is not None:
+ svntest.main.options.copyright_year = int(self.copyright_year)
     if self.config_file is not None:
       svntest.main.options.config_file = self.config_file
     if self.verbose is not None:
@@ -721,7 +725,8 @@
                             'dump-load-cross-check',
                             'http-library=', 'server-minor-version=',
                             'fsfs-packing', 'fsfs-sharding=',
- 'enable-sasl', 'parallel=', 'config-file=',
+ 'enable-sasl', 'parallel=', 'copyright=',
+ 'config-file=',
                             'log-to-stdout', 'list', 'milestone-filter=',
                             'mode-filter=', 'set-log-level=', 'ssl-cert=',
                             'http-proxy=', 'http-proxy-username=',
@@ -737,13 +742,13 @@
 
   base_url, fs_type, verbose, cleanup, skip_c_tests, enable_sasl, \
     http_library, server_minor_version, fsfs_sharding, fsfs_packing, \
- parallel, config_file, log_to_stdout, list_tests, mode_filter, \
- milestone_filter, set_log_level, ssl_cert, http_proxy, \
+ parallel, copyright_year, config_file, log_to_stdout, list_tests, \
+ mode_filter, milestone_filter, set_log_level, ssl_cert, http_proxy, \
     http_proxy_username, http_proxy_password, httpd_version, \
     exclusive_wc_locks, memcached_server, dump_load_cross_check = \
             None, None, None, None, None, None, None, None, None, None, \
             None, None, None, None, None, None, None, None, None, None, \
- None, None, None, None, None
+ None, None, None, None, None, None
   for opt, val in opts:
     if opt in ['-u', '--url']:
       base_url = val
@@ -769,6 +774,8 @@
       enable_sasl = 1
     elif opt in ['--parallel']:
       parallel = val
+ elif opt in ['--copyright']:
+ copyright_year = val
     elif opt in ['--config-file']:
       config_file = val
     elif opt in ['--log-to-stdout']:
@@ -807,8 +814,8 @@
 
   th = TestHarness(args[0], args[1], logfile, faillogfile,
                    base_url, fs_type, http_library, server_minor_version,
- verbose, cleanup, enable_sasl, parallel, config_file,
- fsfs_sharding, fsfs_packing, list_tests,
+ verbose, cleanup, enable_sasl, parallel, copyright_year,
+ config_file, fsfs_sharding, fsfs_packing, list_tests,
                    mode_filter=mode_filter, milestone_filter=milestone_filter,
                    set_log_level=set_log_level, ssl_cert=ssl_cert,
                    http_proxy=http_proxy,
Index: subversion/tests/cmdline/getopt_tests.py
===================================================================
--- subversion/tests/cmdline/getopt_tests.py (revision 1667950)
+++ subversion/tests/cmdline/getopt_tests.py (working copy)
@@ -48,14 +48,26 @@
 # Then append either _stdout or _stderr for the file descriptor to
 # compare against.
 
+replace_copyright_re = re.compile(r'Copyright \(C\) 20\d\d'
+ ' The Apache Software Foundation\.\n')
+replace_copyright_text = 'Copyright (C) %d The Apache Software Foundation.\n'
+
 def load_expected_output(basename):
   "load the expected standard output and standard error"
 
+ def filter_expected(filename):
+ expected = []
+ for line in open(filename, 'r').readlines():
+ if replace_copyright_re.match(line):
+ line = replace_copyright_text % svntest.main.options.copyright_year
+ expected.append(line)
+ return expected
+
   stdout_filename = os.path.join(getopt_output_dir, basename + '_stdout')
   stderr_filename = os.path.join(getopt_output_dir, basename + '_stderr')
 
- exp_stdout = open(stdout_filename, 'r').readlines()
- exp_stderr = open(stderr_filename, 'r').readlines()
+ exp_stdout = filter_expected(stdout_filename)
+ exp_stderr = filter_expected(stderr_filename)
 
   return exp_stdout, exp_stderr
 
@@ -92,10 +104,6 @@
                  # "Subversion Client, version 0.10.2 (r1729)"
                  (re.compile(r'version \d+\.\d+\.\d+(-[^ ]*)? \(.*\)'),
                   'version X.Y.Z '),
- # The copyright end date keeps changing; fix forever.
- (re.compile(r'Copyright \(C\) 20\d\d The Apache '
- 'Software Foundation\.'),
- 'Copyright (C) YYYY The Apache Software Foundation'),
                  # In 'svn --version --quiet', we print only the version
                  # number in a single line.
                  (re.compile(r'^\d+\.\d+\.\d+(-[a-zA-Z0-9]+)?$'), 'X.Y.Z\n'),
Index: subversion/tests/cmdline/svntest/main.py
===================================================================
--- subversion/tests/cmdline/svntest/main.py (revision 1667950)
+++ subversion/tests/cmdline/svntest/main.py (working copy)
@@ -26,6 +26,7 @@
 import sys
 import os
 import shutil
+import datetime
 import re
 import stat
 import subprocess
@@ -80,6 +81,7 @@
 # Global stuff
 
 default_num_threads = 5
+default_copyright_year = datetime.datetime.now().year
 
 # Don't try to use this before calling execute_tests()
 logger = None
@@ -1618,6 +1620,8 @@
       args.append('--fsfs-version=' + str(options.fsfs_version))
     if options.dump_load_cross_check:
       args.append('--dump-load-cross-check')
+ if options.copyright_year != default_copyright_year:
+ args.append('--copyright=' + str(options.copyright_year))
 
     result, stdout_lines, stderr_lines = spawn_process(command, 0, False, None,
                                                        *args)
@@ -1926,6 +1930,9 @@
                     help='Whether to enable SASL authentication')
   parser.add_option('--bin', action='store', dest='svn_bin',
                     help='Use the svn binaries installed in this path')
+ parser.add_option('--copyright', action='store', type='int',
+ default=default_copyright_year, dest='copyright_year',
+ help='Set the expected copyright year of the svn binaries')
   parser.add_option('--use-jsvn', action='store_true',
                     help="Use the jsvn (SVNKit based) binaries. Can be " +
                          "combined with --bin to point to a specific path")
Received on 2015-03-20 14:35:17 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.