FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 07-29-2011, 12:08 PM
Martin Gracik
 
Default Write the lorax verion in the .buildstamp (#689697)

---
Makefile | 3 ++-
setup.py | 15 ++++++++++++++-
src/pylorax/buildstamp.py | 10 ++++++++++
3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 66b1b00..f1a2f84 100644
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,7 @@ all:
$(PYTHON) setup.py build

install: all
+ @echo "num = '$(VERSION)-$(RELEASE)'" > src/pylorax/version.py
$(PYTHON) setup.py install --root=$(DESTDIR)

clean:
@@ -28,7 +29,7 @@ archive: tag

local:
@rm -rf $(PKGNAME)-$(VERSION).tar.bz2
- @rm -rf /tmp/$(PKGNAME)-$(VERSION) /tmp/$(PKGNAME)
+ @rm -rf /tmp/$(PKGNAME)-$(VERSION)
@dir=$$PWD; cp -a $$dir /tmp/$(PKGNAME)-$(VERSION)
@rm -rf /tmp/$(PKGNAME)-$(VERSION)/.git
@dir=$$PWD; cd /tmp; tar --bzip2 -cSpf $$dir/$(PKGNAME)-$(VERSION).tar.bz2 $(PKGNAME)-$(VERSION)
diff --git a/setup.py b/setup.py
index e026651..5b710f0 100644
--- a/setup.py
+++ b/setup.py
@@ -3,6 +3,7 @@
from distutils.core import setup
from glob import glob
import os
+import sys


# config file
@@ -17,8 +18,20 @@ for root, dnames, fnames in os.walk("share"):
# executable
data_files.append(("/usr/sbin", ["src/sbin/lorax"]))

+# get the version
+sys.path.insert(0, "src")
+try:
+ import pylorax.version
+except ImportError:
+ vernum = "devel"
+else:
+ vernum = pylorax.version.num
+finally:
+ sys.path = sys.path[1:]
+
+
setup(name="lorax",
- version="0.1",
+ version=vernum,
description="Lorax",
long_description="",
author="Martin Gracik",
diff --git a/src/pylorax/buildstamp.py b/src/pylorax/buildstamp.py
index 97f0477..0c06ce5 100644
--- a/src/pylorax/buildstamp.py
+++ b/src/pylorax/buildstamp.py
@@ -41,6 +41,14 @@ class BuildStamp(object):
self.uuid = "{0}.{1}".format(now, buildarch)

def write(self):
+ # get lorax version
+ try:
+ import pylorax.version
+ except ImportError:
+ vernum = "devel"
+ else:
+ vernum = pylorax.version.num
+
logger.info("writing .buildstamp file")
with open(self.path, "w") as fobj:
fobj.write("[Main]
")
@@ -49,3 +57,5 @@ class BuildStamp(object):
fobj.write("BugURL={0.bugurl}
".format(self))
fobj.write("IsFinal={0.isfinal}
".format(self))
fobj.write("UUID={0.uuid}
".format(self))
+ fobj.write("[Compose]
")
+ fobj.write("Lorax={0}
".format(vernum))
--
1.7.3.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 01:12 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org