今天遇到split mode这样一个新概念,和大家分享一下~~~
http://jameswestby.net/bzr/builddeb/user_manual/split.html
没有时间翻译,大家将就看下吧~~~~
Split modeSplit mode is quite a specialised mode. It is for people who are both theupstream author and maintainer of a package. It allows you to maintain bothin a single branch, but have a separation during the build, and not have tocreate the upstream tarball by hand.
Some people like this way of working, but it does make it harder for someoneelse to take over maintenance of the package at a later date.
This mode should not be used by those who are not the upstream author of apackage, and who are not making the upstream tarball releases.
This mode is a mixture of most of the other modes. You have the upstreamcode and the packaging in the same branch like normal mode andnative mode, but the only packaging changes can be in the debian/directory, like merge mode.
Setting up the packageBefore creating the package it may be beneficial to set up a sharedrepository for the package. Shared in this context means shared between yourbranches, rather than shared between users in a public location, the lattercan be done later. To set up a repository then you should run (for a packagenamed scruff)
$ bzr init-repo ~/packages/scruff/
$ cd ~/packages/scruff/
and then do all of your work in that directory.
Creating a New PackageTo create a new package using split mode you need to create a branch to holdall of the work. If it is a completely new project and there is no code yetthen you can run
$ bzr init scruff/
$ cd scruff/
if you already have some code, then you can rename the directory containingthat code to ~/packages/scruff/scruff and then run
$ cd scruff/
$ bzr init
$ bzr add
which will create a branch and add all of your current code to it.The next step is to tell bzr-builddeb that it is a split mode package. Todo this create the configuration file .bzr-builddeb/default.conf in thebranch. This contains the options that are default for building the package.The file starts with a [BUILDDEB] header to identify the options thatthe plugin should use, and the option that you need to set is split.The following commands will set up the configuration files for you:
$ echo -e '[BUILDDEB]\nsplit = True' > .bzr-builddeb/default.conf
$ bzr add .bzr-builddeb/default.conf
When you are happy with the code you can commit, and then build the package.bzr-builddeb will see that it is a split mode package and create theupstream tarball out of the branch after removing the debian/directory. The debian/ directory will then form the .diff.gz.
Importing HistoryIt is not currently possible to import history from source packages in splitmode. Hopefully this will be possible at some point in the future.
New upstream versionCreating a new upstream version of the package is easy in split mode. It ismerely a case of updating the debian/changelog. The dch tool fromdevscripts can help you here. To create the 0.2-1 version of thepackage you can run
$ dch -v 0.2-1
and enter a message about the new version. Then when you next build thepackage it will have the correct version number.