Subject: [PATCH] Fixed query with empty description/summary

Fixes

| Traceback (most recent call last):
|   File "/usr/bin/smart", line 194, in ?
|     main(sys.argv[1:])
|   File "/usr/bin/smart", line 167, in main
|     exitcode = iface.run(opts.command, opts.argv)
|   File "/usr/lib/python2.4/site-packages/smart/interface.py", line 53, in run
|     result = _command.main(self._ctrl, opts)
|   File "/usr/lib/python2.4/site-packages/smart/commands/query.py", line 283, in main
|     if pattern.search(info.getDescription()):
| TypeError: expected string or buffer

which happens when a package has an empty %description. Ditto for summary.

---

 smart/commands/query.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

aead1d723e624e5dbec0a02ea8000ff17a05585c
diff --git a/smart/commands/query.py b/smart/commands/query.py
--- a/smart/commands/query.py
+++ b/smart/commands/query.py
@@ -274,13 +274,15 @@ def main(ctrl, opts, reloadchannels=True
                         newpackages[pkg] = True
             if needsinfo:
                 info = pkg.loaders.keys()[0].getInfo(pkg)
-                if hassummary:
+                data = info.getSummary()
+                if hassummary and data!=None:
                     for pattern in hassummary:
-                        if pattern.search(info.getSummary()):
+                        if pattern.search(data):
                             newpackages[pkg] = True
-                if hasdescription:
+                data = info.getDescription()
+                if hasdescription and data!=None:
                     for pattern in hasdescription:
-                        if pattern.search(info.getDescription()):
+                        if pattern.search(data):
                             newpackages[pkg] = True
                 if haspath:
                     for pattern in haspath:

