File: dh_ocamlclean

package info (click to toggle)
dh-ocaml 2.5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 352 kB
  • sloc: xml: 1,746; perl: 1,063; sh: 244; makefile: 105
file content (68 lines) | stat: -rwxr-xr-x 1,715 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/perl -w

# Copyright © 2009 Mehdi Dogguy <mehdi@debian.org>
# Copyright © 2010 Stéphane Glondu <glondu@debian.org>
#
# This is free software, you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 or above
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA

=head1 NAME

dh_ocamlclean - Clean files generated by dh_ocamlinit.

=cut

use strict;
use Config::Tiny;
use Debian::Debhelper::Dh_Lib;
init();

=head1 SYNOPSIS

B<dh_ocamlclean> [S<I<debhelper options>>]

=head1 DESCRIPTION

dh_ocamlinit cleans files generated by dh_ocamlinit from present
debian/*.in ones.

=cut

my $suffix = ".in";

if ( -f "debian/dh-ocaml.conf" ) {
    my $Config = Config::Tiny->read( "debian/dh-ocaml.conf" );
    if ( defined( $Config->{ocamlinit}->{suffix} ) ) {
      $suffix = $Config->{ocamlinit}->{suffix};
    }
}

my @ocaml_in_files = split /\n/,
`find debian/ -type f -name "*$suffix" -not \\( -name control\.in \\) | sed "s/$suffix\\\$//"`;

inhibit_log();
complex_doit("rm -f ocamlinit-stamp @ocaml_in_files");
exit;

=head1 SEE ALSO

L<debhelper(7)>, L<dh(1)>, L<dh_ocaml(1)>, L<dh_ocamlinit(1)>

This program is meant to be used together with debhelper.

=head1 AUTHOR

Mehdi Dogguy <mehdi@debian.org>

=cut