Changeset 909


Ignore:
Timestamp:
Nov 29, 2009, 11:43:01 PM (12 years ago)
Author:
Peter Johansson
Message:

Set the copyright year automatically in svndigest-copy-cache. The year
is stored in a file .release_year and AC_DEFINEd and AC_SUBSTed, so it
can be used in both svndigest-copy-cache and svndigest (via
config.h). No need files lib/copyright_year anymore. The file
.release_year is updated same fashion as copyright_year.cc was
previously. A difference is that a change in .release will cause
configure to be rerun, which is expensive but I think we can live with
the cost since it only happens once a year.

Location:
trunk
Files:
1 added
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.am

    r874 r909  
    2727SUBDIRS = lib bin man test
    2828
    29 EXTRA_dist = build_support/move-if-change
     29EXTRA_dist = build_support/move-if-change .release_year
     30MOVE_IF_CHANGE = $(SHELL) $(top_srcdir)/build_support/move-if-change
    3031
    3132clean-local:
    3233  rm -rf svndigest *~
     34
     35.PHONY: .release_year.tmp
     36if HAVE_SVN_WC
     37# update copyright year automatically (if we build from svn wc)
     38$(srcdir)/.release_year: .release_year.tmp
     39  @$(MOVE_IF_CHANGE) $@.tmp $@
     40
     41.release_year.tmp:
     42  @if ($(SVNVERSION) $(top_srcdir) | $(GREP) M > /dev/null); then \
     43     date -u "+%Y" > .release_year.tmp; \
     44  else \
     45     cp $(srcdir)/.release_year $@; \
     46  fi
     47endif
     48
    3349
    3450# This is a workaround to avoid a broken make when .m4 files are
  • trunk/bin/svndigest-copy-cache.as

    r907 r909  
    44# $Id$
    55
    6 # Copyright (C) 2009 Peter Johansson
     6# Copyright (C) @RELEASE_YEAR@ Peter Johansson
    77
    88# This file is part of svndigest, http://dev.thep.lu.se/svndigest
  • trunk/configure.ac

    r907 r909  
    4545                     [Define to home page for this package])
    4646           AC_SUBST([PACKAGE_URL], ["http://dev.thep.lu.se/svndigest"])])
     47
     48# propagate RELEASE_YEAR from file .release_year
     49RELEASE_YEAR=`cat $srcdir/.release_year`
     50AC_SUBST([RELEASE_YEAR])
     51AC_DEFINE_UNQUOTED([RELEASE_YEAR], ["$RELEASE_YEAR"],
     52                   [Define year package was last modified])
     53AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/.release_year'])
    4754
    4855AC_SUBST([SVNDIGEST_MAJOR_VERSION], [MAJOR_VERSION])
  • trunk/lib/Makefile.am

    r898 r909  
    3333
    3434noinst_HEADERS = AddStats.h Alias.h BlameStats.h ClassicStats.h \
    35   Commitment.h Configuration.h copyright_year.h css.h\
     35  Commitment.h Configuration.h css.h \
    3636  Date.h Directory.h File.h first_page.h Functor.h \
    3737  Graph.h \
     
    4444libsvndigest_a_SOURCES = AddStats.cc Alias.cc BlameStats.cc \
    4545  ClassicStats.cc \
    46   Commitment.cc Configuration.cc copyright_year.cc \
     46  Commitment.cc Configuration.cc \
    4747  css.cc Date.cc Directory.cc File.cc first_page.cc\
    4848  Functor.cc Graph.cc HtmlBuf.cc HtmlStream.cc \
     
    7070  $(srcdir)/subversion_info.cc.in >> $@ ;
    7171
    72 # update copyright year automatically (if we build from svn wc)
    73 $(srcdir)/copyright_year.cc: copyright_year.cc.tmp
    74   @$(MOVE_IF_CHANGE) copyright_year.cc.tmp $@
    75 
    76 copyright_year.cc.tmp: FORCE
    77   @if (echo $(SVN_REVISION) | $(GREP) M); then \
    78     $(SED) -e 's/"20[0-9][0-9]"/'\"`date -u "+%Y"`\"'/g' \
    79       $(srcdir)/copyright_year.cc > $@ ; \
    80   else \
    81     cp $(srcdir)/copyright_year.cc $@; \
    82   fi
    83 
    8472else
    8573# this is needed in 'svn export' build
  • trunk/lib/OptionVersion.cc

    r902 r909  
    2222#include <config.h>
    2323
    24 #include "copyright_year.h"
    2524#include "OptionVersion.h"
    2625#include "subversion_info.h"
     
    6564         << ")";
    6665    }
    67     cs << "\n\nCopyright (C) " << svn_year()
     66    cs << "\n\nCopyright (C) " << RELEASE_YEAR
    6867       << " Jari H\u00E4kkinen and Peter Johansson.\n"
    6968       << "This is free software. You may redistribute copies of it under "
Note: See TracChangeset for help on using the changeset viewer.