[openwrt/openwrt] scripts/make-index-json: ensure that manifest output is in opkg format

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 1 11:42:23 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/3b21f97641f9a03a01d1a40bc5ed740bae7a7c27

commit 3b21f97641f9a03a01d1a40bc5ed740bae7a7c27
Author: Eric Fahlgren <ericfahlgren at gmail.com>
AuthorDate: Fri Sep 19 10:01:07 2025 -0700

    scripts/make-index-json: ensure that manifest output is in opkg format
    
    Certain existing tooling, such as 'package-metadata.pl', are written
    to accept the output of 'opkg list' with package manifest delimited
    by '-'.  The 'make-index-json.py --manifest' output was emulating
    the 'apk list --manifest' format without the delimiting dash,
    thus breaking these legacy tools.
    
    We fix this by adding the dash to the manifest output, which allows
    all existing tooling to process the output irrespective of whether
    the build system uses opkg or apk.
    
    Signed-off-by: Eric Fahlgren <ericfahlgren at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20094
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 scripts/make-index-json.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/make-index-json.py b/scripts/make-index-json.py
index 7751cde810..5751d98c59 100755
--- a/scripts/make-index-json.py
+++ b/scripts/make-index-json.py
@@ -32,7 +32,7 @@ def parse_args():
     parser.add_argument("-f", "--source-format", required=True, choices=source_format,
                         help="Required source format of input: 'apk' or 'opkg'")
     parser.add_argument("-m", "--manifest", action="store_true", default=False,
-                        help="Print output in manifest format, as package:version pairs")
+                        help="Print output in opkg list format, as 'package - version' pairs")
     parser.add_argument(dest="source",
                         help="File name for input, '-' for stdin")
     # fmt: on
@@ -90,8 +90,10 @@ if __name__ == "__main__":
 
     packages = parse_apk(text) if args.source_format == "apk" else parse_opkg(text)
     if args.manifest:
-        for name, version in packages.items():
-            print(name, version)
+        # Emulate the output of 'opkg list' command for compatibility with
+        # legacy tooling.
+        for name, version in sorted(packages.items()):
+            print(name, "-", version)
     else:
         index = {
             "version": 2,




More information about the lede-commits mailing list