Changeset 726 for trunk


Ignore:
Timestamp:
Dec 9, 2008, 11:14:16 PM (13 years ago)
Author:
Peter Johansson
Message:

refs #362

lifting out copyright year to its own file. The source file
lib/copyright_year.cc is automatically updated when being in svn wc
(i.e. not dist or svn export).

Location:
trunk/lib
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/lib/Makefile.am

    r706 r726  
    2929
    3030noinst_HEADERS = AddStats.h Alias.h BlameStats.h ClassicStats.h ColumnStream.h \
    31   CommandLine.h Commitment.h Configuration.h css.h\
     31  CommandLine.h Commitment.h Configuration.h copyright_year.h css.h\
    3232  Date.h Directory.h Exception.h File.h first_page.h Functor.h \
    3333  Gnuplot.h GnuplotFE.h \
     
    4040libsvndigest_a_SOURCES = AddStats.cc Alias.cc BlameStats.cc \
    4141  ClassicStats.cc ColumnStream.cc \
    42   CommandLine.cc Commitment.cc Configuration.cc \
     42  CommandLine.cc Commitment.cc Configuration.cc copyright_year.cc \
    4343  css.cc Date.cc Directory.cc File.cc first_page.cc\
    4444  Functor.cc Gnuplot.cc GnuplotFE.cc  HtmlBuf.cc HtmlStream.cc \
     
    6464  @echo '// subversion_info.cc generated from subversion_info.cc.in.' > $@ ;\
    6565  revision=`$(SVNVERSION) $(top_srcdir)` ;\
    66   year=`svn info $(top_srcdir)|$(SED) -n  's/.*Date: \(.*\)-..-.*/\1/p'`;\
    6766  $(SED) -e 's/sub_2_svn_revision/'$$revision'/g' \
    68   -e 's/sub_2_svn_year/'$$year'/g' $(srcdir)/subversion_info.cc.in >> $@ ;
     67  $(srcdir)/subversion_info.cc.in >> $@ ;
     68
     69# update copyright year automatically (if we build from svn wc)
     70$(srcdir)/copyright_year.cc: copyright_year.cc.tmp
     71  @$(SHELL) $(top_srcdir)/build_support/move-if-change $< $@
     72
     73copyright_year.cc.tmp: FORCE
     74  @year=`svn info $(top_srcdir)|$(SED) -n  's/.*Date: \(.*\)-..-.*/\1/p'`;\
     75  $(SED) -e 's/20[0-9][0-9]/'$$year'/g' $(srcdir)/copyright_year.cc > $@ ;
    6976endif
    7077
  • trunk/lib/OptionVersion.cc

    r724 r726  
    2222#include <config.h>
    2323
     24#include "copyright_year.h"
    2425#include "OptionVersion.h"
    2526#include "ColumnStream.h"
  • trunk/lib/copyright_year.cc

    r723 r726  
    2020*/
    2121
    22 #include "subversion_info.h"
     22#include "copyright_year.h"
    2323#include <string>
    2424
     
    2626namespace svndigest{
    2727
    28   std::string compilation_date(void)
    29   {
    30     return __DATE__;
    31   }
    32 
    33 
    34   std::string compilation_time(void)
    35   {
    36     return __TIME__;
    37   }
    38 
    39 
    40   std::string svn_revision(void)
    41   {
    42     return "sub_2_svn_revision";
    43   }
    44 
    45 
    4628  std::string svn_year(void)
    4729  {
    48     return "sub_2_svn_year";
     30    return "2008";
    4931  }
    5032
  • trunk/lib/copyright_year.h

    r723 r726  
    1 #ifndef _theplu_svndigest_subversion_info_
    2 #define _theplu_svndigest_subversion_info_
     1#ifndef _theplu_svndigest_copyright_year_
     2#define _theplu_svndigest_copyright_year_
    33
    44// $Id$
     
    2828namespace svndigest{
    2929
    30   // These functions are (mis)placed here to reflect compilation time
    31   // of subversion_info.cc. Previously, __TIME__ macro was placed in
    32   // `bin/Parameter.cc' and since the Parameter is almost independent
    33   // of other parts of the package, that compilation time does not
    34   // very accurately reflect the building time of the svndigest
    35   // binary. subversion_info.cc is at least modified when updating
    36   // against repository and therefore these functions will return a
    37   // time no earlier than last `svn update'
    38   std::string compilation_date(void);
    39   std::string compilation_time(void);
    40 
    41   std::string svn_revision(void);
    42 
     30  /**
     31     \return year svndigest was last changed
     32   */
    4333  std::string svn_year(void);
    4434
  • trunk/lib/subversion_info.cc.in

    r693 r726  
    4343  }
    4444
    45 
    46   std::string svn_year(void)
    47   {
    48     return "sub_2_svn_year";
    49   }
    50 
    5145}} // end of namespace svndigest and namespace theplu
  • trunk/lib/subversion_info.h

    r693 r726  
    4141  std::string svn_revision(void);
    4242
    43   std::string svn_year(void);
    44 
    4543}} // end of namespace svndigest and namespace theplu
    4644
Note: See TracChangeset for help on using the changeset viewer.