]> code.ossystems Code Review - openembedded-core.git/commitdiff
package: Ensure pclist files are deterministic and don't use full paths
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 29 Sep 2021 12:30:59 +0000 (13:30 +0100)
committerSteve Sakoman <steve@sakoman.com>
Tue, 19 Oct 2021 14:04:49 +0000 (04:04 -1000)
Currently the pkgconfig pclist files contain full paths which are build
host specific and the order of entries is not deterministic.

Fix both these issues so the files are deterministic.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e422e29bca4af3ab4073e04490f38b05cd7c38c0)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/classes/package.bbclass

index 3ff74c9f31cd1bbb3da69ec81f07ba8af071c0fe..702427fecc5cb9c8751744e07c729bd257dcc9da 100644 (file)
@@ -1989,12 +1989,12 @@ python package_do_pkgconfig () {
     for pkg in packages.split():
         pkgconfig_provided[pkg] = []
         pkgconfig_needed[pkg] = []
-        for file in pkgfiles[pkg]:
+        for file in sorted(pkgfiles[pkg]):
                 m = pc_re.match(file)
                 if m:
                     pd = bb.data.init()
                     name = m.group(1)
-                    pkgconfig_provided[pkg].append(name)
+                    pkgconfig_provided[pkg].append(os.path.basename(name))
                     if not os.access(file, os.R_OK):
                         continue
                     with open(file, 'r') as f:
@@ -2017,7 +2017,7 @@ python package_do_pkgconfig () {
         pkgs_file = os.path.join(shlibswork_dir, pkg + ".pclist")
         if pkgconfig_provided[pkg] != []:
             with open(pkgs_file, 'w') as f:
-                for p in pkgconfig_provided[pkg]:
+                for p in sorted(pkgconfig_provided[pkg]):
                     f.write('%s\n' % p)
 
     # Go from least to most specific since the last one found wins