From: Michael Tremer Date: Sun, 18 Mar 2012 17:05:59 +0000 (+0100) Subject: Add DISTRO_PLATFORM variable. X-Git-Tag: 0.9.21~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd9c20eb3290573a879c6d1240a43909c87864ce;p=pakfire.git Add DISTRO_PLATFORM variable. This is either arm or x86. --- diff --git a/python/pakfire/distro.py b/python/pakfire/distro.py index 1f78cc089..33f084ad9 100644 --- a/python/pakfire/distro.py +++ b/python/pakfire/distro.py @@ -155,6 +155,19 @@ class Distribution(object): arch = property(get_arch, set_arch) + @property + def platform(self): + """ + Returns the "class" this architecture belongs to. + """ + if self.arch.startswith("arm"): + return "arm" + + if self.arch in ("i686", "x86_64"): + return "x86" + + return "unknown" + @property def dist(self): return self.sname[:2] + self.release @@ -192,6 +205,7 @@ class Distribution(object): "DISTRO_DISTTAG" : self.dist, "DISTRO_ARCH" : self.arch, "DISTRO_MACHINE" : self.machine, + "DISTRO_PLATFORM" : self.platform, "DISTRO_BUILDTARGET" : self.buildtarget, "DISTRO_VENDOR" : self.vendor, "DISTRO_CONTACT" : self.contact,