Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Dev: Guidelines

Bob Liu edited this page Nov 29, 2015 · 15 revisions

Repositories

Source code repositories of existing projects are imported into LuaDist as follows:

All LuaDist repositories should follow these simple rules.

  • Tags should always follow the version in dist.info.
    • If tag already exists for add an incremental "-1" "-2" .. "-n" suffix to the version tag, re-tagging is ok.
    • Delete tags not pointing to LuaDist release. Use version number as in dist.info without "v" prefix.
      • Do not tag development versions. LuaDist provides "scm" modules that always point to "master".
      • NOTE: Always pull from other repositories with --no-tags to avoid pulling in unwanted tags
  • Master branch should always point to most recent package source version.
  • Binaries are committed into orphan branches that follow Arch-type name convention.
  • All new modifications should be developed in branches other than master.
    • Recommended branch names are "packagename-version" or "feature name"
    • If possible develop in cloned repository and push everything once done or submit pull request.

LuaDist/Repository

Primary repository that aggregates all module sub-repositories in the distribution. The purpose of this repository is to ease development and act as a package manifest for the deployment utility. While working with this repository keep the following in mind:

  • ! All Development issues go here.
    • Issues in other repositories are discouraged.
  • Submodules DO NOT point to master.
    • When working with a repository always check your branch, you may loose your changes.
    • Make sure the repository is up to date.
    • All submodules have to be added using the git:// protocol
  • If you update master branch of any module make sure LuaDist/Repository points to it.

Workflow

The following section will describe recommended workflow for LuaDist development. This includes setup of the environment. Utilization of the Repository and some connivence settings for the LuaDist utility.

Step 1. Checkout and work in LuaDist/Repository only.

$ # Checkout the work repository 
$ git clone git://github.com/LuaDist/Repository.git
$ cd Repository

Step 2. Bootstrap LuaDist from Repository

$ # You can check out any submodule you want to work on in the same manner
$ git submodule update --init bootstrap
$ cd bootstrap && git submodule update --init
$ cd ..
$ # Make sure LUA_CPATH and LUA_PATH is not used
$ unset LUA_CPATH && unset LUA_PATH
$ # Build
$ ./install bootstrap
$ cd _install
$ bin/luadist

Step 3. New modules

To add a new module first create the repository on github and then add a submodule to Repository as follows:

$ # NOTE: Add READ ONLY URLs so this repository can be checked out by anyone
$ git submodule add git://github.com/LuaDist/module.git
$ cd module

Step 4. Compilation and Development

Once you are done with your work you can install the module using LuaDist into a test folder:

$ cd my_project
$ LuaDist/bin/luadist _test make -verbose -debug

This will also look for any dependencies the package has.

Step 5. Publishing the module

When you are done developing you need to push the work into the module repository and update Repository and its manifest.

$ # Since the repository is readonly we need to change the push path, this will do it for all submodules
$ git submodule foreach 'git remote set-url --push origin [email protected]:LuaDist/$path.git'
$ cd module
$ # Add your work
$ git add ...
$ # Commit locally
$ git commit -a -m "Commit message"
$ # Add version tag if needed
$ git tag 0.1
$ # publish
$ git push
$ git push --tags

Step 6. Updating Repository

Once this is done we need to push Repository changes so that the module can be found by the luadist utility. This only needs to be done once when the new module is added. For module updates you do not need to update the Repository.

$ # Commit and publish
$ git commit .gitmodules module_name -m "Added module XXX"
$ git push

Check install from online source

$ LuaDist/bin/luadist _test install module -verbose

Hopefully all goes ok. Have fun developing.