junoscript-perl
view release on metacpan or search on metacpan
install-prereqs.pl view on Meta::CPAN
# Copyright (c) 2001-2003, Juniper Networks, Inc.
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# 3. The name of the copyright owner may not be used to
# endorse or promote products derived from this software without specific
# prior written permission.
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
use POSIX qw(uname);
use install;
use Benchmark;
use constant OUTPUT_DATA_FORMAT => "%-30s %-10s";
use constant OUTPUT_TITLE_FORMAT => "%-30s %-10s%s\n";
use constant OUTPUT_TITLE => "\n======================= PERL MODULE INSTALLATION ======================\n\n";
use constant OUTPUT_ENDING => "\n=======================================================================\n\n";
use constant OUTPUT_DIVIDER => "\n-----------------------------------------------------------------------\n\n";
use constant LOG_HIGHLITE => "=====================================================\n%s\n=====================================================\n";
#
# Set AUTOFLUSH to true
#
$| = 1;
# print the usage of this script
sub output_usage
{
my $usage = "
Usage: $0 [options]
Options:
-install_directory <directory>
Use this option to install the modules under your own private
directory. By default, the installation directory for the
perl modules is configured in the perl executable and
the install directory for libexpat.a is /usr/local/lib.
If this option is provided, the specified directory will be
the installation directory. Make sure you set the environment
variable PERL5LIB to the same private directory before running
this script and the examples.
(e.g. setenv PERL5LIB /my/private/directory/lib)
-force
Upgrade all required modules to the versions specified and install
even when 'make test' has failed. By defaul, this script reports
warning/failure as soon as it detects an existing module with an
older version or when 'make test' fails. This option tells it
to go ahead and force the installation.
-force_update
This does half of what -force does. It tells the script to
update the older module in the system to the required version.
If 'make test' fails, the script still reports failure.
-force_install
This does half of what -force does. It tells the script to
go ahead and do 'make install' even when 'make test' fails.
If an older version of the module exists, the script still
reports warning.
-force_override
This forces installation of all required modules regardless
of whether the modules of the correct versions have already
been installed.
-used_by <example>
By default, the Perl modules required by JUNOS::Device,
get_chassis_inventory, load_configuration and diagnose_bgp are
installed. If this option is provided, this script will
install the required modules for the specified module or example
only. <example> can be JUNOS::Device, get_chassis_inventory,
load_configuration, diagnose_bgp or RDB.
-respository <directory>
The directory where all of the packages are stored (.tar.gz).
Default value is prereqs which is the name of the directory
you see after you untar junoscript_prereqs.tgz.
-mysql <directory>
The directory is needed by the installation of DBD::mysql if
the MySQL is not installed in /usr/local/mysql.
-access <access_method>
Install for one or more access methods. For example ssh,
ssh|telnet or all (for all access methods). Please note
that ssh is not available in the export distribution of
the JUNOScript Perl Client. You must download the domestic
distribution to be able to use the ssh access method.
-maketest
Perform 'make test' for all Perl modules.
\n\n";
die $usage;
}
sub show_progress
{
my $status = shift;
if ($status) {
( run in 1.123 second using v1.01-cache-2.11-cpan-39bf76dae61 )