Handling non-standard package feed tree structure

Hi guys, I spent some time in trying to setup a custom collection of openwrt packages and targets as a custom feed as explained here: https://openwrt.org/docs/guide-developer/feeds

Here is how my package directory is structured:

feedroot/
-- packagename1/
-- -- pkg/
-- -- -- Makefile
-- -- -- files/
-- -- -- patches/
-- -- doc/
-- packagename2/
-- -- pkg/
-- -- -- Makefile
-- -- -- files/
-- -- -- patches/
-- -- doc/
-- (…)
-- kernel/
-- -- customkernel/
-- -- -- kernel/
-- -- -- -- linux/
-- -- -- -- -- arch/
-- -- -- -- -- block/
-- -- -- -- -- (…)
-- -- custommodules/
-- -- -- (…)
-- -- target/
-- -- -- generic/
-- -- -- -- files/
-- -- -- customtarget/
-- -- -- -- Makefile
-- -- -- -- subtarget1/
-- -- -- -- subtarget2/
-- -- -- (…)

I have got this collection already structured like that, I would like to handle this tree without restructuring.
If I pick any "pkg" folder and I copy it to openwt-topdir/package/pkg and I rename the "pkg" folder to "packagename1" it works as expected in buildroot, it compiles and it is correctly shown in menuconfig as an openwrt package. For me this is not a viable option because there are lots of packages and each feed contains the same packages so the best would be to handle such structure as a package feed.

I added the relevant line for "myfeed" to feeds.conf and ran ./scritps/feeds update myfeed
At the end, if I open the feeds/myfeed.index I see only one package, a customized zlib package which is the last one in lexicographical order. If I open the feeds/myfeed.targetindex I can see "customtarget" but I don't really know if it would have found more then one target, because there is only one there.

If I try using ./scripts/feeds install -a -p customfeed it completes again with no error but neither the target nor the zlib package show up in menuconfig. I can't even see "Installing zlib package.."or whatever so it seems like it is installing an empty package index.

If I redefine myfeed in feeds.conf such that the whole feed tree is rooted in, for instance, feedroot/zlib it again populates the index with zlib during update, and it also tries installing that package but it fails after printing "Installing pkg package...", so I think it messed with package/folders names.

Since I know this tree has been designed to be linked into an openwrt buildroot, I would like to know from you if you have any tips on tweaking or patching feeds installer such that it correctly handles such kind of structure. There should be some path matching expressions somewhere between scripts/feeds, include/scan.mk, include/scan.awk or whatever that expects the package Makefile to be inside a folder named as the package itself. And it would be awesome if anybody can explain why it is adding only "zlib" in the index.

Thank you for any help