Author Topic: svn builds should report the version number  (Read 15664 times)

tduell

  • Newbie
  • *
  • Posts: 38
  • Karma: 0
  • Scribus User
Re: svn builds should report the version number
« Reply #15 on: December 15, 2013, 04:56:36 am »
This is cool sleuthing. You might get more immediate help if you post to the Scribus mailing list lists.scribus.net

Thanks. Yes, I guess the mailing list is the place for this stuff, but I'm really on the periphery, and don't fancy yet another mailing list.

Cheers,
Terry

Kunda

  • Administrator
  • Full Member
  • *****
  • Posts: 218
  • Karma: 2
  • Scribus User
Re: svn builds should report the version number
« Reply #16 on: December 16, 2013, 05:14:44 pm »
FYI You can also try the #Scribus chat room on IRC through http://wiki.scribus.net/canvas/Special:WebChat and talk to the devs directly at least when they are there. Be patient waiting for a reply.

tduell

  • Newbie
  • *
  • Posts: 38
  • Karma: 0
  • Scribus User
Re: svn builds should report the version number
« Reply #17 on: December 16, 2013, 11:36:54 pm »
Yes, thanks.
I was advised about the chat room a while back, but I suspect timezones may be a bit of a problem.
I'll stick to an occasional email, I find it a Much more convenient medium.
Cheers,
Terry

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1811
  • Karma: 26
    • the graphics lab
Re: svn builds should report the version number
« Reply #18 on: January 20, 2014, 09:26:34 pm »
hi

i had a look at it and i have a bad feeling about it.

the problem is, that svnversion can be run at cmake time only, but when you're updating from svn and recompiling you mostly don't run cmake again.
in this case the value you will be seeing the about dialog won't have much significance.

also, the best way to inject the svn version number into the about dialog, is by generating at cmake time a .h file that will be then included in the c++ code.
the problem is that you now have a file in your source tree that should not be included in the svn repository (and probably be added to a svn ignore file).

all in all, it does not seem easy to add a valuable information in a non invasive way.

i don't know, since the issue is not really of strategic importance, i think that if nobody comes up with suggestions to make it easier to integrate, i prefer to concentrate on other tasks!

sorry
a.l.e

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1811
  • Karma: 26
    • the graphics lab
Re: svn builds should report the version number
« Reply #19 on: January 20, 2014, 09:30:43 pm »
p.s.: for the archive... this is the diff of the end result for my tests:
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt   (revision 18749)
+++ CMakeLists.txt   (working copy)
@@ -57,6 +57,23 @@
 ENDIF (VERSION_SUFFIX)
 MESSAGE(STATUS "Scribus ${VERSION} will be built to install into ${CMAKE_INSTALL_PREFIX}")
 
+#SET (VERSION_SVN "1234")
+#add_definitions(-DVERSION_SVN="1235")
+
+FIND_PROGRAM(SVN_EXECUTABLE svn
+  DOC "subversion command line client")
+
+MACRO(Subversion_GET_REVISION variable)
+  EXECUTE_PROCESS(COMMAND ${SVN_EXECUTABLE} info ${CMAKE_CURRENT_LIST_DIR}
+    OUTPUT_VARIABLE ${variable}
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+  STRING(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
+    "\\2" ${variable} "${${variable}}")
+ENDMACRO(Subversion_GET_REVISION)
+
+Subversion_GET_REVISION(ProjectRevision)
+MESSAGE(STATUS "Revision is ${ProjectRevision}")
+
 #Set the permissions to be used when installing plugins
 SET(PLUGIN_PERMISSIONS WORLD_EXECUTE GROUP_EXECUTE OWNER_EXECUTE WORLD_READ GROUP_READ OWNER_READ OWNER_WRITE)
 
Index: scribus/main_nix.cpp
===================================================================
--- scribus/main_nix.cpp   (revision 18749)
+++ scribus/main_nix.cpp   (working copy)
@@ -68,6 +68,7 @@
 {
    emergencyActivated=false;
 
+  std::cout << "svn version" << VERSION_SVN << std::endl;
    ScribusQApp app(argc, argv);
    initCrashHandler();
 /* possible fix for the Qt-4.4.0 locale problem */

tduell

  • Newbie
  • *
  • Posts: 38
  • Karma: 0
  • Scribus User
Re: svn builds should report the version number
« Reply #20 on: January 20, 2014, 11:18:14 pm »

all in all, it does not seem easy to add a valuable information in a non invasive way.

i don't know, since the issue is not really of strategic importance, i think that if nobody comes up with suggestions to make it easier to integrate, i prefer to concentrate on other tasks!


OK.

 

palmate