public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [flatpaks/flatpak-runtime] f45: Group by source package
@ 2026-09-11 14:40 Owen W. Taylor
  0 siblings, 0 replies; only message in thread
From: Owen W. Taylor @ 2026-09-11 14:40 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : flatpaks/flatpak-runtime
            Branch : f45
            Commit : 5e3b0708919f905d0ce5c3c47d934dc12818d72b
            Author : Owen W. Taylor <otaylor@fishsoup.net>
            Date   : 2018-01-31T11:21:01+01:00
            Stats  : +96/-14 in 3 file(s)
            URL    : https://src.fedoraproject.org/flatpaks/flatpak-runtime/c/5e3b0708919f905d0ce5c3c47d934dc12818d72b?branch=f45

            Log:
            Group by source package

Group binary packages by source package, move information that is
at the source-package to the source package headers (which module
the package is in, and whether we need to build it.)

---
diff --git a/generate-report.py b/generate-report.py
index 44496b2..c4dc389 100755
--- a/generate-report.py
+++ b/generate-report.py
@@ -39,6 +39,7 @@ class Package(object):
         self.gnome_sdk_required_by = None
         self.live = 0
         self.rf26 = 0
+        self.source_package = None
 
     @property
     def runtimes(self):
@@ -47,14 +48,9 @@ class Package(object):
     @property
     def klass(self):
         k = ""
-        if self.live and not self.runtimes:
-            k = "live-only"
         if self.gnome_platform and not self.live:
             k = "not-on-live"
 
-        if self.modules in ("", "installer"):
-            k += " build"
-
         return k
 
     @property
@@ -147,6 +143,47 @@ class Package(object):
     def rf26_inclusion(self):
         return self.inclusion('rf26')
 
+class SourcePackage(object):
+    def __init__(self, name):
+        self.name = name
+        self.packages = []
+
+    @property
+    def modules(self):
+        old_modules = self.packages[0].modules
+        klass = self.klass
+        if klass == "build-platform":
+            new_module = "desktop-runtime"
+        elif klass == "build-sdk":
+            new_module = "flatpak-runtime"
+        else:
+            new_module = None
+
+        if old_modules and new_module:
+            return old_modules + " ⇒ " + new_module
+        elif old_modules:
+            return old_modules
+        else:
+            return new_module
+
+    @property
+    def sdk_only(self):
+        return sdk_only
+
+    @property
+    def klass(self):
+        if self.packages[0].modules in ("", "installer"):
+            sdk_only = True
+            for package in self.packages:
+                if package.freedesktop_platform or package.gnome_platform:
+                    sdk_only = False
+            if sdk_only:
+                return "build-sdk"
+            else:
+                return "build-platform"
+        else:
+            return ""
+
 class Letter(object):
     def __init__(self, letter):
         self.letter = letter
@@ -157,7 +194,7 @@ class Letter(object):
 #
 
 packages = dict()
-def add_package(name, which, level, only_if_exists):
+def add_package(name, which, level, only_if_exists=False, source_package=None):
     pkg = packages.get(name, None)
     if pkg is None:
         if only_if_exists:
@@ -166,6 +203,8 @@ def add_package(name, which, level, only_if_exists):
         packages[name] = pkg
     if getattr(pkg, which) < level:
         setattr(pkg, which, level)
+    if source_package is not None:
+        pkg.source_package = source_package
 
 def add_packages(filename, which, resolve_deps=False, only_if_exists=False):
     start("Adding packages from {}".format(filename))
@@ -177,7 +216,8 @@ def add_packages(filename, which, resolve_deps=False, only_if_exists=False):
         for package in resolved_packages:
             name = nvr_to_name(package['rpm'])
             srpm_name = nvr_to_name(package['srpm'])
-            add_package(name, which, level=(2 if name in pkgs else 1), only_if_exists=only_if_exists)
+            add_package(name, which, level=(2 if name in pkgs else 1),
+                        source_package=srpm_name, only_if_exists=only_if_exists)
 
         for package in resolved_packages:
             for req, provider in package['requires'].items():
@@ -220,8 +260,17 @@ add_package_files('out/freedesktop-Sdk.matched', 'freedesktop_sdk')
 add_package_files('out/gnome-Platform.matched', 'gnome_platform')
 add_package_files('out/gnome-Sdk.matched', 'gnome_sdk')
 
