git submodule

  • Hi, I'm building an addon which contains another package which uses submodules, ie not under my control. Submodule versions might be updated and new dependencies added.

    So, since github does not support getting an archive which includes submodules I'm wondering if anyone has any elegant solutions.

    My initial thought was to hook the script/get functionality in libreelec to build a complete archive but there are no possible pre/post or other exits in the script.

    So, for now I have a post_unpack in package.mk which clones the necessary source, ie I hardcoded tags for the submodule which is not very elegant and wastes time at unpacking.

    I saw this was answered earlier but it was kinda low on details.

  • There is no elegant solution, we asked already github and they said "maybe in future" ... so basically we don't know anything.

    There are several solutions.

    1. create a mkpkg script that creates a package.zip that includes the submodules and upload it (git clone + git submodule initial -> pack into zip)

    2. create an new package for the submodule and copy the source to the original package at buildtime

    3. create an fancy unpack() that git clone etc while buildtime (rebuild is gonna be fun)

  • Thanks, seems to me the best path is option 1; to pack an archive of the original source including submodules and publish in my own github together with the addon (or persuade the author to do it), the cloning during build is annoying me....

  • short example

    https://github.com/tvheadend/tvheadend.git is ofc just an example