-
Notifications
You must be signed in to change notification settings - Fork 41
Dev: Guidelines
Source code repositories of existing projects are imported into LuaDist as follows:
- Projects already in git(hub) are forked. https://github.com/LuaDist/vstruct/network
- For lhf projects, we just import the latest 4.0, 5.0, and 5.1 tarballs. https://github.com/LuaDist/lpack/network
- For luaforge projects, recently partially converged to git, we cleanup the git conversion. https://github.com/LuaDist/luazip/network
- For google code projects without a lot of svn history, just use git-svn. https://github.com/LuaDist/luaex/network
- Other cases may still be decided. See Dev:-notes for details on how each import is done.
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.
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.
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 git@github.com: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.