| DhMakePerl documentation | Contained in the DhMakePerl distribution. |
DhMakePerl::Command::locate - dh-make-perl locate implementation
This module implements the locate command of dh-make-perl(1).
Provides locate command implementation.
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.
| DhMakePerl documentation | Contained in the DhMakePerl distribution. |
package DhMakePerl::Command::locate;
use strict; use warnings; use base 'DhMakePerl'; use DhMakePerl::Utils qw(is_core_module);
sub execute { my $self = shift; @ARGV == 1 or die "locate command requires exactly one non-option argument\n"; my $apt_contents = $self->get_apt_contents; unless ($apt_contents) { die <<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->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; }
1;