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

Re: ocaml 3.04-3 uploaded

On Fri, Jan 25, 2002 at 11:48:05AM +0100, Sven wrote:
> But it is not working, using dh_ocamlld -pocaml-base doesn't touch the
> postinst/rm, but addind a directory, either with -a<dir> or with I<dir> or
> with just <dir> is not working well, yielding errors of the kind :
> DH_AUTOSCRIPTDIR=/usr/local/sven/debian/ocaml/ocaml-3.04/debian
> debian/dh_ocamlld       \
>         -pocaml-base /usr/lib/ocaml/ /usr/lib/ocaml/labltk
> sed: -e expression #1, char 10: Unknown option to 's'
> But then maybe i severly misunderstood something ?

No, this is my own fault, here are new files.
I've added a test to check if /usr/bin/ocaml-ldconf exist before running
it, I think it could be useful.

#!/usr/bin/perl -w

=head1 NAME

dh_ocamlld - add calls to ocaml-ldconf in maintainer scripts


use strict;
use Debian::Debhelper::Dh_Lib;


B<dh_ocamlld> [S<I<debhelper options>>] [B<-A>] [B<-n>] S<I<dir ...>>


dh_ocamlld is a debhelper program that automatically adds calls to
C<ocaml-ldconf> in maintainer scripts.

=head1 OPTIONS

=over 4

=item B<-A>, B<--all>

Change maintainer scripts for ALL packages acted on, not just the first.

=item B<-n>, B<--noscripts>

Do nothing.

=item I<dir ...>

Specify directories to pass through C<ocaml-ldconf>.




foreach my $package (@{$dh{DOPACKAGES}}) {
	my (@dirs, $DIR);

	if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
		push @dirs, @ARGV;
	if (@dirs && ! $dh{NOSCRIPTS}) {
		$DIR = join(' -a ', @dirs);
		autoscript($package,"postinst","postinst-ocamlld", "s:#DIR#:$DIR:;s/#PACKAGE#/$package/");
		my $DIR = join(' -r ', @dirs);
		autoscript($package,"postrm","postrm-ocamlld", "s:#DIR#:$DIR:;s/#PACKAGE#/$package/");

=head1 AUTHOR

Denis Barbier E<lt>barbier@debian.orgE<gt>

if [ "$1" = "configure" -a -x /usr/bin/ocaml-ldconf ]; then
	/usr/bin/ocaml-ldconf -p #PACKAGE# -a #DIR#
if [ "$1" = "remove" -a -x /usr/bin/ocaml-ldconf ]; then
	/usr/bin/ocaml-ldconf -p #PACKAGE# -r #DIR#

Reply to: