]> git.pld-linux.org Git - projects/pld-builder.new.git/commitdiff
experimental php version blacklisting based on build context
authorElan Ruusamäe <glen@delfi.ee>
Fri, 8 May 2015 19:17:11 +0000 (22:17 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Fri, 8 May 2015 19:17:11 +0000 (22:17 +0300)
PLD_Builder/install.py
PLD_Builder/request.py

index c5170886030ea866c15d3bf9f3be3fc2823e7135..8870cc1dcb60998540286edd8c42f29583638ba0 100644 (file)
@@ -191,7 +191,7 @@ def install_br(r, b):
     br = string.strip(nbr)
 
     b.log_line("installing BR: %s" % br)
-    res = chroot.run("poldek --noask --caplookup -Q -v --upgrade %s" % br,
+    res = chroot.run("set -x; poldek --noask --caplookup -Q -v --upgrade %s %s" % (b.ignores(), br),
             user = "root",
             logfile = b.logfile)
     if res != 0:
index 3735e0c7fd7b42a041b51228e6ec89e84e107b99..5e9c87cb88f97afa2ff55711334b2379b5ebdde9 100644 (file)
@@ -340,6 +340,50 @@ class Batch:
             "--define '_builddir %{_topdir}/BUILD' "
         return rpmdefs + rpmopts
 
+    def php_ignores(self):
+        # transform php package name (52) to version (5.2)
+        def php_name_to_ver(v):
+            return '.'.join(list(v))
+
+        # transform php version (5.2) to package name (52)
+        def php_ver_to_name(v):
+            return v.replace('.', '')
+
+        # available php versions in distro
+        php_versions = ['5.2', '5.3', '5.4', '5.5', '5.6']
+
+        # current version if -D php_suffix is present
+        php_version = php_name_to_ver(defines['php_suffix'])
+
+        # remove current php version
+        php_versions.remove(php_version)
+
+        # map them to poldek ignores
+        # always ignore hhvm
+        res = ['hhvm']
+        for v in map(php_ver_to_name, php_versions):
+            res.append("php%s-*" % v)
+
+        return res
+
+    # build ignore package list
+    # currently only php ignore is filled based on build context
+    def ignore_list(self):
+        ignores = []
+
+        # add php version based ignores
+        if self.defines.has_key('php_suffix'):
+            ignores.extend(self.php_ignores())
+
+        # return empty string if the list is empty
+        if len(ignores) == 0:
+            return ""
+
+        def add_ignore(s):
+            return "--ignore=%s" % s
+
+        return " ".join(map(add_ignore, ignores))
+
     def kernel_string(self):
         r = ""
         if self.kernel != "":
This page took 0.180041 seconds and 4 git commands to generate.