From AppArmor
Revision as of 05:23, 11 August 2016 by Smb (Talk | contribs) (Merging a proposal into the apparmor-profiles repo)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

What are Launchpad and Bazaar

Launchpad is a web based platform for software development and code hosting.

Bazaar (also known as bzr) is a distributed version control system that is designed to be easy to use. It is the version control system of choice for launchpad and provides good integration with Launchpad.

More recently, Launchpad has added support for the git version control system.

Downloading AppArmor

Downloading tarballs

The current release tarballs can be found in [[1]], by selecting the series and then from the series page selecting the desired download.

Checking out the source tree with bazaar

To get an svn style checkout of the current development branch do

 bzr co lp:apparmor

to create a local branch

 bzr branch lp:apparmor

Checking out the apparmor source tree with git

There is work underway to move the AppArmor source trees to git. Otherwise, you can try to use git-bzr-ng as described in the Old Stuff section.

Checking out the apparmor-profiles repository with git

The AppArmor Profiles repository is now hosted with git on Launchpad. To check out (aka clone):

 git clone

AppArmor developers who have commit/push rights will probably want to use the git+ssh method instead:

 git clone git+ssh://

(See Configuring git with Launchpad to configure git to mimic the lp:apparmor-profiles bzr style references.)

Making a merge proposal to apparmor-profiles with launchpad and git

First, clone the master repo:

 git clone

Make a branch, and commit your changes to it:

 git branch -b BRANCH_NAME

(Hack away with tool of choice)

 git commit

Then, push your changes to launchpad. To do so:

  • add a remote repository under that is associated with the apparmor-profiles project:
 git remote add REMOTE_NAME git+ssh://

(YOUR_REPO_NAME can be something simple like apparmor-profiles. REMOTE_NAME should be something to let you know it points to an different location from the primary repo on Launchpad.)

  • push your branch

It should show up shortly at

and the specific branch should be available from

From the latter page, there should be an option under the section Branch Merges to Propose for Merging, which should point to

This page will let you propose a merge to the main project. The Target Reference Location is a fancy name for the main project's branch you wish to merge to; for the main apparmor-profiles development branch, you would enter master into this field.

Merging a proposal into the apparmor-profiles repo

NOTE: for apparmor-profiles maintainers

Once a merge proposal is in shape to be merged, do the following with git.

  • add the merging branch as a remote to your git tree:
 git remote add REMOTE_NAME git+ssh://
  • checkout their branch and review the commits:
  • switch back to master and merge their changes:
 git checkout master
 git merge --no-ff REMOTE_NAME/BRANCH_NAME

(The --no-ff will force a seperate merge commit, helping to clarify who merged/approved the branch. Include a short description, any bug reference urls "Bug: https://somesite/bug/123456/", and Acked-Bys as need be in the merge commit message.)

  • Once you're happy with the merge and your commit message (git commit --amend will let you edit your commit message), push the commit to launchpad:
 git push origin master

That's it! Launchpad will notice the merge and mark the state of the merge proposal as Merged. You can delete the remote from the merge requestor from your git tree, or you can keep it around if you expect the proposer to future merge requests.


Launchpad help



Old Stuff

The apparmor development repository is not currently mirrored with git. There is an effort underway to make this happen again

Checking out the source tree using git + git-bzr-ng

It is possible to checkout the userspace tools using git + git-bzr-ng

install git-bzr-ng copy into git commands

on Ubuntu cp /usr/lib/git-core/git-bzr
chmod +x /usr/lib/git-core/git-bzr

There is a known common issue with bzr-fast-import that can cause git-bzr-ng to fail with newer versions of bzr

To fix the issue we need to grab the patch from the end of the bug and patch bzr-fast-import. The patch can be found at the link below, click on the "download diff" link.

patch the bzrlib/ on your system

  • on Ubuntu it can be found at /usr/share/pyshared/bzrlib/

Clone the repository

git bzr clone lp:apparmor

 git clone git://

brief step by step of using bzr with AA