]> git.ipfire.org Git - people/shoehn/ipfire.org.git/blobdiff - webapp/backend/releases.py
added background to support section
[people/shoehn/ipfire.org.git] / webapp / backend / releases.py
index 48f7b5d25c7645a40a54dfb0037e67fb883c8b80..9e68e5905d11de02102672f96af496d788cae318 100644 (file)
@@ -168,7 +168,7 @@ class File(Object):
 
        @property
        def arch(self):
-               known_arches = ("i586", "arm")
+               known_arches = ("x86_64", "i586", "arm")
 
                for arch in known_arches:
                        if arch in self.basename:
@@ -259,6 +259,16 @@ class Release(Object):
        def sname(self):
                return self.__data.sname
 
+       @property
+       def fireinfo_id(self):
+               name = self.sname.replace("ipfire-", "IPFire ").replace("-", " - ")
+
+               res = self.db.get("SELECT id FROM fireinfo_releases \
+                       WHERE name = %s", name)
+
+               if res:
+                       return res.id
+
        @property
        def stable(self):
                return self.__data.stable
@@ -366,11 +376,7 @@ class Release(Object):
                                f.close()
 
        def supports_arch(self, arch):
-               # Currently there is nothing else than i586 supported
-               if arch == "i586":
-                       return True
-
-               return False
+               return arch in ("x86_64", "i586")
 
        def supports_platform(self, platform):
                # Currently there is nothing else than pcbios supported
@@ -386,12 +392,18 @@ class Release(Object):
                assert self.supports_arch(arch)
                assert self.supports_platform(platform)
 
+               if self.sname >= "ipfire-2.19-core100":
+                       return "http://downloads.ipfire.org/%s/images/%s/vmlinuz" % (self.path, arch)
+
                return "http://downloads.ipfire.org/%s/images/vmlinuz" % self.path
 
        def netboot_initrd_url(self, arch, platform):
                assert self.supports_arch(arch)
                assert self.supports_platform(platform)
 
+               if self.sname >= "ipfire-2.19-core100":
+                       return "http://downloads.ipfire.org/%s/images/%s/instroot" % (self.path, arch)
+
                return "http://downloads.ipfire.org/%s/images/instroot" % self.path
 
        def netboot_args(self, arch, platform):
@@ -408,6 +420,24 @@ class Release(Object):
 
                return self._news
 
+       # Fireinfo Stuff
+
+       @property
+       def penetration(self):
+               penetration = self.memcache.get("%s-penetration" % self.sname)
+
+               # Cache HIT
+               if penetration:
+                       return penetration
+
+               # Get penetration from fireinfo
+               penetration = self.backend.fireinfo.get_release_penetration(self)
+
+               # Cache for 1 hour
+               self.memcache.set("%s-penetration" % self.sname, penetration, 3600)
+
+               return penetration
+
 
 class Releases(Object):
        def get_by_id(self, id):