octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #47102] pkg install -forge BAD_PKG produces un


From: Rik
Subject: [Octave-bug-tracker] [bug #47102] pkg install -forge BAD_PKG produces unhelpful error message
Date: Tue, 09 Feb 2016 18:47:38 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

URL:
  <http://savannah.gnu.org/bugs/?47102>

                 Summary: pkg install -forge BAD_PKG produces unhelpful error
message
                 Project: GNU Octave
            Submitted by: rik5
            Submitted on: Tue 09 Feb 2016 10:47:37 AM PST
                Category: Octave Function
                Severity: 2 - Minor
                Priority: 5 - Normal
              Item Group: Regression
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

I accidentally used a package name that does not exist on Octave-Forge. 
Instead of getting a message that the name simply doesn't exist I got
something weird about cells.


pkg install -forge foobar
error: cellfun: C must be a cell array
error: called from
    get_forge_pkg at line 72 column 14
    get_forge_download at line 26 column 12
    pkg at line 397 column 29


The problem is in scripts/pkg/private/get_forge_pkg.m.



  else
    ## Try get the list of all packages.
    [html, succ] = urlread ("http://packages.octave.org/packages.php";);
    if (! succ)
      error ("get_forge_pkg: could not read URL, please verify internet
connection");
    endif

    t = regexp (html, "<div class=""package"" id=""(\\w+)"">", "tokens");
    t = horzcat (t{:});
    if (any (strcmp (t, name)))
      error ("get_forge_pkg: package NAME exists, but index page not
available");
    endif
    ## Try a simplistic method to determine close names.
    dist = cellfun (@(n) length (setdiff (name, n)), t);
    [~, i] = min (dist);
    error ("get_forge_pkg: package not found: ""%s"". Maybe you meant
""%s?""", name, t{i});
  endif


The problem seems to be that the website has changed how it presents packages
and the regexp no longer matches.

Maybe there needs to be a place where the list of packages is kept in a very
simple machine-readable format, rather than HTML?

This would also help resolve bug #39479.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47102>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]