[ZBX-11994] More civilized way to get last changed revision Created: 2017 Mar 29  Updated: 2024 Apr 10  Resolved: 2018 Mar 06

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Installation (I)
Affects Version/s: 3.4.0alpha1
Fix Version/s: 4.0.0alpha5, 4.0 (plan)

Type: Incident report Priority: Trivial
Reporter: Glebs Ivanovskis (Inactive) Assignee: Michael Veksler
Resolution: Fixed Votes: 1
Labels: compilation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File revisionv2.patch    
Epic Link: DEV-591
Team: Team C
Sprint: Sprint 27, Sprint 28, Sprint 29
Story Points: 0.5

 Description   

Suggested patch:

Index: Makefile.am
===================================================================
--- Makefile.am	(revision 66884)
+++ Makefile.am	(working copy)
@@ -20,7 +20,7 @@
 
 ## "dist-hook" run after the distribution directory is filled, but before the actual tar (or shar) file is created.
 dist-hook:
-	@zabbix_revision=`svn info|grep "Last Changed Rev"|awk '{print $$4;}'`; \
+	@zabbix_revision=`svn info --show-item last-changed-revision`; \
 	cat $(top_distdir)/include/version.h|sed "s/{ZABBIX_REVISION}/$$zabbix_revision/g" > $(top_distdir)/include/version.h.new; \
 	mv $(top_distdir)/include/version.h.new $(top_distdir)/include/version.h; \
 	cat $(top_distdir)/src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java|sed "s/{ZABBIX_REVISION}/$$zabbix_revision/g" > \


 Comments   
Comment by Oleksii Zagorskyi [ 2017 Mar 29 ]

That reminded me about a time in ZBX-2512, when I wanted to have actual revision number (instead of {ZABBIX_REVISION} text) in output of zabbix_daemon -V if compile zabbix from svn checkout but not from tar.gz.
Trying to think about it now ... we could introduce some check on early stage of make command and if the {ZABBIX_REVISION} is still not substituted in "version.h", try to get local svn info and put revision number to the {ZABBIX_REVISION}.

Then, we probably need to add "svn revert include/version.h" somewhere before the substitution.
Need to remember also about GeneralInformation.java

Heh, sorry for the noise

Comment by Sergejs Paskevics [ 2018 Mar 06 ]

Successfully tested

Generated at Wed Apr 24 15:14:00 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.