Apache-Logmonster
view release on metacpan or search on metacpan
1.3 - Nov 25, 02
Added use strict (forced code cleanup)
Added getopt::std instead of custom parser
Moved $quiet to $opt_q, $debug to $opt_v
1.2.1 - Dec 14, 01
Made it work with matt.simerson.net
1.2 - Jun 28, 01
Cleaned up the code, added debug flag, expanded logic
so v1.2 can replicate 1.0 & 1.1 behaviour with options
1.1 - Feb 14, 01
Added support for multiple domains
1.0 - Oct 29, 00 - Origin
lib/Apache/Logmonster/Utility.pm view on Meta::CPAN
}
}
$log->audit("found $archive");
$ENV{PATH} = '/bin:/usr/bin'; # do this or taint checks will blow up on ``
return $log->error( "unknown archive type: $archive", %args )
if $archive !~ /[bz2|gz]$/;
# find these binaries, we need them to inspect and expand the archive
my $tar = $self->find_bin( 'tar', %args );
my $file = $self->find_bin( 'file', %args );
my %types = (
gzip => { bin => 'gunzip', content => 'gzip', },
bzip => { bin => 'bunzip2', content => 'b(un)?zip2', },
# on BSD bunzip2, on Linux bzip2
);
my $type
lib/Apache/Logmonster/Utility.pm view on Meta::CPAN
timeout => 60,
);
}
$log->audit( "install_from_source: building $package in $src");
$self->install_from_source_cleanup($package,$src) or return;
$self->install_from_source_get_files($package,$site,$url,$p{patch_url},$patches) or return;
$self->extract_archive( $package )
or return $log->error( "Couldn't expand $package: $!", %args );
# cd into the package directory
my $sub_path;
if ( -d $package ) {
chdir $package or
return $log->error( "FAILED to chdir $package!", %args );
}
else {
# some packages (like daemontools) unpack within an enclosing directory
lib/Apache/Logmonster/Utility.pm view on Meta::CPAN
=item extract_archive
Decompresses a variety of archive formats using your systems built in tools.
############### extract_archive ##################
# Usage : $util->extract_archive( 'example.tar.bz2' );
# Purpose : test the archiver, determine its contents, and then
# use the best available means to expand it.
# Returns : 0 - failure, 1 - success
# Parameters : S - archive - a bz2, gz, or tgz file to decompress
=item cwd_source_dir
Changes the current working directory to the supplied one. Creates it if it does not exist. Tries to create the directory using perl's builtin mkdir, then the system mkdir, and finally the system mkdir with sudo.
############ cwd_source_dir ###################
lib/Apache/Logmonster/Utility.pm view on Meta::CPAN
clean - do we try removing the existing sources? (enabled)
timeout - how long to wait for an answer (60 seconds)
result:
1 - removed
0 - failure, package exists and needs to be removed.
=item sources_get
Tries to download a set of sources files from the site and url provided. It will try first fetching a gzipped tarball and if that files, a bzipped tarball. As new formats are introduced, I will expand the support for them here.
usage:
$self->sources_get(
package => 'simscan-1.07',
site => 'http://www.inter7.com',
path => '/simscan/',
)
arguments required:
package - the software package name
logmonster.conf view on Meta::CPAN
# Logmonster configuration file
##
# Logbase - path to web logs. Logmonster will determine where
# logs are based upon $logbase and the date being processed.
#
# Use cronolog or something like it. Apache recommends it:
#
# http://httpd.apache.org/docs/misc/FAQ-I.html#rotate
#
# Apache 2.0 expands cronolog support by allowing ErrorLogs to be
# piped to cronolog as well.
##
logbase = /var/log/http
##
# log file owner - the user and group that owns the Apache log files
##
log_user = www
t/Utility.t view on Meta::CPAN
ok( $util->extract_archive( $archive, fatal => 0 ), 'extract_archive +');
ok( !$util->extract_archive( "$archive.fizzlefuzz", fatal => 0 ), 'extract_archive -');
# clean up behind the tests
ok( $util->file_delete( $archive, fatal => 0 ), 'file_delete' );
}
$log->dump_audit(quiet=>1);
$log->{last_error} = scalar @{$log->{errors}};
# TODO: { my $why = "extract_archive, requires a valid archive to expand";
# this is how to run them but not count them as failures
# local $TODO = $why if (! -e $archive);
# this way to skip them entirely and mark as TODO
# todo_skip $why, 3 if (! -e $archive); #}
# cwd_source_dir
# dir already exists
ok( $util->cwd_source_dir( $tmp ), 'cwd_source_dir' );
# clean up after previous runs
( run in 0.479 second using v1.01-cache-2.11-cpan-97f6503c9c8 )