Given a URL like http://osdn.dl.sourceforge.net/sourceforge/project/file.zip
or http://prdownloads.sourceforge.net/project/file.zip , convert it
-to a real URL on the best mirror.
+to a real URL on the sourceforge download redirector.
=cut
sub convert_osdn_url
my ($url) = @_;
if ($url =~ /^http:\/\/[^\.]+.dl.sourceforge.net\/sourceforge\/([^\/]+)\/(.*)$/ ||
$url =~ /^http:\/\/prdownloads.sourceforge.net\/([^\/]+)\/(.*)$/) {
- # Find best site
+ # Always use the Sourceforge mail download URL, which does
+ # a location-based redirect for us
my ($project, $file) = ($1, $2);
- my @mirrors = &list_osdn_mirrors($project, $file);
- my $pref = $gconfig{'osdn_mirror'};
- my $site;
- if ($pref) {
- ($site) = grep { $_->{'mirror'} eq $pref } @mirrors;
- }
- if (!$site) {
- # Fall back to automatic mirror selection via Sourceforge
- # redirect
- $site = { 'url' => "http://prdownloads.sourceforge.net/sourceforge/$project/$file",
- 'default' => 0 };
- }
- return wantarray ? ( $site->{'url'}, $site->{'default'} )
- : $site->{'url'};
+ local $url = "http://prdownloads.sourceforge.net/sourceforge/".
+ "$project/$file";
+ return wantarray ? ( $url, 0 ) : $url;
}
else {
# Some other source .. don't change
Detect and ignore failures when checking if other modules are installed.
---- Changes since 1.470 ----
Added a field to the Operating System and Environment page for additional Perl module directories.
+---- Changes since 1.480 ----
+Removed the option to select an OSDN mirror, as Sourceforge now does sensible location-based redirects automatically.
}
&lock_file("$config_directory/config");
-if ($config{'osdn'}) {
- # Parse mirror selection from list
- if ($in{'mirror'} eq "*") {
- $in{'other'} =~ /^\S+$/ || &error($text{'proxy_eother'});
- $gconfig{'osdn_mirror'} = $in{'other'};
- }
- else {
- $gconfig{'osdn_mirror'} = $in{'mirror'};
- }
- }
-else {
- # Use manually entered mirror
- if ($in{'mirror_def'}) {
- $gconfig{'osdn_mirror'} = undef;
- }
- else {
- $in{'mirror'} =~ /^\S+$/ || &error($text{'proxy_eother'});
- $gconfig{'osdn_mirror'} = $in{'mirror'};
- }
- }
# Save cache size
if ($in{'cache_def'}) {
standard_url=URL of standard modules list,3,On www.webmin.com
third_url=URL of third party modules list,3,On www.webmin.com
cron_mode=Show update times as,1,0-Simple interface,1-Cron time selector
-osdn=Fetch list of Webmin OSDN mirror sites?,1,1-Yes,0-No
warn_days=Days before password expiry to warn users,0,5
print &ui_form_start("change_osdn.cgi");
print &ui_table_start($text{'proxy_header2'}, undef, 2, [ "width=30%" ]);
-if ($config{'osdn'}) {
- # Show list of mirrors to choose from
- $base = &get_webmin_base_version();
- @mirrors = &list_osdn_mirrors("webadmin", "webmin-$base.tar.gz");
- @codes = map { $_->{'mirror'} } @mirrors;
- $inlist = !$gconfig{'osdn_mirror'} ||
- &indexof($gconfig{'osdn_mirror'}, @codes) >= 0;
- print &ui_table_row($text{'proxy_osdn'},
- &ui_select("mirror", $inlist ? $gconfig{'osdn_mirror'} : "*",
- [ [ "", $text{'proxy_mirrordef'} ],
- (map { [ $_->{'mirror'},
- $_->{'country'} ? "$_->{'mirror'} ($_->{'country'})" : $_->{'mirror'} ] } @mirrors),
- [ "*", $text{'proxy_other'} ] ])." ".
- &ui_textbox("other",
- $inlist ? "" : $gconfig{'osdn_mirror'}, 10));
- }
-else {
- # Just show text field for mirror code
- print &ui_table_row($text{'proxy_osdn'},
- &ui_opt_textbox("mirror", $gconfig{'osdn_mirror'}, 10,
- $text{'proxy_mirrordef2'}));
- }
-
# Cache size
print &ui_table_row($text{'proxy_cache'},
&ui_radio("cache_def", $gconfig{'cache_size'} ? 0 : 1,
=cut
sub gnupg_setup
{
-return ( 1, &text('enogpg', "<tt>gpg</tt>") ) if (!&has_command("gpg"));
+return ( 1, &text('enogpg', "<tt>gpg</tt>") ) if (!&has_command($gpgpath));
# Check if we already have the key
local @keys = &list_keys();
# Import it if not
&list_keys();
-$out = `gpg --import $module_root_directory/jcameron-key.asc 2>&1`;
+$out = `$gpgpath --import $module_root_directory/jcameron-key.asc 2>&1`;
if ($?) {
return (2, $out);
}