diff mbox

UBUNTU: Pass DEB_MAINT_PARAMS to hook scripts

Message ID 20100820012004.GN21862@riva.ucam.org
State Accepted
Delegated to: Leann Ogasawara
Headers show

Commit Message

Colin Watson Aug. 20, 2010, 1:20 a.m. UTC
This matches
http://svn.debian.org/viewsvn/kernel/dists/trunk/linux-2.6?view=rev&revision=15014
(see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563161), and is
necessary in order to implement current boot loader packaging policies
(http://lists.debian.org/debian-kernel/2010/07/msg00078.html) in grub2.

Signed-off-by: Colin Watson <cjwatson@canonical.com>
---
 debian/control-scripts/postinst |    7 +++++++
 debian/control-scripts/postrm   |    7 +++++++
 debian/control-scripts/preinst  |    7 +++++++
 debian/control-scripts/prerm    |    7 +++++++
 4 files changed, 28 insertions(+), 0 deletions(-)

Comments

Tim Gardner Aug. 20, 2010, 1:44 p.m. UTC | #1
On 08/19/2010 07:20 PM, Colin Watson wrote:
> This matches
> http://svn.debian.org/viewsvn/kernel/dists/trunk/linux-2.6?view=rev&revision=15014
> (see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563161), and is
> necessary in order to implement current boot loader packaging policies
> (http://lists.debian.org/debian-kernel/2010/07/msg00078.html) in grub2.
>
> Signed-off-by: Colin Watson<cjwatson@canonical.com>
> ---
>   debian/control-scripts/postinst |    7 +++++++
>   debian/control-scripts/postrm   |    7 +++++++
>   debian/control-scripts/preinst  |    7 +++++++
>   debian/control-scripts/prerm    |    7 +++++++
>   4 files changed, 28 insertions(+), 0 deletions(-)
>
> diff --git a/debian/control-scripts/postinst b/debian/control-scripts/postinst
> index b1baa71..ce5ae56 100644
> --- a/debian/control-scripts/postinst
> +++ b/debian/control-scripts/postinst
> @@ -993,6 +993,13 @@ sub run_hook {
>     }
>   }
>
> +my $options;
> +for (@ARGV) {
> +	s,','\\'',g;
> +	$options .= " '$_'";
> +}
> +$ENV{'DEB_MAINT_PARAMS'}="$options";
> +
>   ## Run user hook script here, if any
>   if ($postinst_hook) {
>     &run_hook("postinst", $postinst_hook);
> diff --git a/debian/control-scripts/postrm b/debian/control-scripts/postrm
> index b81d7aa..227e351 100644
> --- a/debian/control-scripts/postrm
> +++ b/debian/control-scripts/postrm
> @@ -312,6 +312,13 @@ sub run_hook {
>     }
>   }
>
> +my $options;
> +for (@ARGV) {
> +	s,','\\'',g;
> +	$options .= " '$_'";
> +}
> +$ENV{'DEB_MAINT_PARAMS'}="$options";
> +
>   ## Run user hook script here, if any
>   if ($postrm_hook) {
>     &run_hook("postrm", $postrm_hook);
> diff --git a/debian/control-scripts/preinst b/debian/control-scripts/preinst
> index 11c335a..6824225 100644
> --- a/debian/control-scripts/preinst
> +++ b/debian/control-scripts/preinst
> @@ -272,6 +272,13 @@ sub run_hook {
>   }
>
>
> +my $options;
> +for (@ARGV) {
> +	s,','\\'',g;
> +	$options .= " '$_'";
> +}
> +$ENV{'DEB_MAINT_PARAMS'}="$options";
> +
>   ## Run user hook script here, if any
>   if (-x "$preinst_hook") {
>     &run_hook("preinst", $preinst_hook);
> diff --git a/debian/control-scripts/prerm b/debian/control-scripts/prerm
> index c214842..07e4146 100644
> --- a/debian/control-scripts/prerm
> +++ b/debian/control-scripts/prerm
> @@ -259,6 +259,13 @@ sub run_hook {
>   }
>
>
> +my $options;
> +for (@ARGV) {
> +	s,','\\'',g;
> +	$options .= " '$_'";
> +}
> +$ENV{'DEB_MAINT_PARAMS'}="$options";
> +
>   ## Run user hook script here, if any
>   if (-x "$prerm_hook") {
>     &run_hook("prerm", $prerm_hook);

Thanks Colin. I've gotten subscribed to debian-kernel@lists.debian.org 
so perhaps I can stay abreast of some of these changes.

Acked-by: Tim Gardner <tim.gardner@canonical.com>
Leann Ogasawara Aug. 20, 2010, 10:46 p.m. UTC | #2
Applied to Maverick linux master.

Thanks,
Leann

On Fri, 2010-08-20 at 02:20 +0100, Colin Watson wrote:
> This matches
> http://svn.debian.org/viewsvn/kernel/dists/trunk/linux-2.6?view=rev&revision=15014
> (see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563161), and is
> necessary in order to implement current boot loader packaging policies
> (http://lists.debian.org/debian-kernel/2010/07/msg00078.html) in grub2.
> 
> Signed-off-by: Colin Watson <cjwatson@canonical.com>
> ---
>  debian/control-scripts/postinst |    7 +++++++
>  debian/control-scripts/postrm   |    7 +++++++
>  debian/control-scripts/preinst  |    7 +++++++
>  debian/control-scripts/prerm    |    7 +++++++
>  4 files changed, 28 insertions(+), 0 deletions(-)
> 
> diff --git a/debian/control-scripts/postinst b/debian/control-scripts/postinst
> index b1baa71..ce5ae56 100644
> --- a/debian/control-scripts/postinst
> +++ b/debian/control-scripts/postinst
> @@ -993,6 +993,13 @@ sub run_hook {
>    }
>  }
>  
> +my $options;
> +for (@ARGV) {
> +	s,','\\'',g;
> +	$options .= " '$_'";
> +}
> +$ENV{'DEB_MAINT_PARAMS'}="$options";
> +
>  ## Run user hook script here, if any
>  if ($postinst_hook) {
>    &run_hook("postinst", $postinst_hook);
> diff --git a/debian/control-scripts/postrm b/debian/control-scripts/postrm
> index b81d7aa..227e351 100644
> --- a/debian/control-scripts/postrm
> +++ b/debian/control-scripts/postrm
> @@ -312,6 +312,13 @@ sub run_hook {
>    }
>  }
>  
> +my $options;
> +for (@ARGV) {
> +	s,','\\'',g;
> +	$options .= " '$_'";
> +}
> +$ENV{'DEB_MAINT_PARAMS'}="$options";
> +
>  ## Run user hook script here, if any
>  if ($postrm_hook) {
>    &run_hook("postrm", $postrm_hook);
> diff --git a/debian/control-scripts/preinst b/debian/control-scripts/preinst
> index 11c335a..6824225 100644
> --- a/debian/control-scripts/preinst
> +++ b/debian/control-scripts/preinst
> @@ -272,6 +272,13 @@ sub run_hook {
>  }
>  
> 
> +my $options;
> +for (@ARGV) {
> +	s,','\\'',g;
> +	$options .= " '$_'";
> +}
> +$ENV{'DEB_MAINT_PARAMS'}="$options";
> +
>  ## Run user hook script here, if any
>  if (-x "$preinst_hook") {
>    &run_hook("preinst", $preinst_hook);
> diff --git a/debian/control-scripts/prerm b/debian/control-scripts/prerm
> index c214842..07e4146 100644
> --- a/debian/control-scripts/prerm
> +++ b/debian/control-scripts/prerm
> @@ -259,6 +259,13 @@ sub run_hook {
>  }
>  
> 
> +my $options;
> +for (@ARGV) {
> +	s,','\\'',g;
> +	$options .= " '$_'";
> +}
> +$ENV{'DEB_MAINT_PARAMS'}="$options";
> +
>  ## Run user hook script here, if any
>  if (-x "$prerm_hook") {
>    &run_hook("prerm", $prerm_hook);
> -- 
> 1.7.1
> 
>
diff mbox

Patch

diff --git a/debian/control-scripts/postinst b/debian/control-scripts/postinst
index b1baa71..ce5ae56 100644
--- a/debian/control-scripts/postinst
+++ b/debian/control-scripts/postinst
@@ -993,6 +993,13 @@  sub run_hook {
   }
 }
 
+my $options;
+for (@ARGV) {
+	s,','\\'',g;
+	$options .= " '$_'";
+}
+$ENV{'DEB_MAINT_PARAMS'}="$options";
+
 ## Run user hook script here, if any
 if ($postinst_hook) {
   &run_hook("postinst", $postinst_hook);
diff --git a/debian/control-scripts/postrm b/debian/control-scripts/postrm
index b81d7aa..227e351 100644
--- a/debian/control-scripts/postrm
+++ b/debian/control-scripts/postrm
@@ -312,6 +312,13 @@  sub run_hook {
   }
 }
 
+my $options;
+for (@ARGV) {
+	s,','\\'',g;
+	$options .= " '$_'";
+}
+$ENV{'DEB_MAINT_PARAMS'}="$options";
+
 ## Run user hook script here, if any
 if ($postrm_hook) {
   &run_hook("postrm", $postrm_hook);
diff --git a/debian/control-scripts/preinst b/debian/control-scripts/preinst
index 11c335a..6824225 100644
--- a/debian/control-scripts/preinst
+++ b/debian/control-scripts/preinst
@@ -272,6 +272,13 @@  sub run_hook {
 }
 
 
+my $options;
+for (@ARGV) {
+	s,','\\'',g;
+	$options .= " '$_'";
+}
+$ENV{'DEB_MAINT_PARAMS'}="$options";
+
 ## Run user hook script here, if any
 if (-x "$preinst_hook") {
   &run_hook("preinst", $preinst_hook);
diff --git a/debian/control-scripts/prerm b/debian/control-scripts/prerm
index c214842..07e4146 100644
--- a/debian/control-scripts/prerm
+++ b/debian/control-scripts/prerm
@@ -259,6 +259,13 @@  sub run_hook {
 }
 
 
+my $options;
+for (@ARGV) {
+	s,','\\'',g;
+	$options .= " '$_'";
+}
+$ENV{'DEB_MAINT_PARAMS'}="$options";
+
 ## Run user hook script here, if any
 if (-x "$prerm_hook") {
   &run_hook("prerm", $prerm_hook);