]> git.ipfire.org Git - pakfire.git/commitdiff
jenkins: Apply architecture to apt preferences
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 24 Jan 2025 16:15:30 +0000 (16:15 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 24 Jan 2025 17:38:20 +0000 (17:38 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Jenkinsfile

index c8752ecf9700934c5a0ffe059439a9c337d8735b..224eb31c19a3dcf7712f13a276ae859dbe1636ec 100644 (file)
@@ -51,7 +51,7 @@ pipeline {
 
                                                                // Debian & Ubuntu
                                                                } else if (env.DISTRO.contains("debian") || env.DISTRO.contains("ubuntu")) {
-                                                                       installBuildDepsDebian(env.DISTRO, env.COMPILER)
+                                                                       installBuildDepsDebian(env.DISTRO, env.COMPILER, "amd64")
                                                                }
                                                        }
                                                }
@@ -141,7 +141,7 @@ pipeline {
                                                stage("Install Dependencies") {
                                                        steps {
                                                                script {
-                                                                       installBuildDepsDebian("trixie", "clang")
+                                                                       installBuildDepsDebian("trixie", "clang", "amd64")
 
                                                                        // Install Clang Tools
                                                                        sh "apt-get install -y clang-tools"
@@ -193,7 +193,7 @@ pipeline {
                                                stage("Install Dependencies") {
                                                        steps {
                                                                script {
-                                                                       installBuildDepsDebian("bookworm-backports", "gcc")
+                                                                       installBuildDepsDebian("bookworm-backports", "gcc", "amd64")
 
                                                                        // Install lcov
                                                                        sh "apt-get install -y lcov"
@@ -297,7 +297,7 @@ pipeline {
                                                                steps {
                                                                        // Prefer backports for some packages
                                                                        script {
-                                                                               preferBackports(env.IMAGE)
+                                                                               preferBackports(env.IMAGE, env.ARCH)
                                                                        }
 
                                                                        // Add the architecture
@@ -609,9 +609,9 @@ def installBuildDepsArchLinux(distro, compiler) {
 }
 
 // Installs everything we need on Debian
-def installBuildDepsDebian(distro, compiler) {
+def installBuildDepsDebian(distro, compiler, arch) {
        // Prefer backports?
-       preferBackports(distro)
+       preferBackports(distro, arch)
 
        sh "apt-get update"
        sh """
@@ -652,14 +652,14 @@ def installBuildDepsDebian(distro, compiler) {
        """
 }
 
-def preferBackports(distro) {
+def preferBackports(distro, arch) {
        if (distro.contains("bookworm")) {
                sh """
                        (
-                               echo "Package: curl libcurl*"
-                               echo "Pin: release n=bookworm-backports"
+                               echo "Package: curl curl:${arch} libcurl* libcurl*:${arch}"
+                               echo "Pin: release n=${distro.replace("debian:", "")}"
                                echo "Pin-Priority: 900"
-                       ) > /etc/apt/preferences.d/99debian-backports
+                       ) > /etc/apt/preferences.d/99backports
                """
        }
 }