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

Dev: Guidelines

drahosp edited this page Aug 7, 2011 · 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:
  • 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 generate dist.manifest file 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.
  • 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 bootstrap
$ cd ..
$ ./install bootstrap
$ cd _install
$ bin/luadist

Step 3. Configure LuaDist to use local Repository as primary dist source

$ # Edit LuaDist config
$ nano LuaDist/lib/lua/dist/config.lua

Add path to the local repository as follows:

-- URLs of repositories to search for dists. http:// or file:// URLs are cecognized atm.
repo = {
	--- Use local repo to speed things (NOTE: no tailing slash)
	"file:///home/myself/luadist/Repository",
	--- Official repo
	"https://github.com/LuaDist/Repository/raw/master/"
}

Now your local repository has precedence when installing modules. Modules not available in it will be fetched online.

Step 4. 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 5. Compilation and Development

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

$ LuaDist/bin/luadist _test install module -verbose=true

This will also look for any dependencies the module has. To reinstall it you can call make instead of install, the difference is that it overwrites the install, does not take dependencies into account and expects a path as the module identificator.

$ cd module
$ ../LuaDist/bin/luadist make . -verbose=true
$ # Repeat until development is done

Step 6. 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 7. Updating Repository

Once this is done we need to push Repository changes:

$ # Update manifest (get a coffee)
$ LuaDist/bin/lua manifest.lua
$ # Commit and publish
$ git commit dist.manifest -m "Added/Updated module"
$ git push

You can delete the local submodule and check install from online

$ rm -rf module
$ LuaDist/bin/luadist _test install module

Hopefully all goes ok. Have fun developing.

Clone this wiki locally