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

Re: po-debconf patches and woody backportability (was: Re: [VAC] 25 july - 26 august)



On Thu, Jul 24, 2003 at 10:46:02AM +0200, Christian Perrier wrote:
> (this may be quoted outside -private......possible followups belong to
> -devel....I never remember the correct method for moving a thread out
> of -private)

Moved to -devel, then, and copied to -i18n because people there are
probably often involved in patching for po-debconf.

> Quoting Colin Watson (cjwatson@debian.org):
> > Would it be possible for such patches to be routinely produced in a way
> > that preserves the ability to build easily on woody, particularly for
> > packages in base? The openssh package has a technique for doing this
> > which you could probably reuse practically verbatim.
> 
> You're right?: this may be an argument which prevents maintainers to
> adopt the currently sent "please switch to gettext-based debconf
> templates" patch.
> 
> Most maintainers, usually motivated and active maintainers (?:-)) try
> to keep their packages easy to backport.
> 
> .../...
> 
> I'm looking at openssh's method?: it basically uses po2debconf on a
> "master" file prior to dh_installdebconf. That's probably the
> simpliest thing to do....except that po-debconf doesn't exist on
> woody.....how is this solved for woody backports of openssh??

The idea behind the openssh scheme is that the maintainer (or whoever's
building the package for upload to unstable) has to build on a machine
with po-debconf installed, but nobody else does.

When building with po-debconf, a format 1 (no encoding specifications,
woody-compatible) debian/templates file is generated in the clean target
and shipped in the source package, but a format 2 (UTF8-encoded,
woody-incompatible) debian/templates file is generated in binary-arch
for the binary package only.

When building without po-debconf, the binary package simply reuses the
woody-compatible debian/templates file that was produced by the clean
target of the maintainer's build.

This requires the following code:

ifeq (,$(wildcard /usr/bin/po2debconf))
PO2DEBCONF := no
MINDEBCONFVER := 0.5
else
PO2DEBCONF := yes
MINDEBCONFVER := 1.2.0
endif

clean:
	[...]
ifeq ($(PO2DEBCONF),yes)
	# Hack for woody compatibility. This makes sure that the
	# debian/templates file shipped in the source package doesn't
	# specify encodings, which woody's debconf can't handle. If building
	# on a system with po-debconf installed (conveniently debhelper (>=
	# 4.1.16) depends on it), the binary-arch target will generate a
	# better version for sarge.
	echo 1 > debian/po/output
	po2debconf debian/templates.master > debian/templates
	rm -f debian/po/output
endif
	[...]

binary-arch:
	[...]
ifeq ($(PO2DEBCONF),yes)
	po2debconf -e utf8 debian/templates.master > debian/templates
endif
	[...]
	dh_gencontrol -- -V'debconf-depends=debconf (>= $(MINDEBCONFVER))'
	[...]

debian/control has ${debconf-depends} in the appropriate Depends: line.

This approach is a little more complicated, but it seems very robust in
practice, and makes backports perfectly smooth. I recommend it for
people converting packages to po-debconf before the release of sarge.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: