[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ next ]

svn-buildpackage - maintaining Debian packages with Subversion
Chapter 3 - Importing Debian packages


3.1 Importing from existing source package files

The svn-inject utility is intended to import already packaged source packages into a new subdirectory of the repository, creating the repository layout as needed. Normally, it takes two arguments: the .dsc file of your package and the base URL of the Subversion repository.

     svn-inject translucency_*dsc file:///tmp/z
     cp /tmp/translucency_0.6.0.orig.tar.gz /tmp/tarballs || true
     mkdir -p translucency/branches/upstream
     tar  -z -x -f /tmp/translucency_0.6.0.orig.tar.gz
     mv * current
     svn -q import -m"Installing original source version" translucency file:///tmp/z/translucency
     svn -m Tagging upstream source version copy file:///tmp/z/translucency/branches/
     upstream/current file:///tmp/z/translucency/branches/upstream/0.6.0 -q
     svn -m Forking to Trunk copy file:///tmp/z/translucency/branches/upstream/current file:///tmp/z/translucency/trunk -q
     dpkg-source -x /tmp/translucency_0.6.0-1.dsc
     dpkg-source: extracting translucency in translucency-0.6.0
     svn_load_dirs file:///tmp/z/translucency/trunk . *
     ...
     Running /usr/bin/svn propset svn:executable  initscript
     Running /usr/bin/svn propset svn:executable  debian/rules
     Running /usr/bin/svn propset svn:executable  mounttest.sh
     Running /usr/bin/svn propset svn:executable  mount.translucency
     Running /usr/bin/svn propget svn:eol-style base.h
     Running /usr/bin/svn propget svn:eol-style Makefile
     Running /usr/bin/svn propget svn:eol-style translucency.8
     Running /usr/bin/svn commit -m Load translucency-0.6.0 into translucency/trunk.
     
     Running /usr/bin/svn update
     Cleaning up /tmp/svn_load_dirs_jD7OenzVjI
     Storing trunk copy in /tmp/translucency.
     svn co file:///tmp/z/translucency/trunk /tmp/translucency -q
     svn propset svn:executable 1 debian/rules -q
     svn -m"Fixing debian/rules permissions" commit debian -q
     Done! Removing tempdir.
     Your working directory is /tmp/translucency - have fun!

If you omit the URL, svn-inject will try to use the URL of the current directory as base URL. I would not rely on this, however.


3.2 On-Build-Time merging

A special feature of svn-buildpackage is so called mergeWithUpstream-mode. Many projects do not want to keep the whole upstream source under revision control, eg. because of the large amount of required disc space and process time. Sometimes it makes sence to keep only the debian/ directory any maybe few other files under revision control.

The task of exporting the source from repository and adding it to the upstream source before building becomes annoying the time. But the svn-buildpackage tools automate most of this work for you: they switch to so called mergeWithUpstream-mode if a special flag has been detected: the mergeWithUpstream (Subversion) property of the debian directory. svn-buildpackage will merge the trunk with upstream source on build time and svn-upgrade will only update the changed files in this case.

To enable this feature during the inital import of the source package, simply add the -o switch to the svn-inject call and it will prepare the source for with mergeWithUpstream-mode: reduce the set of files to those modified for Debian and set the mergeWithUpstream property.

But what, if you decide to switch to mergeWithUpstream-mode after the package has been injected? To do this, checkout the whole repository, remove the files not changed in the Debian package from both upstream source and Debian branch (svn rm) and set the mergeWithUpstream property in the trunk directory with svn propset mergeWithUpstream 1.


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ next ]

svn-buildpackage - maintaining Debian packages with Subversion

$LastChangedDate: 2004-03-09 15:48:37 +0100 (Tue, 09 Mar 2004) $

Eduard Bloch