aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stokes <ajs@redhat.com>2010-07-29 09:10:00 +0100
committerBryn M. Reeves <bmr@redhat.com>2010-07-29 09:10:00 +0100
commitae31d6bf394a6d22f2678a0ee7b8a26d9fb51a3e (patch)
tree12a361c4facc1ea771523aa207f9bd6bdca2d4fa
parentf107d6b5730ebd7bba3e2f5a108a9d3d9aeb38b5 (diff)
downloadsos-ae31d6bf394a6d22f2678a0ee7b8a26d9fb51a3e.tar.gz
Set SOSVERSION during build to ensure it is reported correctly
Resolves: bz585942
-rw-r--r--Makefile1
-rw-r--r--sos/__init__.py.in (renamed from sos/__init__.py)1
-rwxr-xr-xsos/sosreport.py2
3 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 5a4600a9..2e677354 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,7 @@ install:
install -m644 LICENSE README TODO $(DESTDIR)/usr/share/$(NAME)/.
install -m644 $(NAME).conf $(DESTDIR)/etc/$(NAME).conf
install -m644 gpgkeys/rhsupport.pub $(DESTDIR)/usr/share/$(NAME)/.
+ sed 's/@SOSVERSION@/$(VERSION)/g'<sos/__init__.py.in >sos/__init__.py
for d in $(SUBDIRS); do make DESTDIR=`cd $(DESTDIR); pwd` -C $$d install; [ $$? = 0 ] || exit 1; done
$(NAME)-$(VERSION).tar.gz: clean gpgkey
diff --git a/sos/__init__.py b/sos/__init__.py.in
index 335332b1..64b87506 100644
--- a/sos/__init__.py
+++ b/sos/__init__.py.in
@@ -22,5 +22,6 @@ gettext_app = "sos"
gettext.bindtextdomain(gettext_app, gettext_dir)
+__version__="@SOSVERSION@"
def _sos(msg):
return gettext.dgettext(gettext_app, msg)
diff --git a/sos/sosreport.py b/sos/sosreport.py
index a5685b9e..ccacdff4 100755
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -46,8 +46,8 @@ from itertools import *
from collections import deque
from sos import _sos as _
+from sos import __version__
-__version__ = 2.1
if os.path.isfile('/etc/fedora-release'):
__distro__ = 'Fedora'
else: