diff options
author | David Cantrell <dcantrell@redhat.com> | 2009-09-02 12:44:40 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2009-09-04 09:42:39 -1000 |
commit | 210673e9790601d6068dbf053421efe30c13df21 (patch) | |
tree | c6cfc66d54a848b2e734068b47fef0b867a0f0d5 /isys | |
parent | 9134589c4ac029b6fba9643ddcd0954531ebf21d (diff) | |
download | anaconda-210673e9790601d6068dbf053421efe30c13df21.tar.gz anaconda-210673e9790601d6068dbf053421efe30c13df21.tar.xz anaconda-210673e9790601d6068dbf053421efe30c13df21.zip |
Make anaconda know its version number (#520061)
Remove the ANACONDAVERSION environment variable and embed the version
number at build time. The isys.getAnacondaVersion() function returns
the version number to Python code. If need be, it can be extended to
libisys.
Diffstat (limited to 'isys')
-rw-r--r-- | isys/Makefile.am | 5 | ||||
-rw-r--r-- | isys/isys.c | 6 | ||||
-rwxr-xr-x | isys/isys.py | 3 |
3 files changed, 12 insertions, 2 deletions
diff --git a/isys/Makefile.am b/isys/Makefile.am index b434299d1..e591b4020 100644 --- a/isys/Makefile.am +++ b/isys/Makefile.am @@ -27,8 +27,9 @@ endif dist_noinst_HEADERS = *.h -ISYS_CFLAGS = $(NFS_CFLAGS) $(NETWORKMANAGER_CFLAGS) $(LIBNL_CFLAGS) \ - $(LIBNM_GLIB_CFLAGS) $(SELINUX_CFLAGS) +ISYS_CFLAGS = -DVERSION='"$(PACKAGE_VERSION)"' $(NFS_CFLAGS) \ + $(NETWORKMANAGER_CFLAGS) $(LIBNL_CFLAGS) $(LIBNM_GLIB_CFLAGS) \ + $(SELINUX_CFLAGS) ISYS_LIBS = $(RESOLV_LIBS) $(POPT_LIBS) $(EXT2FS_LIBS) $(ZLIB_LIBS) \ $(DEVMAPPER_LIBS) $(BLKID_LIBS) $(X11_LIBS) $(SELINUX_LIBS) \ $(LIBNL_LIBS) $(LIBNM_GLIB_LIBS) diff --git a/isys/isys.c b/isys/isys.c index 8a83a546b..fc4b81779 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -128,6 +128,7 @@ static PyObject * doPrefixToNetmask(PyObject *s, PyObject *args); static PyObject * doGetBlkidData(PyObject * s, PyObject * args); static PyObject * doIsCapsLockEnabled(PyObject * s, PyObject * args); static PyObject * doGetLinkStatus(PyObject * s, PyObject * args); +static PyObject * doGetAnacondaVersion(PyObject * s, PyObject * args); static PyMethodDef isysModuleMethods[] = { { "ejectcdrom", (PyCFunction) doEjectCdrom, METH_VARARGS, NULL }, @@ -172,6 +173,7 @@ static PyMethodDef isysModuleMethods[] = { { "getblkid", (PyCFunction) doGetBlkidData, METH_VARARGS, NULL }, { "isCapsLockEnabled", (PyCFunction) doIsCapsLockEnabled, METH_VARARGS, NULL }, { "getLinkStatus", (PyCFunction) doGetLinkStatus, METH_VARARGS, NULL }, + { "getAnacondaVersion", (PyCFunction) doGetAnacondaVersion, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } } ; @@ -872,4 +874,8 @@ static PyObject * doGetLinkStatus(PyObject * s, PyObject * args) { return PyBool_FromLong(0); } +static PyObject * doGetAnacondaVersion(PyObject * s, PyObject * args) { + return Py_BuildValue("s", VERSION); +} + /* vim:set shiftwidth=4 softtabstop=4: */ diff --git a/isys/isys.py b/isys/isys.py index 79959d0ac..721aca0ab 100755 --- a/isys/isys.py +++ b/isys/isys.py @@ -716,6 +716,9 @@ def isPaeAvailable(): def getLinkStatus(dev): return _isys.getLinkStatus(dev) +def getAnacondaVersion(): + return _isys.getAnacondaVersion() + auditDaemon = _isys.auditdaemon handleSegv = _isys.handleSegv |