Hey Chris,
On 5/3/22 13:11, Chris Landa wrote:
> I have an opkg setup with multiple repositories and would like to list
> packages belonging to a specific repository. Basically 'opkg list'
> with some extra parameter to limit by repository. I don't thinks this
> functionality is available, unless I am missing something. I also did
> not find a way to just parse the information that I want from
> available output.
You're correct that opkg doesn't have a way to limit the `list` output
to a particular repository.
I can't think of any compelling reasons not to implement that feature.
So, if it is important to you that opkg have that ability, I would be
happy to accept a patchset.
> What is the best practice to get this information? I was thinking
> about passing different configs with the -f parameter but this seems
> rather cumbersome...
Without modifying opkg, you could manually parse the package indexes
stored on disk. After `opkg update`, the index files are stored locally
- usually under `/var/lib/opkg/lists`, or wherever your opkg
variable-store is located. The indexes are simple record-jar formatted
files, and are namespaced by their feed name. I imagine you could simply
parse out the metadata that you're interested in.
eg.
```
# ls -la
total 6860
drwxr-xr-x 2 admin administ 0 Apr 18 06:11 ./
drwxr-xr-x 4 admin administ 0 Apr 18 06:12 ../
-rw-r--r-- 1 admin administ 43833 Apr 18 06:11 NI-lv-software
-rw-r--r-- 1 admin administ 43833 Apr 18 06:11 NI-main-software
-rw-r--r-- 1 admin administ 338349 Apr 18 06:11 NIOE-all
-rw-r--r-- 1 admin administ 5784887 Apr 18 06:11 NIOE-core2-64
-rw-r--r-- 1 admin administ 804318 Apr 18 06:11 NIOE-x64
# grep -e '^Package:' NIOE-all NIOE-x64 | cut -d':' -f3 | sort
adwaita-icon-theme
adwaita-icon-theme-cursors
adwaita-icon-theme-hires
adwaita-icon-theme-lic
adwaita-icon-theme-symbolic
<snip/>
```
--
Alex Stewart
Software Engineer - NI Real-Time OS
NI (National Instruments)
alex.s...@ni.com