Remove code that does OSDN mirror detection, just let sourceforge decide
authorJamie Cameron <jcameron@webmin.com>
Fri, 14 Aug 2009 22:09:13 +0000 (15:09 -0700)
committerJamie Cameron <jcameron@webmin.com>
Fri, 14 Aug 2009 22:09:13 +0000 (15:09 -0700)
web-lib-funcs.pl
webmin/CHANGELOG
webmin/change_osdn.cgi
webmin/config.info
webmin/edit_proxy.cgi
webmin/webmin-lib.pl

index bdbc93a..cf9a2ed 100755 (executable)
@@ -8303,7 +8303,7 @@ return @rv;
 
 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
@@ -8311,22 +8311,12 @@ 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
index f962687..953d304 100644 (file)
@@ -92,3 +92,5 @@ Expired Unix passwords can now be changed using an external command, instead of
 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.
index 12f8cbf..a036af9 100755 (executable)
@@ -28,26 +28,6 @@ if ($in{'clear'}) {
        }
 
 &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'}) {
index a29bd86..5ba0c35 100644 (file)
@@ -1,5 +1,4 @@
 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
index 65cd572..4e77409 100755 (executable)
@@ -54,29 +54,6 @@ print $text{'proxy_desc2'},"<p>\n";
 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,
index 4005ce4..c827eea 100755 (executable)
@@ -587,7 +587,7 @@ Assumes that gnupg-lib.pl is available
 =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();
@@ -598,7 +598,7 @@ foreach $k (@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);
        }