diff -Nru perl-depends-2012.0701+gitb1fd535/bin/perl-depends.pl perl-depends-2016.1029+git8f67695/bin/perl-depends.pl --- perl-depends-2012.0701+gitb1fd535/bin/perl-depends.pl 2012-07-01 10:23:37.000000000 +0000 +++ perl-depends-2016.1029+git8f67695/bin/perl-depends.pl 2016-10-29 09:52:44.000000000 +0000 @@ -4,7 +4,7 @@ # # Copyright information # -# Copyright (C) 2009-2012 Jari Aalto +# Copyright (C) 2009-2016 Jari Aalto # # License # @@ -30,12 +30,13 @@ use strict; -use autouse 'Pod::Text' => qw( pod2text ); -use autouse 'Pod::Html' => qw( pod2html ); +use autouse 'Pod::Text' => qw(pod2text); +use autouse 'Pod::Html' => qw(pod2html); -use English qw( -no_match_vars ); +use English qw(-no_match_vars); use Getopt::Long; use File::Basename; +use File::Copy qw(cp); # **************************************************************************** # @@ -43,14 +44,14 @@ # # **************************************************************************** -use vars qw ( $VERSION ); +use vars qw ($VERSION); # This is for use of Makefile.PL and ExtUtils::MakeMaker # # The following variable is updated by custom Emacs setup whenever # this file is saved. -my $VERSION = '2012.0701.1021'; +my $VERSION = '2016.1029.0952'; my $inject = << 'EOF'; @@ -93,7 +94,7 @@ my $header; my %hash; - for my $lib ( @files ) + for my $lib (@files) { next if $lib =~ m,^/tmp/,; # /tmp/tLSYhLFqhj/ @@ -111,7 +112,7 @@ my $status = 0; - for my $key ( sort keys %hash ) + for my $key (sort keys %hash) { print "# PERL MODULE DPENDENCY LIST\n" unless $header++; printf "%-30s %s\n", $key, $hash{$key}; @@ -163,7 +164,7 @@ $PROGNAME = $LIB; $CONTACT = "Jari Aalto"; - $URL = "http://freecode.com/projects/perl-depends"; + $URL = "https://github.com/jaalto/project--perl-depends"; $OUTPUT_AUTOFLUSH = 1; } @@ -188,7 +189,7 @@ =head1 NAME -perl-depends - rough indicator of Perl module dependencies +perl-depends - Roughly find out module dependencies from Perl file(s) =head1 SYNOPSIS @@ -196,29 +197,30 @@ =head1 DESCRIPTION -An utility to show roughly what modules a program uses. Perl -evaluates "use" commands at compile time, storing the information -about loaded modules in the %INC variable. Comparing that list with -the standard Perl modules gives an estimate of the external module +Find out roughly the modules the program uses. This is based on the +idea that Perl evaluates the "use" commands at compile time and +stores the loaded module information in the %INC variable. By +examining the loaded modules and comparing them against the standard +Perl modules, the external module dependencies can be roughly dependencies. The dependency information can be used to determine what external modules have to be installed before the program can be used. -The target FILE have to be instrumented with the dependency checking -code. The resulting "binary" is then stored in a temporary file which -the user runs. +The target FILE has to be instrumented (a comouting term to inject +code) with the dependency checking code. The resulting script is then +stored in a temporary file which the user runs. This program does not run the instrumented files because it cannot know what possible options need to be passed for programs to -trigger "no behavior". That is, something that doesn't actually -involve executing the "binary" in real. Such options passed would -include --version, --dry-run, invalid options like ---generate-syntax-error-now, or invalid files etc to make program -stop on error. The user can know better the details of running the -intrumented files. +trigger I. That is, something that doesn't actually +involve executing the script for real. Such options might +include --version, --dry-run, or options like +--generate-syntax-error-now, or invalid arguments to make the program +stop with an error. The user is more likely to know the best way of +running the instrumented files. -An example of output: the external module depends here is +An example of output: the external module dependency here is 'Regexp::Common' and the rest of them can be ignored. Regexp::Common Regexp/Common.pm @@ -245,7 +247,7 @@ Print help in manual page C format. -=item B<-v, --verbose LEVEL> +=item B<-v, --verbose [LEVEL]> Print informational messages. Increase numeric LEVEL for more verbosity. @@ -258,10 +260,11 @@ =head1 EXAMPLES -Instrument a file, run it to see results and delete instrumentation: +Instrument a file, run it to see the results and delete instrumentated +script: perl-depends file.pl - perl file.pl.tmp --version + perl file.pl.tmp rm *.tmp =head1 TROUBLESHOOTING @@ -280,7 +283,7 @@ This program's exit status is not defined. -The instrumented programs exit status is 1 in case external modules +The instrumented program's exit status is 1 if external modules are displayed and 0 if no external modules are found. =head1 DEPENDENCIES @@ -289,7 +292,9 @@ =head1 BUGS AND LIMITATIONS -None. +If the target program's code conditionally loads mor perl modules +during execution, you must run the program for real to have those +modules detected. =head1 SEE ALSO @@ -297,7 +302,7 @@ =head1 AVAILABILITY -http://freecode.com/projects/perl-depends +https://github.com/jaalto/project--perl-depends =head1 AUTHOR @@ -305,7 +310,7 @@ =head1 LICENSE -Copyright (C) 2009-2011 Jari Aalto +Copyright (C) 2009-2016 Jari Aalto This program is free software; you can redistribute and/or modify program under the terms of GNU General Public license either version 2 @@ -320,15 +325,15 @@ my $type = shift; # optional arg, type my $msg = shift; # optional arg, why are we here... - if ( $type eq -html ) + if ($type eq -html) { pod2html $PROGRAM_NAME; } - elsif ( $type eq -man ) + elsif ($type eq -man) { eval "use Pod::Man"; - if ( $EVAL_ERROR ) + if ($EVAL_ERROR) { die "$id: Cannot load Pod::Man: $EVAL_ERROR"; } @@ -383,15 +388,15 @@ no_ignore_case_always )); - my ( $help, $helpMan, $helpHtml, $version ); - my ( $helpExclude, $optDir ); + my ($help, $helpMan, $helpHtml, $version); + my ($helpExclude, $optDir, $optDebug); - $debug = -1; + $debug = 0; $OPT_EXTENSION = ".tmp"; GetOptions # Getopt::Long ( - "debug" => \$optDir + "debug:i" => \$optDebug , "extesion=s" => \$OPT_EXTENSION , "help-exclude" => \$helpExclude , "help-html" => \$helpHtml @@ -408,8 +413,7 @@ $helpHtml and Help(-html); $version and Version(); - $debug = 1 if $debug == 0; - $debug = 0 if $debug < 0; + $debug = $optDebug if $optDebug; } # **************************************************************************** @@ -435,10 +439,14 @@ for my $file (@ARGV) { - my $dest = "$file$OPT_EXTENSION"; - system "cp $file $dest"; + # It' better not to unclude path becase + # you may not have write access to the directory. + + my $dest = basename "$file$OPT_EXTENSION"; + + cp $file, $dest; - if ( -f $dest ) + if (-f $dest) { open my $FILE, "<", $dest or next; diff -Nru perl-depends-2012.0701+gitb1fd535/ChangeLog perl-depends-2016.1029+git8f67695/ChangeLog --- perl-depends-2012.0701+gitb1fd535/ChangeLog 2012-07-01 10:23:37.000000000 +0000 +++ perl-depends-2016.1029+git8f67695/ChangeLog 2016-10-29 09:52:44.000000000 +0000 @@ -1,3 +1,18 @@ +2016-10-29 Sat Jari Aalto + + * bin/perl-depends.pl + Adjust code layout. + (require): File::Copy. + (HandleCommandLineArgs): Accept + LEVEL for --debug option. + (Main): Use File::Copy::cp and drop system() + cp(1) call. + For DEST file, drop path as we may not have write permission. + Copy DEST to current directory. + +2016-10-19 Wed Jari Aalto + + * bin/perl-depends.pl (POD): Fix spelling. + 2012-07-01 Sun Jari Aalto * bin/perl-depends.pl (Help): Update POD and fix grammar. Patch diff -Nru perl-depends-2012.0701+gitb1fd535/debian/changelog perl-depends-2016.1029+git8f67695/debian/changelog --- perl-depends-2012.0701+gitb1fd535/debian/changelog 2012-07-13 16:56:19.000000000 +0000 +++ perl-depends-2016.1029+git8f67695/debian/changelog 2016-10-29 10:22:37.000000000 +0000 @@ -1,3 +1,15 @@ +perl-depends (2016.1029+git8f67695-1) unstable; urgency=medium + + * New upstream release (Closes: #784025). + * debian/control + - (Homepage): Update. + - (Standards-Version): Update to 3.9.8. + - (Vcs-*): Update to anonscm.debian.org. + * debian/watch + - Activate. Use Github tags. + + -- Jari Aalto Sat, 29 Oct 2016 13:22:37 +0300 + perl-depends (2012.0701+gitb1fd535-1) unstable; urgency=low * New upstream release. diff -Nru perl-depends-2012.0701+gitb1fd535/debian/control perl-depends-2016.1029+git8f67695/debian/control --- perl-depends-2012.0701+gitb1fd535/debian/control 2012-07-13 16:56:19.000000000 +0000 +++ perl-depends-2016.1029+git8f67695/debian/control 2016-10-29 10:22:37.000000000 +0000 @@ -3,10 +3,10 @@ Priority: optional Maintainer: Jari Aalto Build-Depends: debhelper (>= 9) -Standards-Version: 3.9.3 -Vcs-Browser: http://git.debian.org/?p=collab-maint/perl-depends.git -Vcs-Git: git://git.debian.org/git/collab-maint/perl-depends.git -Homepage: http://freecode.com/projects/perl-depends +Standards-Version: 3.9.8 +Vcs-Browser: https://anonscm.debian.org/gitweb/?p=collab-maint/perl-depends.git +Vcs-Git: https://anonscm.debian.org/git/collab-maint/perl-depends.git +Homepage: https://github.com/jaalto/project--perl-depends Package: perl-depends Architecture: all diff -Nru perl-depends-2012.0701+gitb1fd535/debian/copyright perl-depends-2016.1029+git8f67695/debian/copyright --- perl-depends-2012.0701+gitb1fd535/debian/copyright 2012-07-13 16:56:19.000000000 +0000 +++ perl-depends-2016.1029+git8f67695/debian/copyright 2016-10-29 10:22:37.000000000 +0000 @@ -1,19 +1,20 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0 +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0 Upstream-Name: perl-depends Upstream-Contact: Jari Aalto -Source: http://freecode.com/projects/perl-depends -X-Upstream-Vcs: git://git.savannah.nongnu.org/perl-depends.git -X-Upstream-Bugs: https://savannah.nongnu.org/bugs/?group=perl-depends -X-Source: http://sourceforge.net/projects/ +Source: https://github.com/jaalto/project--perl-depends +Comment: + Github is the master. Mirror at + git://git.savannah.nongnu.org/perl-depends.git + https://savannah.nongnu.org/bugs/?group=perl-depends Files: * Copyright: - 2009-2012 Jari Aalto + 2009-2016 Jari Aalto License: GPL-2+ Files: debian/* Copyright:a - 2010-2012 Jari Aalto + 2010-2016 Jari Aalto License: GPL-2+ License: GPL-2+ diff -Nru perl-depends-2012.0701+gitb1fd535/debian/watch perl-depends-2016.1029+git8f67695/debian/watch --- perl-depends-2012.0701+gitb1fd535/debian/watch 2012-07-13 16:56:19.000000000 +0000 +++ perl-depends-2016.1029+git8f67695/debian/watch 2016-10-29 10:22:37.000000000 +0000 @@ -1,5 +1,2 @@ version=3 -# https://savannah.nongnu.org/files/?group=perl-depends - -# NOTE: This project is packaged directly from upstream Git. See -# copyright file for URL to project page. +https://github.com/jaalto/project--perl-depends/tags .*/(.*)\.tar\.gz diff -Nru perl-depends-2012.0701+gitb1fd535/Makefile perl-depends-2016.1029+git8f67695/Makefile --- perl-depends-2012.0701+gitb1fd535/Makefile 2012-07-01 10:23:37.000000000 +0000 +++ perl-depends-2016.1029+git8f67695/Makefile 2016-10-29 09:52:44.000000000 +0000 @@ -2,7 +2,7 @@ # # Copyright information # -# Copyright (C) 2009-2010 Jari Aalto +# Copyright (C) 2009-2016 Jari Aalto # # License # diff -Nru perl-depends-2012.0701+gitb1fd535/README perl-depends-2016.1029+git8f67695/README --- perl-depends-2012.0701+gitb1fd535/README 2012-07-01 10:23:37.000000000 +0000 +++ perl-depends-2016.1029+git8f67695/README 2016-10-29 09:52:44.000000000 +0000 @@ -1,12 +1,13 @@ README: perl-depends - Roughly find out module depends from a Perl file ----------------------------------------------------------------------- -Find out roughly the modules the program uses. This is based on the -idea, that Perl evaluates the "use" commands at compile time and -stores the loaded module information into the %INC variable. By -examining the loaded modules and comparing them against the standard -Perl modules, the external module dependencies can be roughly -estimated. +Roughly find out module depends from a Perl file + +This is based on the idea, that Perl evaluates the "use" commands at +compile time and stores the loaded module information into the %INC +variable. By examining the loaded modules and comparing them against +the standard Perl modules, the external module dependencies can be +roughly estimated. The source package directories: @@ -22,20 +23,20 @@ Project details Homepage - http://freecode.com/projects/perl-depends + https://github.com/jaalto/project--perl-depends To report bugs - See freecode page + See above Source code repository - See freecode page + See above Depends Perl (any version). Uses only standard Perl libraries. Copyright - Copyright (C) 2009-2010 Jari Aalto + Copyright (C) 2009-2016 Jari Aalto License