Mail-Toaster
view release on metacpan or search on metacpan
lib/Mail/Toaster/Darwin.pm view on Meta::CPAN
$url ||= "http://mail-toaster.org";
if ( -M "/usr/ports" > $age ) {
$self->update_ports();
}
else {
print "ports_check_age: Ports file is current (enough).\n";
}
}
sub update_ports {
my $self = shift;
my $cvsbin = $self->util->find_bin( "cvs",fatal=>0, verbose=>0 );
unless ( -x $cvsbin ) {
die "FATAL: could not find cvs, please install Developer Tools!\n";
}
print "Updating Darwin ports...\n";
my $portsdir = "/usr/darwinports";
lib/Mail/Toaster/Darwin.pm view on Meta::CPAN
}
if ( -d $portsdir ) {
$self->update_ports_sync() and return;
}
else {
$self->update_ports_init();
};
};
sub update_ports_init {
my $self = shift;
print <<'EO_NO_PORTS';
WARNING! I expect to find your dports dir in /usr/ports/dports. Please install
it there or add a symlink there pointing to where you have your Darwin ports
installed.
If you need to install DarwinPorts, please visit this URL for details:
http://darwinports.opendarwin.org/getdp/
lib/Mail/Toaster/Darwin.pm view on Meta::CPAN
);
my $portindex = $self->util->find_bin( "portindex",verbose=>0 );
unless ( -x $portindex ) {
print "compiling darwin ports base.\n";
chdir("/usr/dports/base");
$self->util->syscmd( "./configure; make; make install", verbose=>0 );
}
}
sub update_ports_sync {
my $self = shift;
print "\n\nupdate_ports: You might want to update your ports tree!\n\n";
if ( ! $self->util->yes_or_no(
question=>"\n\nWould you like me to do it for you?" ) )
{
print "ok then, skipping update.\n";
return;
}
lib/Mail/Toaster/FreeBSD.pm view on Meta::CPAN
my $opt_dir = "/var/db/ports/$cat".'_'.$port;
if ( !-d $opt_dir ) {
$self->util->mkdir_system( dir => $opt_dir, %args,);
}
my $prefix = '# This file installed by Mail::Toaster';
$self->util->file_write( "$opt_dir/options", lines => [$prefix,$opts], %args );
}
sub update_ports {
my $self = shift;
my %p = validate( @_, { $self->get_std_opts, } );
my %args = $self->toaster->get_std_args( %p );
return $p{test_ok} if defined $p{test_ok};
return $self->error( "you do not have write permission to /usr/ports.",%args) if ! $self->util->is_writable('/usr/ports', %args);
my $supfile = $self->conf->{'cvsup_supfile_ports'} || "portsnap";
( run in 0.245 second using v1.01-cache-2.11-cpan-95122f20152 )