git-submodules

Information and guidelines about git submodules and freepto

Git Submodules

This page will try to give pointers to good documentation to git submodules, to explain how are they used in freepto and give you practical advice about this

General help

Usage in freepto

In freepto, some packages are used as submodules. They all reside inside pkgs.

A part of auto/build is devoted to building every directory it finds inside of pkgs. For each directory, you have 3 options (they will surely increase in the future):

  1. be a normal debian package (so that debuild will be used)
  2. providing an executable make_deb script, that will generate a .deb file
  3. providing a deb file; it is assumed to be the equivs-build object

Practical advice

Get submodules

When you clone freepto-lb, it will NOT fetch the content of the submodules. This means that ls pkgs/*/ will show no file.

They can be fetched running

git submodule init
git submodule update

Add a submodule

If you can, please create your repository in avana-bbs and add it as submodule.
Otherwise, we need to change it at some point, which is boring.

(If you are not a core developer, and thus you don’t have access to avana-bbs, then don’t worry, and create it where you prefer)

git submodule add https://github.com/avana-bbs/whateva pkgs/whateva
git commit -m "add whateva"

Upgrade a submodule to a more recent version

Suppose you have a whateva submodule which is outdated, and you want to fetch the latest upstream version

cd pkgs/whateva
git pull origin master
cd ../../
git add pkgs/whateva
git commit -m "upgrade whateva to latest upstream version"

Please note: it is VERY important that you do NOT do git add pkgs/whateva/ (with the trailing slash). You always need to do it without the trailing slash. See also nice tutorial

Removing a submodule

TODO (should you really??)