From cd9c20eb3290573a879c6d1240a43909c87864ce Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 18 Mar 2012 18:05:59 +0100 Subject: [PATCH] Add DISTRO_PLATFORM variable. This is either arm or x86. --- python/pakfire/distro.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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, -- 2.39.5