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

Re: dh_ocaml call without directories ?



On Tue, Aug 20, 2002 at 03:28:22PM +0200, Sven LUTHER wrote:
> Hello, ...
> 
> I have fixed ocaml-ldconf so it will add some files by default, but as a
> result ocaml-base doesn't have a directory specified anymore, and thus
> dh_ocamlld doesn't fill the the postinst anymore and the ld.conf file
> with the fixed default directories does not get built anymore.
> 
> I will workaround this by providing a ld.conf file with the package, but
> i think it would be better to fix dh_ocamlld so it will call
> ocaml-ldconf in the postinst even if there is no directory involved.

Hi Sven,

here is a patch (not tested).  I have very few time at the moment
and cannot test it, sorry.

Denis
--- debian/dh_ocamlld.orig	Wed Jun 19 12:03:48 2002
+++ debian/dh_ocamlld	Tue Aug 20 15:48:40 2002
@@ -41,15 +41,12 @@
 init();
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
-	my (@dirs, $DIR);
+	my $DIR = '';
 
-	if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
-		push @dirs, @ARGV;
-	}
-	if (@dirs && ! $dh{NOSCRIPTS}) {
-		$DIR = join(' -a ', @dirs);
+	if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && ! $dh{NOSCRIPTS}) {
+		$DIR = ' -a ' . join(' -a ', @ARGV) if @ARGV;
 		autoscript($package,"postinst","postinst-ocamlld", "s:#DIR#:$DIR:;s/#PACKAGE#/$package/");
-		my $DIR = join(' -r ', @dirs);
+		$DIR = ' -r ' . join(' -r ', @ARGV) if @ARGV;
 		autoscript($package,"postrm","postrm-ocamlld", "s:#DIR#:$DIR:;s/#PACKAGE#/$package/");
 	}
 }
--- debian/postinst-ocamlld.orig	Tue Aug 20 15:47:50 2002
+++ debian/postinst-ocamlld	Tue Aug 20 15:48:10 2002
@@ -1,3 +1,3 @@
 if [ "$1" = "configure" -a -x /usr/bin/ocaml-ldconf ]; then
-	/usr/bin/ocaml-ldconf -p #PACKAGE# -a #DIR#
+	/usr/bin/ocaml-ldconf -p #PACKAGE# #DIR#
 fi
--- debian/postrm-ocamlld.orig	Tue Aug 20 15:48:00 2002
+++ debian/postrm-ocamlld	Tue Aug 20 15:48:15 2002
@@ -1,3 +1,3 @@
 if [ "$1" = "remove" -a -x /usr/bin/ocaml-ldconf ]; then
-	/usr/bin/ocaml-ldconf -p #PACKAGE# -r #DIR#
+	/usr/bin/ocaml-ldconf -p #PACKAGE# #DIR#
 fi

Reply to: