Using version-info data with multi-branch packaging workflow

Ben Finney bignose+hates-spam at benfinney.id.au
Fri Sep 19 13:00:30 BST 2008


John Arbash Meinel <john at arbash-meinel.com> writes:

> Ben Finney wrote:
> > Can anyone show me an example of a code base that *is* using
> > 'version-info', creating source tarballs, and packaging them with
> > Debian?
> 
> We build the tarball using "make dist". And it would be pretty trivial
> to add a 'version_info.py' file. We already add the bzrlib/*.c files.
> 
> You can look at our Makefile:
> http://bazaar.launchpad.net/~bzr/bzr/trunk/annotate/3708?file_id=Makefile-20050805140406-d96e3498bb61c5bb

Okay, one significant difference I see is that I'm using setuptools,
while Bazaar uses distutils directly.

> dist:
>     version=`./bzr version --short` && \
>     echo Building distribution of bzr $$version && \
>  	        expbasedir=`mktemp -t -d tmp_bzr_dist.XXXXXXXXXX` && \
>  	        expdir=$$expbasedir/bzr-$$version && \
>     tarball=$$PWD/../bzr-$$version.tar.gz && \
>     $(MAKE) clean && \
>     $(MAKE) && \
>     bzr export $$expdir && \
>     cp bzrlib/*.c $$expdir/bzrlib/. && \
>     tar cfz $$tarball -C $$expbasedir bzr-$$version && \
>     gpg --detach-sign $$tarball && \
>  	        echo $$tarball done. && \
>     rm -rf $$expbasedir

Thanks for that.

I tried something similar, but the mammoth chain of commands got too
fragile and difficult to test.

So, I wrote a separate 'make-dist-tarball' program for the project,
using Bash shell. That turned out to be annoyingly difficult to craft
robustly, getting into the intricacies of updating the version-info
module only when needed and failing gracefully.

So I started again, trying to extend setuptools 'sdist' command to
discover the appropriate files; but that was even *more* baroque. The
love/hate relationship continues with that tool.


So my current implementation is a 'make-dist-tarball' written in
Python and making use of 'bzrlib'. This program gets invoked from the
'dist' target in the make rules.

The branch, in case anyone's interested. is online at
<URL:http://vcs.whitetree.org/bzr/public/gracie/gracie.devel/>.


My main regret is that this separate 'make-dist-tarball' process makes
the setuptools 'sdist' command useless, which means I can't use
'python setup.py register sdist upload' to easily get a new version to
the Cheese Shop.

-- 
 \                              “Holy polar ice sheet, Batman!” —Robin |
  `\                                                                   |
_o__)                                                                  |
Ben Finney




More information about the bazaar mailing list