+source_packages = {}
+for package in packages.values():
+    source_package = source_packages.get(package.source_package, None)
+    if source_package is None:
+        source_package = SourcePackage(package.source_package)
+        source_packages[source_package.name] = source_package
+    source_package.packages.append(package)
+
 letters_map = dict()
-for k, v in packages.items():
+for k, v in source_packages.items():
+    v.packages.sort(key=lambda p: locale.strxfrm(p.name))
     l = v.name[0].upper()
     letter = letters_map.get(l, None)
     if letter is None:

diff --git a/report-template.html b/report-template.html
index 8234614..c02dae1 100644
--- a/report-template.html
+++ b/report-template.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
   <head>
+    <meta charset="UTF-8">
     <link href="report.css" rel="stylesheet">
   </head>
   <body>
@@ -22,7 +23,13 @@
 	<tr><td>GN/S</td><td> - org.gnome.Sdk</td></tr>
 	<tr><td>LIVE</td><td> - F27 live image</td></tr>
 	<tr><td>RF26</td><td> - F26 org.fedora.Platform</td></tr>
+	<tr><td class="build-platform"></td><td> - Build in desktop-runtime module</td></tr>
+	<tr><td class="build-sdk"></td><td> - Build in flatpak-runtime module</td></tr>
+	<tr><td class="root"></td><td> - Root package, only included because of files in runtime</td></tr>
+	<tr><td class="files"></td><td> - Included because of files in runtime, also depended upon</td></tr>
+	<tr><td class="dep"></td><td> - Included because of dependencies</td></tr>
       </table>
+      <div class="note">Mouse over shaded squares for details.</div>
     </div>
     <table class="packages">
       <tbody>
@@ -38,9 +45,19 @@
 	  <th>LIVE</th>
 	  <th>RF26</th>
 	  <th></th>
-	  <th></th>
 	</tr>
-	{% for package in letter.packages %}
+	{% for spackage in letter.packages %}
+	<tr class="source-package {{ spackage.klass }}">
+	  <td>{{ spackage.name }}</td>
+	  <td></td>
+	  <td></td>
+	  <td></td>
+	  <td></td>
+	  <td></td>
+	  <td></td>
+	  <td>{{ spackage.modules }}</td>
+	</tr>
+	{% for package in spackage.packages %}
 	<tr class="package {{ package.klass }}">
 	  <td>{{ package.name }}</td>
 	  <td class="{{package.freedesktop_platform_inclusion}}" title="{{ package.freedesktop_platform_why }}"></td>
@@ -49,11 +66,11 @@
 	  <td class="{{package.gnome_sdk_inclusion}}" title="{{ package.gnome_sdk_why }}"></td>
 	  <td class="{{package.live_inclusion}}"></td>
 	  <td class="{{package.rf26_inclusion}}"></td>
-	  <td>{{ package.modules}} </td>
 	  <td>{{ package.note }}</td>
 	</tr>
 	{% endfor %}
 	{% endfor %}
+	{% endfor %}
       </tbody>
   </body>
 </html>

diff --git a/report.css b/report.css
index cbc824d..67d9d59 100644
--- a/report.css
+++ b/report.css
@@ -19,6 +19,10 @@ body {
     right: 5px;
     bottom: 5px;
 }
+.summary .note {
+    padding-top: 5px;
+    font-style: italic;
+}
 .filter .button {
     background: #ffffff;
     border-radius: 5px;
@@ -61,6 +65,18 @@ tr {
     border-left: 1px solid #aa8888;
     border-right: 1px solid #aa8888;
 }
+tr.source-package {
+    background: #eeeeee;
+}
+tr.build-sdk, td.build-sdk {
+    background: #eef8dd;
+}
+tr.build-platform, td.build-platform {
+    background: #f8eedd;
+}
+td.build-sdk, td.build-platform {
+    border: 1px solid black;
+}
 td.root {
     background: #888888;
     border: 1px solid #666666;
@@ -76,6 +92,9 @@ td.dep {
     border: 1px solid #666666;
     padding: 0px;
 }
+.summary td.root, .summary td.files, .summary td.dep {
+    border: 1px solid black;
+}
 td.absent {
     border: 1px solid #666666;
     padding: 0px;
@@ -86,9 +105,6 @@ tr.not-on-live {
 tr.live-only {
     color: #aaaaaa;
 }
-tr.build {
-    font-weight: bold;
-}
 .hidden {
     display: none;
 }

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-11 14:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 14:40 [flatpaks/flatpak-runtime] f45: Group by source package Owen W. Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox