Skip to content
Snippets Groups Projects
Commit 9c48d9de authored by chrfranke's avatar chrfranke
Browse files

Makefile.am: Use 'svnversion' instead of 'svn info' to get the revision number.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2850 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 0bce5b2b
Branches
No related tags found
No related merge requests found
......@@ -42,6 +42,10 @@ NOTES FOR FUTURE RELEASES: see TODO file.
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
[CF] Makefile.am: Use 'svnversion' instead of 'svn info' to get
the revision number. This also checks for mixed and modified
working copies.
[CF] Remove CVS Id strings from '-V, --version' output.
[CF] Update CONTRIBUTORS section on man pages.
......
......@@ -281,16 +281,17 @@ if IS_SVN_BUILD
# Get version info from SVN
svnversion.h: CHANGELOG Makefile $(srcdir)/.svn/entries
echo '/* svnversion.h. Generated by Makefile from svn info. */' > $@
chg="`(cd $(srcdir) && svn status -q 2>/dev/null | sed 's,^.*$$,+,;q')`" && \
(cd $(srcdir) && TZ= svn info 2>/dev/null ) \
| sed -n 'h;s,^.* Rev: *\([^ ]*\)$$,REV "\1'"$$chg"'",p;s,^.* Date: *\([^ ]*\) .*$$,DATE "\1",p;g;s,^.* Date: *[^ ]* *\([^ ]*\) .*$$,TIME "\1",p' \
(cd $(srcdir) \
&& svnversion 2>/dev/null | sed -n 's,^\([0-9].*\),REV "\1",p' \
&& TZ= svn info 2>/dev/null \
| sed -n 'h;s,^.* Date: *\([^ ]*\) .*$$,DATE "\1",p;g;s,^.* Date: *[^ ]* *\([^ ]*\) .*$$,TIME "\1",p') \
| sed 's,^,#define SMARTMONTOOLS_SVN_,' >> $@
else
# SVN not available, guess version info from Id strings
svnversion.h: CHANGELOG Makefile
echo '/* svnversion.h. Generated by Makefile from Id strings. */' > $@
(cd $(srcdir) && cat Makefile.am configure.in smart*.in *.cpp *.h *.s) \
(cd $(srcdir) && cat CHANGELOG Makefile.am configure.in smart*.in *.cpp *.h *.s) \
| sed -n 's,^.*\$$[I][d]: [^ ]* \([0-9][0-9]* [0-9][-0-9]* [0-9][:0-9]*\)[^:0-9][^$$]*\$$.*$$,\1,p' \
| sort -n -r \
| sed -n 'h;s,^\([^ ]*\) .*$$,REV "\1~",p;g;s,^[^ ]* \([^ ]*\) .*$$,DATE "\1",p;g;s,^[^ ]* [^ ]* \([^ ]*\)$$,TIME "\1",p;q' \
......
......@@ -48,7 +48,7 @@ AC_MSG_CHECKING([whether this is a build from SVN])
is_svn_build=no
if test -f "$srcdir/.svn/entries"; then
is_svn_build=unknown
if (cd "$srcdir" && svn --version && svn info && svn status -q) >/dev/null 2>&1; then
if (cd "$srcdir" && svn --version && svnversion && svn info) >/dev/null 2>&1; then
is_svn_build=yes
fi
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment