[PATCH v2 06/12] doc: automatically get the version

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Documentation generated by sphinx reference the version of the
project being documented. This version need to be specified via
sphinx's config file.

However, if this version number is simply added there, it's
guaranteed that soon or later it will be out-of-synch with git's
version tag (or the version number present in the Makefile).

Fix this by trying to read the version from git or, if this fails,
from the Makefile.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 Documentation/conf.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 082cf61a5..cfb0be7fb 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -55,10 +55,10 @@ author = "sparse's development community"
 # |version| and |release|, also used in various other places throughout the
 # built documents.
 #
-# The short X.Y version.
-version = u'0.5.9'
 # The full version, including alpha/beta/rc tags.
-release = u'0.5.9'
+release = next(open('../Makefile', 'r')).split('=')[1].rstrip()
+# The short X.Y version.
+version = release.split('-')[0]
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux