#18581: _package_lists_from_sage_output() should output installed and available
versions
-------------------------------------+-------------------------------------
       Reporter:  jdemeyer           |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.8
      Component:  misc               |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  John Palmieri      |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jhpalmieri/versions              |  17bc8fad32020a978d940694edba35b46e81389f
   Dependencies:  #18456             |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'John Palmieri', 'oldvalue': ''}):

 * status:  new => needs_review
 * commit:   => 17bc8fad32020a978d940694edba35b46e81389f
 * author:   => John Palmieri


Comment:

 The actual change is
 {{{
 #!diff
 diff --git a/src/sage/misc/package.py b/src/sage/misc/package.py
 index 91ab594..6a9f33d 100644
 --- a/src/sage/misc/package.py
 +++ b/src/sage/misc/package.py
 @@ -216,9 +216,13 @@ def
 _package_lists_from_sage_output(package_type,version=False,local=False):
      When ``version=False``, the function returns a pair of list
      ``(installed,not_installed)`` with the corresponding packages' name.

 -    When ``version=True``, the elements of each list are not package
 names but
 -    pairs ``(package_name,package_version)`` where ``version`` is a
 string
 -    representing the version of each package that is installed.
 +    When ``version=True``, the elements of each list are not package
 +    names but either pairs ``(package_name, installed_version)`` or
 +    triples ``(package_name, latest_version, installed_version)``,
 +    depending on whether ``local`` is ``True`` or ``False``. Here,
 +    ``latest_version`` is a string representing the version of the
 +    package available on the Sage package server, while
 +    ``installed_version`` is the version that is actually installed.

      EXAMPLE::

 @@ -257,11 +261,10 @@ def
 _package_lists_from_sage_output(package_type,version=False,local=False):
      if version:
          for line in X:
              line = line.split(' ')
 -            name,version = line[0],line[1]
 -            if is_package_installed(name):
 -                installed.append((name,version))
 +            if is_package_installed(line[0]):
 +                installed.append(tuple(line))
              else:
 -                not_installed.append((name,version))
 +                not_installed.append(tuple(line))
      else:
          for name in X:
              if is_package_installed(name):
 }}}
 although the branch includes all of the changes from #18456.

--
Ticket URL: <http://trac.sagemath.org/ticket/18581#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to