[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:44:12 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=b6db775

The following commit has been merged in the master branch:
commit b6db775109bb4d67209010194451cc5a3983d370
Author: Robin Mills <robin at clanmills.com>
Date:   Wed Jul 2 14:21:41 2014 +0000

    add svn=nnnn to exiv2 -v -V
---
 src/Makefile       | 23 +++++++++++++++--------
 src/svn_version.sh | 17 +++++++++++++++++
 src/version.cpp    |  1 +
 src/version.hpp    |  2 ++
 4 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index a42ba90..0295e91 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -59,13 +59,14 @@ include $(top_srcdir)/config/config.mk
 # Source files
 
 # Add standalone C++ header files to this list
-CCHDR =  exiv2.hpp             \
-         exv_conf.h            \
-         exv_msvc.h            \
+CCHDR =  exiv2.hpp         \
+         exv_conf.h        \
+         exv_msvc.h        \
+         svn_version.h     \
          version.hpp
 
 # Add library C++ source files to this list
-CCSRC =  asfvideo.cpp          \
+CCSRC =  asfvideo.cpp      \
 	 basicio.cpp           \
 	 bmpimage.cpp          \
 	 canonmn.cpp           \
@@ -215,12 +216,18 @@ ifdef DEP_TRACKING
 -include $(DEP)
 endif
 
-# Be sure to rewrite exv_conf.h before compiling anything
-$(SRC): exv_conf.h
+# Be sure to rewrite exv_conf.h and svn_version.h before compiling anything
+$(SRC): exv_conf.h svn_version.h
 
 exv_conf.h: $(top_srcdir)/config/config.h
 	LC_ALL=C sed 's/#define \([A-Z]\)/#define EXV_/; s/#undef \([A-Z]\)/#undef EXV_/' < $< > $@
 
+# svn_version.h is only rewritten when the svn info | grep Revision has changed
+svn_version.h:
+	svn_version.sh
+	
+version.hpp : svn_version.h
+	
 $(LIBTOOL): $(LIBTOOL_DEPS)
 	$(SHELL) $(top_srcdir)/config.status --recheck
 
@@ -230,7 +237,7 @@ lib: $(OBJ)
 	$(LIBTOOL) --mode=link $(LINK.cc) -o $(LIBRARY) $(LOBJ) -rpath $(libdir) -version-info $(EXIV2_LTVERSION) $(LIBS)
 	@touch lib
 
-$(EXIV2BIN): lib $(EXIV2OBJ) $(EXIV2COBJ)
+$(EXIV2BIN): lib $(EXIV2OBJ) $(EXIV2COBJ) svn_version.h
 	-mkdir -p ../bin >/dev/null 2>&1
 	@$(LIBTOOL) --mode=link $(LINK.cc) -o $@ $(LIBRARY) $(EXIV2OBJ) $(EXIV2COBJ) -rpath $(libdir)
 
@@ -289,7 +296,7 @@ mostlyclean:
 	$(RM) core
 	$(RM) $(CCSRC:.cpp=.ii)
 	$(RM) lib
-	$(RM) exv_conf.h
+	$(RM) exv_conf.h svn_version.h
 	$(RM) $(CCSRC:%.cpp=.libs/%.d) $(CSRC:%.c=.libs/%.d)
 	@$(LIBTOOL) --mode=clean $(RM) $(LOBJ) $(sort $(EXIV2OBJ) $(EXIV2COBJ) )
 
diff --git a/src/svn_version.sh b/src/svn_version.sh
new file mode 100755
index 0000000..c0bd26a
--- /dev/null
+++ b/src/svn_version.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+## 
+# update svn_version.h when the revision has changed
+svn_version=$(svn info .. | grep ^Revision | cut -f 2 -d' ')
+if [ -e svn_version.h ]; then
+	old=$(cut -f 3 -d' ' svn_version.h)
+	if [ "$old" != "$svn_version" ]; then
+		rm -rf svn_version.h
+	fi
+fi
+if [ ! -e svn_version.h ]; then
+	echo "#define SVN_VERSION $svn_version" > svn_version.h
+fi
+
+# That's All Folks!
+##
diff --git a/src/version.cpp b/src/version.cpp
index 5c20180..59a7957 100644
--- a/src/version.cpp
+++ b/src/version.cpp
@@ -259,6 +259,7 @@ EXIV2API void dumpLibraryInfo(std::ostream& os)
     os << "version="  << __VERSION__            << endl;
     os << "date="     << __DATE__               << endl;
     os << "time="     << __TIME__               << endl;
+    os << "svn="      << SVN_VERSION            << endl;
 
     if ( libs.begin() != libs.end() ) {
         os << "executable=" << *libs.begin() << endl;
diff --git a/src/version.hpp b/src/version.hpp
index 06d1592..5cabde7 100644
--- a/src/version.hpp
+++ b/src/version.hpp
@@ -37,6 +37,8 @@
 // + standard includes
 #include <string>
 
+#include "svn_version.h"
+
 /*!
   @brief %Exiv2 MAJOR version number of the library used at compile-time.
  */

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list