From ffa7fc48791b7877b381445e32eb7d628e2eedee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20=C3=87a=C4=9Flayan?= Date: Tue, 13 Apr 2010 10:38:35 +0000 Subject: [PATCH] Implement lsbINFO() to get LSB information of the distribution --- pisi/actionsapi/get.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pisi/actionsapi/get.py b/pisi/actionsapi/get.py index 7ce0b797..0f028496 100644 --- a/pisi/actionsapi/get.py +++ b/pisi/actionsapi/get.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2005 - 2007, TUBITAK/UEKAE +# Copyright (C) 2005-2010 TUBITAK/UEKAE # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free @@ -73,6 +73,13 @@ def installDIR(): '''returns the path of binary packages''' return env.install_dir +# Pardus Related Functions + +def lsbINFO(): + """Returns a dictionary filled through /etc/lsb-release.""" + return dict([(l.split("=")[0], l.split("=")[1].strip("'\"")) \ + for l in open("/etc/lsb-release", "r").read().strip().split("\n") if "=" in l]) + # PSPEC Related Functions def srcNAME(): @@ -100,7 +107,7 @@ def HOST(): def CHOST(): # FIXME: Currently it behave same as HOST, - # but will be used for cross-compiling when PİSİ ready... + # but will be used for cross-compiling when pisi ready... return env.host def CFLAGS():