Browse code

add option to build debuginfo packages for specific packages

The option "build-dbginfo-rpm-list" can have a list of packages for which we
build debbuginfo RPMs even when "build-dbginfo-rpm" is set to false.

By default, this is set to 'glibc' and 'linux' since these two are frequently
used in package tests.

Change-Id: Ic11508c7d126f0cd95c4ad2a23571c9ac80298de
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/18540
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Shreenidhi Shedi <sshedi@vmware.com>
Reviewed-by: Oliver Kurth <okurth@vmware.com>

Oliver Kurth authored on 2022/11/05 07:19:39
Showing 4 changed files
... ...
@@ -14,6 +14,7 @@
14 14
 
15 15
             "build-src-rpm" : true,
16 16
             "build-dbginfo-rpm" : true,
17
+            "build-dbginfo-rpm-list" : ["glibc", "linux"],
17 18
 
18 19
             "target" : "iso",
19 20
             "compression-macro" : "w19.zstdio"
... ...
@@ -1324,6 +1324,7 @@ def initialize_constants():
1324 1324
     constants.buildDbgInfoRpm = int(
1325 1325
         configdict["photon-build-param"]["build-dbginfo-rpm"]
1326 1326
     )
1327
+    constants.buildDbgInfoRpmList = configdict["photon-build-param"]["build-dbginfo-rpm-list"]
1327 1328
 
1328 1329
     constants.initialize()
1329 1330
 
... ...
@@ -32,9 +32,6 @@ class PackageUtils(object):
32 32
         else:
33 33
             self.rpmbuildBuildallOption = f"-bb {self.rpmbuildBuildallOption}"
34 34
 
35
-        if not constants.buildDbgInfoRpm:
36
-            self.rpmbuildBuildallOption = "-D \"debug_package %{nil}\" " + f"{self.rpmbuildBuildallOption}"
37
-
38 35
         self.rpmbuildNocheckOption = "--nocheck"
39 36
         self.rpmbuildCheckOption = "-bi --clean"
40 37
         self.queryRpmPackageOptions = "-qa"
... ...
@@ -322,6 +319,9 @@ class PackageUtils(object):
322 322
     def _buildRPM(self, sandbox, specFile, logFile, package, version, macros):
323 323
         rpmBuildcmd = self.rpmbuildBinary + " " + self.rpmbuildBuildallOption
324 324
 
325
+        if not constants.buildDbgInfoRpm and package not in constants.buildDbgInfoRpmList:
326
+            rpmBuildcmd += " -D \"debug_package %{nil}\" "
327
+
325 328
         if constants.rpmCheck and package in constants.testForceRPMS:
326 329
             self.logger.debug("#" * (68 + 2 * len(package)))
327 330
             if (not SPECS.getData().isCheckAvailable(package, version)) or \
... ...
@@ -42,6 +42,7 @@ class constants(object):
42 42
     phBuilderTag = ""
43 43
     buildSrcRpm = 0
44 44
     buildDbgInfoRpm = 0
45
+    buildDbgInfoRpmList = []
45 46
 
46 47
     noDepsPackageList = [
47 48
         "texinfo",