| Message ID | 20250919094008.230990-1-fe@dev.tdt.de |
|---|---|
| State | Superseded |
| Headers | show |
| Series | imagebuilder: fix manifest generation for apk | expand |
Something like this:
if args.manifest:
- for name, version in packages.items():
- print(name, version)
+ for name, version in sorted(packages.items()):
+ print(name, "-", version)
else:
If you want me to do the PR, just let me know...
Eric
On Fri, Sep 19, 2025 at 9:32 AM Eric Fahlgren <ericfahlgren@gmail.com> wrote:
>
> Hi Florian,
>
> I'd prefer you just add the dash (and sort, if needed) to make-index-json.py[1] as the '--manifest' option's sole purpose in life is to produce that output. I was emulating the 'apk list --manifest' for that change, which does not include a dash, but I think the only use of the non-dash is in the ASU server, and that already handles both cases[2] properly.
>
> [1] https://github.com/openwrt/openwrt/blob/fc9cf208c5ef56489dcc7664b4ba75223fc51607/scripts/make-index-json.py#L94
> [2] https://github.com/openwrt/asu/blob/dca946f68732d70f78d97df336310c59bb6db4d1/asu/util.py#L314
>
> Eric
>
>
> On Fri, Sep 19, 2025 at 2:40 AM Florian Eckert <fe@dev.tdt.de> wrote:
>>
>> The manifest file created by the imagebuilder command 'make manifest' does
>> not contain '-' between packages name and version for the apk backend.
>> Therefore this file can not be used as an input file for 'package-metadata.pl'
>> script to get further informations.
>>
>> This change fixes this by addding the missing '-' char.
>>
>> Fixes 23dc466969f3 ("imagebuilder: implement STRIP_ABI option for manifest target")
>> Signed-off-by: Florian Eckert <fe@dev.tdt.de>
>> ---
>> target/imagebuilder/files/Makefile | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile
>> index 3f919a0658..fa162fa208 100644
>> --- a/target/imagebuilder/files/Makefile
>> +++ b/target/imagebuilder/files/Makefile
>> @@ -169,7 +169,7 @@ ifeq ($(CONFIG_USE_APK),)
>> $(OPKG) list-installed $(if $(STRIP_ABI),--strip-abi)
>> else
>> $(APK) query --format json --fields name,version,$(if $(STRIP_ABI),tags) --installed '*' | \
>> - $(SCRIPT_DIR)/make-index-json.py -a $(ARCH_PACKAGES) -f apk --manifest -
>> + $(SCRIPT_DIR)/make-index-json.py -a $(ARCH_PACKAGES) -f apk --manifest - | sort | sed 's/ / - /'
>> endif
>>
>> package_index: FORCE
>> --
>> 2.39.5
>>
How about this? https://github.com/openwrt/openwrt/pull/20094 On Fri, Sep 19, 2025 at 9:39 AM Eric Fahlgren <ericfahlgren@gmail.com> wrote: > > Something like this: > > if args.manifest: > - for name, version in packages.items(): > - print(name, version) > + for name, version in sorted(packages.items()): > + print(name, "-", version) > else: > > If you want me to do the PR, just let me know... > > Eric > > On Fri, Sep 19, 2025 at 9:32 AM Eric Fahlgren <ericfahlgren@gmail.com> wrote: > > > > Hi Florian, > > > > I'd prefer you just add the dash (and sort, if needed) to make-index-json.py[1] as the '--manifest' option's sole purpose in life is to produce that output. I was emulating the 'apk list --manifest' for that change, which does not include a dash, but I think the only use of the non-dash is in the ASU server, and that already handles both cases[2] properly. > > > > [1] https://github.com/openwrt/openwrt/blob/fc9cf208c5ef56489dcc7664b4ba75223fc51607/scripts/make-index-json.py#L94 > > [2] https://github.com/openwrt/asu/blob/dca946f68732d70f78d97df336310c59bb6db4d1/asu/util.py#L314 > > > > Eric > > > > > > On Fri, Sep 19, 2025 at 2:40 AM Florian Eckert <fe@dev.tdt.de> wrote: > >> > >> The manifest file created by the imagebuilder command 'make manifest' does > >> not contain '-' between packages name and version for the apk backend. > >> Therefore this file can not be used as an input file for 'package-metadata.pl' > >> script to get further informations. > >> > >> This change fixes this by addding the missing '-' char. > >> > >> Fixes 23dc466969f3 ("imagebuilder: implement STRIP_ABI option for manifest target") > >> Signed-off-by: Florian Eckert <fe@dev.tdt.de> > >> --- > >> target/imagebuilder/files/Makefile | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile > >> index 3f919a0658..fa162fa208 100644 > >> --- a/target/imagebuilder/files/Makefile > >> +++ b/target/imagebuilder/files/Makefile > >> @@ -169,7 +169,7 @@ ifeq ($(CONFIG_USE_APK),) > >> $(OPKG) list-installed $(if $(STRIP_ABI),--strip-abi) > >> else > >> $(APK) query --format json --fields name,version,$(if $(STRIP_ABI),tags) --installed '*' | \ > >> - $(SCRIPT_DIR)/make-index-json.py -a $(ARCH_PACKAGES) -f apk --manifest - > >> + $(SCRIPT_DIR)/make-index-json.py -a $(ARCH_PACKAGES) -f apk --manifest - | sort | sed 's/ / - /' > >> endif > >> > >> package_index: FORCE > >> -- > >> 2.39.5 > >>
Hello Eric,
On 2025-09-19 19:06, Eric Fahlgren wrote:
> How about this? https://github.com/openwrt/openwrt/pull/20094
LGTM. I will close this Patch in favour of the solution on Github
Thanks
diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile index 3f919a0658..fa162fa208 100644 --- a/target/imagebuilder/files/Makefile +++ b/target/imagebuilder/files/Makefile @@ -169,7 +169,7 @@ ifeq ($(CONFIG_USE_APK),) $(OPKG) list-installed $(if $(STRIP_ABI),--strip-abi) else $(APK) query --format json --fields name,version,$(if $(STRIP_ABI),tags) --installed '*' | \ - $(SCRIPT_DIR)/make-index-json.py -a $(ARCH_PACKAGES) -f apk --manifest - + $(SCRIPT_DIR)/make-index-json.py -a $(ARCH_PACKAGES) -f apk --manifest - | sort | sed 's/ / - /' endif package_index: FORCE
The manifest file created by the imagebuilder command 'make manifest' does not contain '-' between packages name and version for the apk backend. Therefore this file can not be used as an input file for 'package-metadata.pl' script to get further informations. This change fixes this by addding the missing '-' char. Fixes 23dc466969f3 ("imagebuilder: implement STRIP_ABI option for manifest target") Signed-off-by: Florian Eckert <fe@dev.tdt.de> --- target/imagebuilder/files/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)