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

Re: Best Packaging Practices, act II

Hi Raphael!

You wrote:

> Packaging tools and common cases :
> * Managing multiple patches
>   - dbs package
>   - hello-dbs is an example
>   - is there another tool that doesn't require to provide a tar archive
>     in the source package ?

The aumix package (2.7-19 and higher) handles this quite nicely.

It first put the patches in a make variable:

  PATCHES:=$(shell cd debian/diffs && ls *.patch)
  REVPATCHES:=$(strip $(shell A=; for i in $(PATCHES); do A="$$i $$A"; done; \
              echo $$A))

The REVPATCHES variable contains the patches in reverse sequence, which
is used to unapply them.

Then, new targets "patch" and "patch-stamp" are introduced that do the
actual patching:

  # apply patches in debian/diffs to source
  patch: patch-stamp
        for PATCH in $(PATCHES); do \
          echo \# Applying patch $$PATCH; \
          patch -p1 < debian/diffs/$$PATCH; \
        touch patch-stamp

And the clean target is modified to unapply the patches:

        # unapply patches
        [ -e "patch-stamp" ] && \
          for PATCH in $(REVPATCHES); do \
            echo \# Unapplying patch $$PATCH; \
            patch -R -p1 < debian/diffs/$$PATCH; \
          done || true
          rm -f patch-stamp
Kind regards,
| Bas Zoetekouw                  | Si l'on sait exactement ce   |
|--------------------------------| que l'on va faire, a quoi    |
| zoetekw@phys.uu.nl             | bon le faire?                |
|    bas@A-Es2.uu.nl             |               Pablo Picasso  |

To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: