<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package DhMakePerl::Command::locate;

=head1 NAME

DhMakePerl::Command::locate - dh-make-perl locate implementation

=head1 DESCRIPTION

This module implements the I&lt;locate&gt; command of L&lt;dh-make-perl(1)&gt;.

=cut

use strict; use warnings;

our $VERSION = '0.66';

use base 'DhMakePerl';

use DhMakePerl::Utils qw(is_core_module);

=head1 METHODS

=over

=item execute

Provides I&lt;locate&gt; command implementation.

=cut

sub execute {
    my $self = shift;

    @ARGV == 1
        or die "locate command requires exactly one non-option argument\n";

    my $apt_contents = $self-&gt;get_apt_contents;

    unless ($apt_contents) {
        die &lt;&lt;EOF;
Unable to locate module packages, because APT Contents files
are not available on the system.

Install the 'apt-file' package, run 'apt-file update' as root
and retry.
EOF
    }
    my $mod = $ARGV[0];

    if ( defined( my $core_since = is_core_module($mod) ) ) {
        print "$mod is in Perl core (package perl)";
        print $core_since ? " since $core_since\n" : "\n";
        return 0;
    }

    if ( my $pkg = $apt_contents-&gt;find_perl_module_package($mod) ) {
        print "$mod is in $pkg package\n";
        return 0;
    }

    print "$mod is not found in any Debian package\n";
    return 1;
}

=back

=cut

1;

=head1 COPYRIGHT &amp; LICENSE

=over

=item Copyright (C) 2009 Franck Joncourt &lt;franck.mail@dthconnex.com&gt;

=item Copyright (C) 2009, 2010 Damyan Ivanov &lt;dmn@debian.org&gt;

=back

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License version 2 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., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301 USA.

=cut

</pre></body></html>