diff scripts/pkg/private/get_forge_pkg.m @ 15965:7ad3eea8a3af stable

use packages.octave.org instead of sourceforge in pkg.m * pkg.m (list_forge_packages): Download package list from packages.octave.org instead of octave.sourceforge.net. * get_forge_pkg.m (get_forge_pkg): Likewise, for package index.html files and sources.
author John W. Eaton <jwe@octave.org>
date Fri, 18 Jan 2013 16:42:05 -0500
parents 72c96de7a403
children d56dd6794a20
line wrap: on
line diff
--- a/scripts/pkg/private/get_forge_pkg.m
+++ b/scripts/pkg/private/get_forge_pkg.m
@@ -38,7 +38,7 @@
   name = tolower (name);
 
   ## Try to download package's index page.
-  [html, succ] = urlread (sprintf ("http://octave.sourceforge.net/%s/index.html", name));
+  [html, succ] = urlread (sprintf ("http://packages.octave.org/%s/index.html", name));
   if (succ)
     ## Remove blanks for simpler matching.
     html(isspace(html)) = [];
@@ -51,17 +51,17 @@
       ver = t{1}{1};
       if (nargout > 1)
         # Build download string.
-        urlbase = "http://downloads.sourceforge.net/octave/%s-%s.tar.gz?download";
-        url = sprintf (urlbase, name, ver);
-        ## Verify that the string exists on the page.
-        if (isempty (strfind (html, url)))
+        pkg_file = sprintf ("%s-%s.tar.gz", name, ver);
+        url = cstrcat ("http://packages.octave.org/download/", pkg_file);
+        ## Verify that the package string exists on the page.
+        if (isempty (strfind (html, pkg_file)))
           warning ("get_forge_pkg: download URL not verified");
         endif
       endif
     endif
   else
     ## Try get the list of all packages.
-    [html, succ] = urlread ("http://octave.sourceforge.net/packages.php");
+    [html, succ] = urlread ("http://packages.octave.org/packages.php");
     if (succ)
       t = regexp (html, "<div class=""package"" id=""(\\w+)"">", "tokens");
       t = horzcat (t{:});