Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > SVN: r666 - in trunk/current/src: api db

Project highlights: Stable Version: 1.6.1, Development Version: 1.7.6

current
Discussion topic

Back to topic list

SVN: r666 - in trunk/current/src: api db

Reply

Author jjneely at EOS dot NCSU dot EDU
Full name jjneely at EOS dot NCSU dot EDU
Date 2005-01-17 16:08:18 PST
Message Author: jjneely at EOS dot NCSU dot EDU
Date: 2005-01-17 19:08:14 -0500 (Mon, 17 Jan 2005)
New Revision: 666

Modified:
   trunk/current/src/ap​i/up2date.py
   trunk/current/src/db​/currentdb.py
Log:
Pauline's solvedeps patch which makes the solveDeps() functions a bit saner


Modified: trunk/current/src/ap​i/up2date.py
====================​====================​====================​=======
--- trunk/current/src/ap​i/up2date.py 2005-01-17 23:28:51 UTC (rev 665)
+++ trunk/current/src/ap​i/up2date.py 2005-01-18 00:08:14 UTC (rev 666)
@@ -132,23 +132,32 @@
         return xmlrpclib.Fault(1000,
             "No compatible channels found for client")
 
+ # This is mostly here as a marker - we'd pass in a list of all possible
+ # (compatible) channels, and get back a list (pos. empty) of the ones
+ # this client was authorized to to touch.
+ channels = auth.authorize.getAu​thorizedChannels(si,​ channels)
+ if len(channels) == 0:
+ return xmlrpclib.Fault(1000,
+ "Client is not authorized for any channels")
+
     provides = {}
     for unk in unknowns:
- # according to up2date 2.7.11, pkg could be _plural_, and right now
- # it sucks off the first one returned.
- pkgs = db.db.solveDependanc​y(channels[0]['label​'],
- si.getattr('architecture'),
- unk)
 
         # packagedb.solveDep will return None if our db can't solve that
         # in which case, we return an empty list for that unk, which is what
         # the client expects.
         provides[unk] = []
 
- if pkgs:
- for pkg in pkgs:
- provides[unk].append(pkg)
+ # iterate over all channels available to the client
+ for chan in channels:
+ pkgs = db.db.solveDependanc​y(chan['label'],
+ si.getattr('architecture'),
+ unk)
 
+ if pkgs:
+ for pkg in pkgs:
+ provides[unk].append(pkg)
+
     return provides
 
 

Modified: trunk/current/src/db​/currentdb.py
====================​====================​====================​=======
--- trunk/current/src/db​/currentdb.py 2005-01-17 23:28:51 UTC (rev 665)
+++ trunk/current/src/db​/currentdb.py 2005-01-18 00:08:14 UTC (rev 666)
@@ -776,8 +776,8 @@
         result = fixedResult
 
         log("up2date.solveDependency is returning %s" % result, DEBUG)
- if (type(result[0]) != type([])):
- result = [result]
+# if (type(result[0]) != type([])):
+# result = [result]
         return result
 
 


--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@curr​ent.tigris.org
For additional commands, e-mail: cvs-help at current dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

SVN: r666 - in trunk/current/src: api db jjneely at EOS dot NCSU dot EDU jjneely at EOS dot NCSU dot EDU 2005-01-17 16:08:18 PST
Messages per page: