[26312] in Source-Commits

home help back first fref pref prev next nref lref last post

Re: /svn/athena r25061 - in trunk/debathena/debathena/config-package-dev:

daemon@ATHENA.MIT.EDU (Geoffrey Thomas)
Thu May 17 00:43:35 2012

Date: Wed, 16 May 2012 21:43:32 -0700 (PDT)
From: Geoffrey Thomas <geofft@MIT.EDU>
To: Anders Kaseorg <andersk@MIT.EDU>
cc: source-commits@MIT.EDU
In-Reply-To: <201103170151.p2H1p8tC016974@drugstore.mit.edu>
Message-ID: <alpine.DEB.2.00.1205162141200.14681@dr-wily.mit.edu>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="-1257051904-20741835-1337229812=:14681"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---1257051904-20741835-1337229812=:14681
Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

Shouldn't this be testing for DH_COMPAT at least 6, not 5?

From=20the debhelper man page:
"""
v6  Changes from v5 are:

     -       Commands that generate maintainer script fragments will
             order the fragments in reverse order for the prerm and
             postrm scripts.
"""

--=20
Geoffrey Thomas
geofft@mit.edu

On Wed, 16 Mar 2011, Anders Kaseorg wrote:

> Author: andersk
> Date: 2011-03-16 21:51:08 -0400 (Wed, 16 Mar 2011)
> New Revision: 25061
>
> Modified:
>   trunk/debathena/debathena/config-package-dev/debconf-divert.mk
>   trunk/debathena/debathena/config-package-dev/debian/changelog
>   trunk/debathena/debathena/config-package-dev/divert.mk
> Log:
>
>
> Modified: trunk/debathena/debathena/config-package-dev/debconf-divert.mk
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- trunk/debathena/debathena/config-package-dev/debconf-divert.mk=092011=
-03-17 01:51:07 UTC (rev 25060)
> +++ trunk/debathena/debathena/config-package-dev/debconf-divert.mk=092011=
-03-17 01:51:08 UTC (rev 25061)
> @@ -27,6 +27,8 @@
> DEB_DEBCONF_HACK_PACKAGES +=3D $(foreach package,$(DEB_ALL_PACKAGES), \
>     $(if $(wildcard debian/$(package).debconf-hack),$(package)))
>
> +dh_compat_5 :=3D $(shell if [ '$(DH_COMPAT)' -ge 5 ]; then echo y; fi)
> +
> $(patsubst %,debian-debconf-hack/%,$(DEB_DEBCONF_HACK_PACKAGES)) :: debia=
n-debconf-hack/%:
> =09set -e; \
> =09{ \
> @@ -48,12 +50,22 @@
> =09} >> $(CURDIR)/debian/$(cdbs_curpkg).postinst.debhelper
> =09set -e; \
> =09{ \
> +=09    $(if $(dh_compat_5),, \
> +=09=09if [ -e $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper ]; then \
> +=09=09    cat $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper; \
> +=09=09fi;) \
> =09    cat $(DEB_DEBCONF_HACK_SCRIPT); \
> =09    echo 'if [ -f /var/cache/$(cdbs_curpkg).debconf-save ]; then'; \
> =09    echo '    debconf_set </var/cache/$(cdbs_curpkg).debconf-save'; \
> =09    echo '    rm -f /var/cache/$(cdbs_curpkg).debconf-save'; \
> =09    echo 'fi'; \
> -=09} >> $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper
> +=09    $(if $(dh_compat_5), \
> +=09=09if [ -e $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper ]; then \
> +=09=09    cat $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper; \
> +=09=09fi;) \
> +=09} >> $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper.new
> +=09mv $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper.new \
> +=09    $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper
>
> $(patsubst %,binary-fixup/%,$(DEB_DEBCONF_HACK_PACKAGES)) :: binary-fixup=
/%: debian-debconf-hack/%
>
>
> Modified: trunk/debathena/debathena/config-package-dev/debian/changelog
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- trunk/debathena/debathena/config-package-dev/debian/changelog=092011-=
03-17 01:51:07 UTC (rev 25060)
> +++ trunk/debathena/debathena/config-package-dev/debian/changelog=092011-=
03-17 01:51:08 UTC (rev 25061)
> @@ -13,8 +13,10 @@
>   * Remove DEB_UNDIVERT_VERSION_file and DEB_UNREMOVE_VERSION_file, and
>     instead test for the undiverted file in the postinst.  (Patch from
>     Evan Broder.)
> +  * Write the prerm and postrm maintainer script fragments in reverse
> +    order when DH_COMPAT =E2=89=A5 5, to match debhelper=E2=80=99s behav=
ior.
>
> - -- Anders Kaseorg <andersk@mit.edu>  Sat, 06 Nov 2010 19:02:52 -0400
> + -- Anders Kaseorg <andersk@mit.edu>  Sat, 05 Feb 2011 21:21:59 -0500
>
> config-package-dev (4.11) unstable; urgency=3Dlow
>
>
> Modified: trunk/debathena/debathena/config-package-dev/divert.mk
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- trunk/debathena/debathena/config-package-dev/divert.mk=092011-03-17 0=
1:51:07 UTC (rev 25060)
> +++ trunk/debathena/debathena/config-package-dev/divert.mk=092011-03-17 0=
1:51:08 UTC (rev 25061)
> @@ -57,6 +57,11 @@
> # removed
> remove_files_name =3D /usr/share/$(cdbs_curpkg)/$(shell $(DEB_DIVERT_ENCO=
DER) $(1))
>
> +dh_compat_5 :=3D $(shell if [ '$(DH_COMPAT)' -ge 5 ]; then echo y; fi)
> +
> +reverse =3D $(foreach n,$(shell seq $(words $(1)) -1 1),$(word $(n),$(1)=
))
> +reverse_dh_compat_5 =3D $(if $(dh_compat_5),$(call reverse,$(1)),$(1))
> +
> debian-divert/%: package =3D $(subst debian-divert/,,$@)
> debian-divert/%: divert_files =3D $(DEB_DIVERT_FILES_$(package)) $(DEB_TR=
ANSFORM_FILES_$(package))
> debian-divert/%: divert_remove_files =3D $(DEB_REMOVE_FILES_$(package))
> @@ -88,16 +93,26 @@
> # Add code to prerm script to undo diversions when package is removed.
> =09set -e; \
> =09{ \
> +=09    $(if $(dh_compat_5),, \
> +=09=09if [ -e $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper ]; then \
> +=09=09    cat $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper; \
> +=09=09fi;) \
> =09    sed 's/#PACKAGE#/$(cdbs_curpkg)/g; s/#DEB_DIVERT_EXTENSION#/$(DEB_=
DIVERT_EXTENSION)/g' $(DEB_DIVERT_SCRIPT); \
> =09    $(if $(divert_files_thispkg), \
> =09=09echo 'if [ "$$1" =3D "remove" ]; then'; \
> -=09=09$(foreach file,$(divert_files), \
> +=09=09$(foreach file,$(call reverse_dh_compat_5,$(divert_files)), \
> =09=09    echo "    undivert_unlink $(call divert_files_replace_name,$(fi=
le), )";) \
> -=09=09$(foreach file,$(divert_remove_files), \
> +=09=09$(foreach file,$(call reverse_dh_compat_5,$(divert_remove_files)),=
 \
> =09=09    echo "    undivert_unremove $(file) $(cdbs_curpkg)";) \
> =09=09echo 'fi'; \
> =09    ) \
> -=09} >> $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper
> +=09    $(if $(dh_compat_5), \
> +=09=09if [ -e $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper ]; then \
> +=09=09    cat $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper; \
> +=09=09fi;) \
> +=09} >> $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper.new
> +=09mv $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper.new \
> +=09    $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper
> # Add an encoding of the names of the diverted files to the Provides:
> # and Conflicts: lists.  This prevents two packages diverting the same
> # file from being installed simultaneously (it cannot work, and this
>
>
---1257051904-20741835-1337229812=:14681--

home help back first fref pref prev next nref lref last post