]> git.ipfire.org Git - pakfire.git/commitdiff
Make version number easily configureable in setup.py.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 17 Jul 2011 12:16:59 +0000 (14:16 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 17 Jul 2011 12:16:59 +0000 (14:16 +0200)
.gitignore
Makefile
pakfire/__init__.py
pakfire/constants.py
setup.py

index 86a607eccbb331ea65b197202a98eeb19e25d20a..1cd1d3f55ac63214ba660854519912f4f878073d 100644 (file)
@@ -1,3 +1,4 @@
 /build
+/pakfire/__version__.py
 /tmp
 *.py[co]
index 5b9c98b1b7058641714858daad03d45891e8363d..85581ed92689993af7fbd41dbbd686516e91155e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 
 DESTDIR ?= /
 
-all: build
+all: po build
 
 .PHONY: build
 build:
@@ -27,3 +27,7 @@ install:
 .PHONY: check
 check:
        ./runpychecker.sh
+
+.PHONY: po
+po:
+       find pakfire -name "*.py" | grep -v "__version__.py" | sort > po/POTFILES.in
index efb21e43af14d9719f0e56484d991b7f69ad94c6..c5b3a6659162d8d0ac85be251ff05e59660c5ea2 100644 (file)
@@ -2,6 +2,6 @@
 
 from base import Pakfire
 
-from constants import *
+from constants import PAKFIRE_VERSION
 
 __version__ = PAKFIRE_VERSION
index 80fa14778490ee155e3c0a6b129566d2dce76eaf..f1f86e8f047962069587ae7d1f55d6ae07a9311f 100644 (file)
@@ -4,7 +4,7 @@ import os.path
 
 from errors import *
 
-PAKFIRE_VERSION = "0.9.2"
+from __version__ import PAKFIRE_VERSION
 
 SYSCONFDIR = "/etc"
 
index 412be67bb5a0a5ba4c4612c641d928273f251f37..50bc2990c5b3f80496dfd030d0a437af7a17ae3b 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -5,11 +5,16 @@ from distutils.core import Extension, setup
 
 from DistUtilsExtra.command import *
 
-#from pakfire.constants import PAKFIRE_VERSION
 PAKFIRE_VERSION = "0.9.2"
 
 _pakfire_module_files = [os.path.join("src", f) for f in os.listdir("src") if f.endswith(".c")]
 
+# Update program version.
+f = open("pakfire/__version__.py", "w")
+f.write("# this file is autogenerated by setup.py\n")
+f.write("PAKFIRE_VERSION = \"%s\"\n" % PAKFIRE_VERSION)
+f.close()
+
 setup(
        name = "pakfire",
        version = PAKFIRE_VERSION,