diff options
author | Dan McGee <dan@archlinux.org> | 2011-07-05 09:43:36 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-07-05 09:44:53 -0500 |
commit | 65e274dcb6dc58990e60af892be941c6b53f195a (patch) | |
tree | 32ce253f04b2933d6788b14b1b342b9999359f22 /packages | |
parent | 5e85c5ac9ed09551d65ec07767094770d248f3b1 (diff) |
Simplify package differences code
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r-- | packages/utils.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/packages/utils.py b/packages/utils.py index af4675bb..37f23244 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -92,21 +92,16 @@ SELECT p.id, q.id WHERE p.arch_id IN (%s, %s) AND ( q.id IS NULL - OR - p.pkgver != q.pkgver - OR - p.pkgrel != q.pkgrel - OR - p.epoch != q.epoch + OR p.pkgver != q.pkgver + OR p.pkgrel != q.pkgrel + OR p.epoch != q.epoch ) """ cursor = connection.cursor() cursor.execute(sql, [arch_a.id, arch_b.id]) results = cursor.fetchall() - to_fetch = [] - for row in results: - # column A will always have a value, column B might be NULL - to_fetch.append(row[0]) + # column A will always have a value, column B might be NULL + to_fetch = [row[0] for row in results] # fetch all of the necessary packages pkgs = Package.objects.normal().in_bulk(to_fetch) # now build a list of tuples containing differences |