[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RFC: Building a source package directly from a RCS



Hi,

the other day Ron Lee mentioned on irc how he builds a debian source
package from git with a wrapper script and there was some discussion of
the use and danger of the various -sX flags to dpkg-source.

His method creates both the .orig.tar.gz and .orig directory from his
git repository and tells dpkg to use them in an effort to save
extracting the orig.tar.gz needlessly. But that still means dpkg will
diff the orig against the working dir to create the diff.gz and risks
diverging orig.tar.gz and .orig dirs. And there are some problems
adapting this to the 3.0 formats. So the method isn't really optimal.


So lets look at this fresh. I'm assuming the following workflow and
repository layout:

upstream     - upstream source from the orig.tar.ext
pristine-tar - delta + id to recreate orig.tar.ext
debian       - debian directly only (without patches if patch-* is used)
master       - working dir

Optional (or stacked git ot mercurial patch queue):

patch-foo    - upstream + foo patched in
patch-bar    - upstream + bar patched in
patch-baz    - upstream + baz patched in

Automatic branch:

auto-patched     - upstream with all patch-* applied


Resolving merge conflicts for patch-* in some way is left to the
implementation. For simplicity lets assuming the patch-* branches are
already serialized and merge conflict free.

The above is just an example. What is required is that the orig source
is there, the debian dir is there and a branch with debian/patches/*
applied can be maintained (auto-patched).


Now to build a source I do the following:

1) if missing: create the orig.tar.ext using pristine-tar
2) if needed: update the auto-patched branch
3) Check out debian dir
4) if used: Create debian/patches/* from branches, stacked git,
   mercurial patch queue
5) generate debian/patches/debian-changes[-version] by "diffing"
   auto-patched against master
6) Create debian.tar.ext from 3+4+5
7) Create a .dsc file from 1+6

Overall this takes full benefit of the RCS and avoids for every (source)
build a costly unpacking of orig.tar.ext, patching and diffing the
source by using the superior features of the RCS to do the same job.

Curently I've put together a little wrapper, call it a proof-of-concept,
that does exactly that (except step 2). I use the 3.0 (custom) format
and in step 7 I run
  dpkg-source --target-format="3.0 (quilt)" -b foo-1.0 foo_1.0.orig.tar.gz foo_1.0-1.debian.tar.gz



So what do you think about this approach?

MfG
        Goswin


Reply to: