On Thu, 07 May 2009, Fabian Greffrath wrote:
> reassign 527255 quilt
> retitle 527255 Please provide a dh sequence addon
> thanks

Please put the maintainer on copy when reassigning so that we know
immediately what it's about.

>> However, noone has bothered to write such an addon for any patch system
>> yet, AFAIK. I've suggested to various people that they do so, but nobody
>> has bitten yet, and as I don't use patch systems, I'm not the one to do it.
>> (Though I'm happy to offer technical support to anyone working on it.)
>> Also, the sequence addons don't really belong in debhelper, but instead
>> in the patch system packages. (So this bug should probably be
>> reassigned.)
>
> Alright, so I have reassigned it to the quilt package in hope that  
> someone picks it up and does the dirty work...

I very much like the idea ! Attached is a first patch for it. It still
needs manual pages for the new commands but otherwise seems to work in my
quick tests.

I would welcome some more review. I chose to call dh_quilt_unpatch before
dh_clean because dh_clean should be the last command in charge on cleanup
of any cruft left.

Note that with the makefile based approach, the unpatch target is a
dependency of the clean target so it's even called before dh_auto_clean.
I wonder if this difference is a problem or on the contrary an improvement...

Cheers,
-- 
Raphaël Hertzog

Contribuez à Debian et gagnez un cahier de l'admin Debian Lenny :
http://www.ouaza.com/wp/2009/03/02/contribuer-a-debian-gagner-un-livre/
>From fe1b8c8c083767b8e693b9480c96d410b99de394 Mon Sep 17 00:00:00 2001
From: Raphael Hertzog <hert...@debian.org>
Date: Thu, 7 May 2009 21:51:36 +0200
Subject: [PATCH] =?utf-8?q?Add=20a=20dh=20sequence=20addon=20to=20allow=20=E2=80=9Cdh=20--with=20quilt=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

---
 debian/changelog        |    8 ++++++++
 debian/dh_quilt_patch   |    6 ++++++
 debian/dh_quilt_unpatch |    7 +++++++
 debian/quilt.install    |    3 +++
 debian/quilt.pm         |    9 +++++++++
 5 files changed, 33 insertions(+), 0 deletions(-)
 create mode 100755 debian/dh_quilt_patch
 create mode 100755 debian/dh_quilt_unpatch
 create mode 100644 debian/quilt.pm

diff --git a/debian/changelog b/debian/changelog
index 02641d4..2468f1a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+quilt (0.46-7) UNRELEASED; urgency=low
+
+  * Add a debhelper addon so that the dh command can do patch management with
+    a simple "dh --with quilt $@" in the tiny rules file provided by debhelper
+    7. Closes: #527255
+
+ -- Raphael Hertzog <hert...@debian.org>  Thu, 07 May 2009 19:24:58 +0200
+
 quilt (0.46-6) unstable; urgency=low
 
   * Change back patchsys-quilt.mk to enter DEB_SRCDIR by default before
diff --git a/debian/dh_quilt_patch b/debian/dh_quilt_patch
new file mode 100755
index 0000000..af5100f
--- /dev/null
+++ b/debian/dh_quilt_patch
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+set -e
+
+export QUILT_PATCHES=debian/patches
+quilt push -a || test $? = 2
diff --git a/debian/dh_quilt_unpatch b/debian/dh_quilt_unpatch
new file mode 100755
index 0000000..2e7b033
--- /dev/null
+++ b/debian/dh_quilt_unpatch
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+export QUILT_PATCHES=debian/patches
+quilt pop -a || test $? = 2
+rm -rf .pc
diff --git a/debian/quilt.install b/debian/quilt.install
index 58dae67..ea206a0 100644
--- a/debian/quilt.install
+++ b/debian/quilt.install
@@ -13,3 +13,6 @@ usr/share/quilt/*
 ../../doc/quilt.txt usr/share/doc/quilt
 ../../quilt.quiltrc usr/share/doc/quilt
 ../dpatch2quilt.sh  usr/share/doc/quilt/examples
+
+../dh_quilt_* usr/bin
+../quilt.pm   usr/share/perl5/Debian/Debhelper/Sequence
diff --git a/debian/quilt.pm b/debian/quilt.pm
new file mode 100644
index 0000000..7e42ba1
--- /dev/null
+++ b/debian/quilt.pm
@@ -0,0 +1,9 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+insert_before("dh_auto_configure", "dh_quilt_patch");
+insert_before("dh_clean", "dh_quilt_unpatch");
+
+1;
-- 
1.6.2.4

Reply via email to