[asterisk-bugs] [Asterisk 0013223]: [patch] Generate a version when asterisk is built in a git repository

Asterisk Bug Tracker noreply at bugs.digium.com
Sat Aug 2 14:32:02 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13223 
====================================================================== 
Reported By:                tzafrir
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13223
Category:                   Core/BuildSystem
Reproducibility:            always
Severity:                   tweak
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 133488 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-08-02 11:09 CDT
Last Modified:              2008-08-02 14:32 CDT
====================================================================== 
Summary:                    [patch] Generate a version when asterisk is built in
a git repository
Description: 
Currently asterisk knows to generate version.h from two potential sources:

1. a .version file in the source tree. This is used for tarballs or
tarballs.
2. 'svn info' when building an a subversion repository and there's no
.version file.

This patch adds handling to building in a git repository, similar to (2):

* Like in (2), the numeric version number is 999999.
* Unlike in (2), though, I could not think of a nice way to derive a text
version string. Thus the version name is simply "GIT".

Without the Makefile part of this patch, building fails in a git
repository (specifically: at res/res_snmp.c). Thus I do not consider it a
feature.

The current patch is vs. 1.4. A similar patch should probably work vs.
1.6. I'll add one soon.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0013132 [patch] dummy-select - a simplified men...
====================================================================== 

---------------------------------------------------------------------- 
 (0091020) tzafrir (manager) - 2008-08-02 14:32
 http://bugs.digium.com/view.php?id=13223#c91020 
---------------------------------------------------------------------- 
hmm... is the the right fix?

in git, the .git subdirectory is only at the top-level directory of the
repository. While I expect asterisk to be a single component, it may not be
the case. Someone may decide to make Asterisk part of a larger project. And
the the main asterisk directory will have no .git subdirectory.

Also, let's consider other version control systems. IIRC bzr and mercurial
are similar to git in that respect (a single subdirectory, .bzr/.hg under
the toplevel directory of the project. With svk there is no such
subdirectory for the whole tree (it is all under your $HOME/.svk).

So maybe make those changes:

if no file .version: use version number 999999 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-08-02 14:32 tzafrir        Note Added: 0091020                          
======================================================================




More information about the asterisk-bugs mailing list