- Timestamp:
- Dec 29, 2007, 3:40:23 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/THANKS
r519 r540 18 18 the generated CSS file, svndigest.css. 19 19 20 During the build process svndigest automagically incorporate its 21 current svn revision into the source and binary. The solution, 22 suggested Markus Hoenicka, works both when being in a subversion WC 23 (using svnversion) and when being outside. Hoenicka's suggestion can 24 be found here: 25 26 http://www.mhoenicka.de/system-cgi/blog/index.php?itemid=999 20 27 21 28 ----------------------------------------------------------------------- -
trunk/bin/Parameter.cc
r538 r540 25 25 26 26 #include "ColumnStream.h" 27 #include "subversion_info.h" 27 28 #include "utility.h" 28 29 #include <config.h> // this header file is created by configure 29 30 31 #include <cstddef> 30 32 #include <fstream> 31 33 #include <iostream> … … 116 118 } 117 119 else if (myargv=="--version"){ 118 version();119 exit(0);120 version_=true; 121 ok=true; 120 122 } 121 123 else if (myargv=="-vf" || myargv=="-fv"){ … … 130 132 } 131 133 134 if (version_){ 135 version(verbose_); 136 exit(0); 137 } 132 138 analyse(); 133 139 } … … 191 197 targetdir_="."; 192 198 verbose_=false; 199 version_=false; 193 200 } 194 201 … … 238 245 239 246 240 void Parameter::version( void) const247 void Parameter::version(bool verbose) const 241 248 { 242 249 ColumnStream cs(std::cout, 1); 243 250 cs.width(0)=79; 244 cs << PACKAGE_STRING 245 << "\nCopyright (C) 2007 Jari Häkkinen and Peter Johansson.\n\n" 251 cs << PACKAGE_STRING; 252 if (verbose_) { 253 cs << " (r" << svn_revision() << ")\n" 254 << " compiled " << __DATE__ ", " << __TIME__ << "\n"; 255 } 256 257 cs << "\nCopyright (C) " << svn_year() 258 << " Jari Häkkinen and Peter Johansson.\n\n" 246 259 << "This is free software; see the source for copying conditions. " 247 260 << "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR " -
trunk/bin/Parameter.h
r538 r540 54 54 void defaults(void); 55 55 void help(void); 56 void version( void) const;56 void version(bool=false) const; 57 57 58 58 std::string config_file_; … … 66 66 std::string targetdir_; 67 67 bool verbose_; 68 bool version_; 68 69 }; 69 70 -
trunk/configure.ac
r519 r540 122 122 AC_SEARCH_LIBS([svn_client_log3],[svn_client-1],,svn_found="no") 123 123 124 125 # check if svnversion is installed 126 have_svnversion="yes" 127 AC_PATH_PROG(SVNVERSION, svnversion, have_svnversion="no") 128 129 wc_found="no"; 130 if (test `$SVNVERSION -n '.'` != "exported"); then 131 wc_found="yes"; 132 fi 133 AC_CHECK_FILE("lib/subversion_info.h", info_found="yes", info_found="no") 134 135 # devel version should have svn WC and SVNVERSION installed 136 AM_CONDITIONAL(HAVE_SVN_WC, test "$wc_found" = "yes" ) 137 138 124 139 AC_CONFIG_FILES([Makefile 125 140 bin/Makefile … … 133 148 # used to trigger exit before creation of output 134 149 all_reqs_ok="true" 150 151 # 152 if (test "$info_found" = "no" && test "$wc_found" = "no") ; then 153 AC_MSG_WARN([Cannot find sources (lib/subverion_info.h).]) 154 if (test "$svnversion" = "no") ; then 155 AC_MSG_WARN([If you grabbed the source from the subversion repository, 156 the file will be generated automatically. However, svnversion cannot 157 be found and therefore the file cannot be generated. Please install 158 svnversion and make sure it is in your search path.]) 159 else 160 AC_MSG_WARN([If you grabbed the source from the subversion repository, 161 the file will be generated automatically. However, the output from 162 svnversion was incorrect. Either your installation of svnversion is 163 is not healthy or there is something wrong with the repository.]) 164 fi 165 all_reqs_ok="false" 166 fi 135 167 136 168 # Non-existing APR is fatal -- sub-sequent compilation will fail. -
trunk/lib/Makefile.am
r532 r540 42 42 SVNblame.cc SVNinfo.cc SVNlog.cc SVNproperty.cc Trac.cc utility.cc 43 43 44 BUILT_SOURCES=subversion_info.h 45 46 EXTRA_DIST=subversion_info.h 47 44 48 clean-local: 45 rm -rf *~ 49 rm -rf *~ subversion_info.h 50 51 all-local: 52 53 if HAVE_SVN_WC 54 subversion_info.h: subversion_info.h.tmp 55 @if [ ! -f $@ ]; then touch $@; fi; \ 56 diff $@ subversion_info.h.tmp > subversion_info.h.diff; \ 57 if test -s "subversion_info.h.diff"; then \ 58 mv subversion_info.h.tmp subversion_info.h; \ 59 $(ECHO) creating subversion_info.h; \ 60 fi; \ 61 rm -f subversion_info.h.tmp subversion_info.h.diff ; 62 63 64 subversion_info.h.tmp: FORCE 65 @$(ECHO) '// svn_version.h generated from svn_version.h.in.' > $@ ;\ 66 revision=`$(SVNVERSION) $(top_srcdir)` ;\ 67 year=`svn info $(top_srcdir)| sed -n 's/.*Date: \(.*\)-..-.*/\1/p'`;\ 68 echo $$year; \ 69 $(SED) -e 's/sub_2_svn_revision/'$$revision'/g' \ 70 -e 's/sub_2_svn_year/'$$year'/g' subversion_info.h.in >> $@ ; 71 endif 72 73 FORCE: -
trunk/lib/Parser.h
r536 r540 48 48 /// 49 49 enum line_type { 50 copyright, 50 51 other, 51 52 comment, -
trunk/test/Makefile.am
r519 r540 40 40 utility_test_SOURCES = utility_test.cc 41 41 42 rootdir = $(srcdir)/toy_project 43 targetdir = $(builddir)/generated_output 44 do_subst = $(SED) -e 's,@srcdir,$(srcdir),g' \ 45 -e 's,@top_builddir,$(top_builddir),g' \ 46 -e 's,@builddir,$(builddir),g' \ 47 -e 's,@MKDIR_P,$(MKDIR_P),g' \ 48 -e 's,@rootdir,$(rootdir),g' \ 49 -e 's,@targetdir,$(targetdir),g' \ 50 -e 's,@SHELL,$(SHELL),g' 42 rootdir = $(abs_srcdir)/toy_project 43 targetdir = $(abs_builddir)/generated_output 44 repodir = $(abs_srcdir)/repo/trunk 45 46 do_subst = $(SED) -e 's,%SHELL%,$(SHELL),g' \ 47 -e 's,%SED%,$(SED),g' \ 48 -e 's,%DISTFILES%,$(DISTFILES),g' \ 49 -e 's,%GREP%,$(GREP),g' \ 50 -e 's,%abs_srcdir%,$(abs_srcdir),g' \ 51 -e 's,%repodir%,$(repodir),g' \ 52 -e 's,%rootdir%,$(rootdir),g' \ 53 -e 's,%targetdir%,$(targetdir),g' \ 54 -e 's,%abs_top_builddir%,$(abs_top_builddir),g' 55 51 56 52 57 check_repo_status.sh: check_repo_status.sh.in Makefile 53 58 @$(do_subst) < $< > $@ 54 59 @chmod +x $@ 55 @echo creat e$@60 @echo creating $@ 56 61 57 62 test_repo.sh: test_repo.sh.in Makefile 58 63 @$(do_subst) < $< > $@ 59 64 @chmod +x $@ 60 @echo creat e$@65 @echo creating $@ 61 66 62 67 clean-local: -
trunk/test/check_repo_status.sh.in
r519 r540 1 #! @SHELL1 #!%SHELL% 2 2 # $Id$ 3 3 -
trunk/test/test_repo.sh.in
r539 r540 1 #! @SHELL1 #!%SHELL% 2 2 # $Id$ 3 3 … … 22 22 23 23 # test repository does not exist and need to be checked out 24 if [ ! -d @rootdir]; then25 repodir=`cd " @srcdir" && pwd`;24 if [ ! -d %rootdir% ]; then 25 repodir=`cd "%abs_srcdir%" && pwd`; 26 26 repodir=$repodir"/repo/trunk"; 27 svn checkout file://$repodir @rootdir;27 svn checkout file://$repodir %rootdir%; 28 28 fi 29 29 30 svn update @rootdir> /dev/null;30 svn update %rootdir% > /dev/null; 31 31 32 if [ ! -d @targetdir]; then33 mkdir @targetdir;32 if [ ! -d %targetdir% ]; then 33 mkdir %targetdir%; 34 34 fi 35 35 36 @top_builddir/bin/svndigest -r @rootdir -t @targetdir-f \36 %abs_top_builddir%/bin/svndigest -r %rootdir% -t %targetdir% -f \ 37 37 --ignore-cache --no-report $1; 38 38 39 @top_builddir/bin/svndigest -r @rootdir -t @targetdir-f --copyright $1;39 %abs_top_builddir%/bin/svndigest -r %rootdir% -t %targetdir% -f --copyright $1; 40 40
Note: See TracChangeset
for help on using the changeset viewer.