comparison scripts/pkg/get_forge_pkg.m @ 11588:d5bd2766c640

style fixes for warning and error messages in script files
author John W. Eaton <jwe@octave.org>
date Thu, 20 Jan 2011 17:51:13 -0500
parents fd0a3ac60b0e
children e4dbfe3019b1
comparison
equal deleted inserted replaced
11587:c792872f8942 11588:d5bd2766c640
44 html(isspace(html)) = []; 44 html(isspace(html)) = [];
45 ## Good. Let's grep for the version. 45 ## Good. Let's grep for the version.
46 pat = "<tdclass=""package_table"">PackageVersion:</td><td>([0-9.]*)</td>"; 46 pat = "<tdclass=""package_table"">PackageVersion:</td><td>([0-9.]*)</td>";
47 t = regexp (html, pat, "tokens"); 47 t = regexp (html, pat, "tokens");
48 if (isempty (t) || isempty(t{1})) 48 if (isempty (t) || isempty(t{1}))
49 error ("get_forge_pkg: could not read version number from package's page."); 49 error ("get_forge_pkg: could not read version number from package's page");
50 else 50 else
51 ver = t{1}{1}; 51 ver = t{1}{1};
52 if (nargout > 1) 52 if (nargout > 1)
53 # Build download string. 53 # Build download string.
54 urlbase = "http://downloads.sourceforge.net/octave/%s-%s.tar.gz?download"; 54 urlbase = "http://downloads.sourceforge.net/octave/%s-%s.tar.gz?download";
55 url = sprintf (urlbase, name, ver); 55 url = sprintf (urlbase, name, ver);
56 ## Verify that the string exists on the page. 56 ## Verify that the string exists on the page.
57 if (isempty (strfind (html, url))) 57 if (isempty (strfind (html, url)))
58 warning ("get_forge_pkg: download URL not verified."); 58 warning ("get_forge_pkg: download URL not verified");
59 endif 59 endif
60 endif 60 endif
61 endif 61 endif
62 else 62 else
63 ## Try get the list of all packages. 63 ## Try get the list of all packages.