text stringlengths 0 834k |
|---|
die ""PPM3 SOAP repositories are not supported"" |
if $url =~ m,\?urn:/,; |
} |
else { |
if (-d $url) { |
require URI::file; |
$url = URI::file->new_abs($url); |
} |
elsif ($url eq ""activestate"") { |
($name, $url) = ActivePerl::PPM::Client::activestate_repo(); |
die ""No ActiveState repo for this platform"" unless $url; |
} |
elsif (($name,$url,$url_noarch) = repo_by_name($url)) { |
# empty |
} |
else { |
die ""The repository URL must be absolute or a local directory""; |
} |
} |
if ($user) { |
for ($url, $url_noarch) { |
next unless defined; |
$_ = URI->new($_); |
$_->userinfo($user); |
$_ = $_->as_string; |
} |
} |
$ppm->repo_dbimage_disable; |
my $id = $ppm->repo_add(name => $name, packlist_uri => $url); |
print ""Repo $id added.\n""; |
if ($url_noarch) { |
$id = $ppm->repo_add(name => ""$name-noarch"", packlist_uri => $url_noarch); |
print ""Repo $id added.\n""; |
} |
} |
elsif ($cmd eq ""rename"") { |
$USAGE = ""repo rename <num> <name>""; |
usage() if @ARGV < 2; |
my $repo = $ppm->repo(shift(@ARGV)); |
die ""No such repo; 'ppm repo list' will print what's available"" unless $repo; |
$ppm->repo_set_name($repo->{id}, join("" "", @ARGV)); |
} |
elsif ($cmd eq ""location"") { |
$USAGE = ""repo location [--no-sync] <num> <url>""; |
my $sync = 1; |
require Getopt::Long; |
Getopt::Long::GetOptions( |
'sync!' => \$sync, |
) || usage(); |
usage() if @ARGV != 2; |
my($id, $uri) = @ARGV; |
my $repo = $ppm->repo($id); |
die ""No such repo; 'ppm repo list' will print what's available"" unless $repo; |
$ppm->repo_set_packlist_uri($repo->{id}, $uri); |
$ppm->repo_sync(repo => $repo->{id}) if $sync; |
} |
elsif ($cmd =~ /^\d+$/) { |
@ARGV = (""describe"") unless @ARGV; |
if ($ARGV[0] =~ /^\d+$/) { |
# avoids infinite recursion |
$USAGE = ""repo <num> <cmd> ...""; |
usage(); |
} |
splice(@ARGV, 1, 0, $cmd); |
do_repo(); |
} |
elsif ($cmd eq ""suggest"") { |
my $ppm_repo_ok; |
eval { |
require PPM::Repositories; |
$ppm_repo_ok++; |
}; |
require ActivePerl; |
my $count = 0; |
my($as_name, $as_url) = ActivePerl::PPM::Client::activestate_repo(); |
if ($as_name) { |
$PPM::Repositories::Repositories{activestate} = { |
Active => 1, |
Type => ""PPM4"", |
Notes => $as_name, |
location => $as_url, |
}; |
} |
if (defined &PPM::Repositories::list) { |
for my $name (PPM::Repositories::list()) { |
my %repo = PPM::Repositories::get($name); |
$repo{packlist} = $as_url if $as_url && $name eq ""activestate""; |
print ""\n"" if $count; |
print ""$PROGNAME repo add $name\n""; |
print "" $repo{desc}\n""; |
print "" $repo{packlist}\n"" if $repo{packlist}; |
print "" $repo{packlist_noarch}\n"" if $repo{packlist_noarch}; |
$count++; |
} |
} |
else { |
for my $id (sort keys %PPM::Repositories::Repositories) { |
my $repo = $PPM::Repositories::Repositories{$id}; |
next unless $repo->{Active}; |
next if $repo->{Type} eq ""PPMServer""; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.