text stringlengths 0 834k |
|---|
have => [$best], |
want => [map [$_ => $requires{$_}], keys %requires], |
); |
_install($install_area, 0, $best, @extra); |
} |
} |
} |
} |
}; |
if ($@) { |
ppm_log(""ERR"", $@); |
} |
} |
} |
if (@ARGV && !$pkg_count) { |
print STDERR ""*** package $ARGV[0] not installed ***\n""; |
} |
elsif (!$upgrade_count) { |
my $for = @ARGV ? "" for $ARGV[0]"" : """"; |
print STDERR ""*** no upgrades available$for ***\n""; |
} |
} |
sub _install_uri { |
my($area, $force, $uri, @args) = @_; |
my $res = web_ua->get($uri); |
unless ($res->is_success) { |
die $res->status_line; |
} |
my $tmp_ppmx; |
if ($uri =~ /\.ppmx$/) { |
# need a file |
require File::Temp; |
$tmp_ppmx = File::Temp->new( |
TEMPLATE => ""ppm-XXXXXX"", |
SUFFIX => "".ppmx"", |
TMPDIR => 1, |
); |
$tmp_ppmx->print($res->content); |
$tmp_ppmx->flush; |
require Archive::Tar; |
my $ppd; |
my $tar = Archive::Tar->new($tmp_ppmx->filename, 1); |
for my $file ($tar->get_files) { |
#print ""TAR path: "", $file->full_path, ""\n""; |
if ($file->name =~ /\.ppd$/) { |
$ppd = $file; |
last; |
} |
} |
die ""No PPD found inside $uri"" unless $ppd; |
$res->remove_header(""Content-Encoding""); |
$res->content($ppd->get_content); |
} |
require ActivePerl::PPM::PPD; |
my $cref = $res->decoded_content(ref => 1, default_charset => ""none""); |
my $pkg = ActivePerl::PPM::Package->new_ppd($$cref, |
arch => $ppm->arch, |
base => $res->base, |
rel_base => $uri, |
); |
unless ($pkg) { |
die ""No PPD found _at $uri""; |
} |
if (my $codebase = $pkg->{codebase}) { |
$pkg->{ppd_uri} = $uri; |
$pkg->{ppd_etag} = $res->header(""ETag""); |
$pkg->{ppd_lastmod} = $res->header(""Last-Modified""); |
} |
else { |
die ""The PPD does not provide code to install for this platform""; |
} |
if ($tmp_ppmx) { |
require URI::file; |
$pkg->{codebase} = URI::file->new_abs($tmp_ppmx->filename); |
} |
# XXX follow dependencies with the ""directory"" of $pkg $uri as the |
# first repo to look for additional packages. This only works for |
# package features. |
_install($area, $force, $pkg, $ppm->packages_missing(want_deps => [$pkg], @args)); |
} |
sub _install { |
my $area = shift; |
my $force = shift; |
unless (@_) { |
print ""No missing packages to install\n""; |
return; |
} |
unless ($force) { |
my $stop; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.