Commit a2c231d6 authored by Christoph Berg's avatar Christoph Berg

Stop automatically updating debian/control from debian/control.in in

pgxs_debian_control.mk. Instead, implement "checkcontrol" and
"updatecontrol" actions in pg_buildext. checkcontrol is run from
pgxs_debian_control.mk and will warn if an update is required.
Backport and pgdg builds will still automatically update.
(Closes: #758570)
parent 1552c04c
postgresql-common (161) UNRELEASED; urgency=medium
* Stop automatically updating debian/control from debian/control.in in
pgxs_debian_control.mk. Instead, implement "checkcontrol" and
"updatecontrol" actions in pg_buildext. checkcontrol is run from
pgxs_debian_control.mk and will warn if an update is required.
Backport and pgdg builds will still automatically update.
(Closes: #758570)
* pg_virtualenv: Use "ip" to start lo when available.
-- Christoph Berg <myon@debian.org> Fri, 15 Aug 2014 10:13:51 +0200
......
......@@ -153,6 +153,15 @@ versions() {
done < debian/pgversions
}
gencontrol() {
tmpcontrol=$(mktemp debian/control.XXXXXX)
trap "rm -f $tmpcontrol" 0 2 3 15
grep-dctrl -vP PGVERSION debian/control.in > $tmpcontrol
for v in $(versions); do
grep-dctrl -P PGVERSION debian/control.in | sed -e "s:PGVERSION:$v:" >> $tmpcontrol
done
}
# when a version is included in the action, just act on this one (this is
# useful if some extra work needs to be done per version, so the loop over
# supported-versions needs to be in the script calling pg_buildext)
......@@ -165,13 +174,32 @@ case $action in
$a $v
exit
;;
checkcontrol)
gencontrol
if ! diff -u debian/control $tmpcontrol; then
if [ "${PG_UPDATECONTROL:-no}" != "no" ] || head -1 debian/changelog | egrep -q -- '-backports|-pgdg|-pgapt'; then
echo "Notice: Updating debian/control from debian/control.in."
mv $tmpcontrol debian/control
exit
fi
echo "Error: debian/control needs updating from debian/control.in. Run 'pg_buildext updatecontrol'."
echo "If you are seeing this message in a buildd log, a sourceful upload is required."
exit 1
fi
exit
;;
updatecontrol)
gencontrol
mv $tmpcontrol debian/control
exit
;;
esac
# loop over versions
VERSIONS=`versions`
for v in $VERSIONS
for v in $(versions)
do
case "$action" in
"supported-versions")
......
......@@ -24,11 +24,11 @@ backports of newer PostgreSQL releases), or for all PostgreSQL releases when
the package is built for B<apt.postgresql.org>.
As the set of binary packages depends on the target PostgreSQL versions,
C<debian/control> is auto-generated. Include
C<debian/control> is generated from a template in C<debian/control.in> when
B<pg_buildext updatecontrol> is run. Occurrences of B<PGVERSION> in package
sections are replaced by the target PostgreSQL version. Include
C</usr/share/postgresql-common/pgxs_debian_control.mk> in C<debian/rules> to
regenerate the control file from C<debian/control.in> at "clean" time.
Occurrences of B<PGVERSION> in package sections are replaced by the target
PostgreSQL version.
run a check at build time if updating debian/control is required.
As B<pg_buildext> invokes B<make> for the B<build>, B<install>, and B<clean>
actions, invocations from C<debian/rules> (which is a makefile) should be prefixed
......@@ -64,6 +64,18 @@ against. (Usually this parameter is C<build-%v>.)
Print effective list of supported versions, i.e. the intersection of the sets
of versions supported by the system and the package.
=item B<checkcontrol>
Check if C<debian/control> needs updating from C<debian/control.in>. This is
invoked from C</usr/share/postgresql-common/pgxs_debian_control.mk>. When
building for a B<backports> or B<pgdg> suite as determined by
C<debian/changelog>, this action also updates the control file. Otherwise,
B<updatecontrol> needs to be run manually.
=item B<updatecontrol>
Update C<debian/control> from C<debian/control.in>.
=item B<configure> I<build-dir> [I<extra-configure-options>]
For every supported version, call B<../configure> from the I<build-dir>
......
......@@ -6,14 +6,8 @@
# Author: Dimitri Fontaine <dfontaine@hi-media.com>
#
debian/control: debian/control.in debian/pgversions
(set -e; \
VERSIONS=`pg_buildext supported-versions $(CURDIR)`; \
grep-dctrl -vP PGVERSION $< > $@.pgxs_tmp; \
for v in $$VERSIONS; do \
grep-dctrl -P PGVERSION $< | sed -e "s:PGVERSION:$$v:" >> $@.pgxs_tmp; \
done; \
mv $@.pgxs_tmp $@) || (rm -f $@.pgxs_tmp; exit 1)
pg_buildext checkcontrol
# Rebuild debian/control when clean is invoked
# run check when clean is invoked
clean: debian/control
.PHONY: debian/control
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment