Merge lp:~zematynnad/ubuntu-webcatalog/i386_listed_twice_1020124 into lp:ubuntu-webcatalog

Proposed by Danny Tamez
Status: Merged
Approved by: Łukasz Czyżykowski
Approved revision: 157
Merged at revision: 159
Proposed branch: lp:~zematynnad/ubuntu-webcatalog/i386_listed_twice_1020124
Merge into: lp:ubuntu-webcatalog
Diff against target: 24 lines (+7/-0)
1 file modified
src/webcatalog/management/commands/import_app_install_data.py (+7/-0)
To merge this branch: bzr merge lp:~zematynnad/ubuntu-webcatalog/i386_listed_twice_1020124
Reviewer Review Type Date Requested Status
Canonical Consumer Applications Hackers Pending
Review via email: mp+113608@code.launchpad.net

Commit message

Fix for multiarch packages being listed twice.

Description of the change

Overview
=========
This branch is a fix for webcatalog applications that are duplicates because of multiarch package names.

Details
========
Two different issues are addressed in this branch. The first deals with arcane package names found in desktop files. There are only a few remaining apps that have this problem and this branch will prevent them from re-appearing. They will have to be manually deleted from the database in production. The second issue is at that at the apt-cache level multiarch packages can sneak back into our database as well. This is now being prevented from forcing single architecture mode. Once ARM and other architectures are coming into play we will need to expand the package configuration to accommodate them as well.

Testing
========
$fab test:pg=True

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/webcatalog/management/commands/import_app_install_data.py'
2--- src/webcatalog/management/commands/import_app_install_data.py 2012-07-02 21:25:30 +0000
3+++ src/webcatalog/management/commands/import_app_install_data.py 2012-07-05 16:12:27 +0000
4@@ -80,6 +80,8 @@
5 if not os.path.exists(series_cache_location):
6 self.create_apt_cache(series_cache_location)
7
8+ # Force all packages into single architecture mode
9+ apt.apt_pkg.config.set("APT::Architecture", "i386")
10 cache = apt.Cache(rootdir=series_cache_location)
11 try:
12 # XXX michaeln bug=879268 Lucid doesnt know about translations.
13@@ -193,6 +195,11 @@
14 form = ArchiveApplicationForm.get_form_from_desktop_data(
15 data, distroseries)
16
17+ pkgname = form.data.get('package_name', '')
18+ if ":" in pkgname:
19+ self.output("skipped multiarch pkg '%s'" % pkgname)
20+ return
21+
22 if form.is_valid():
23 app = form.save()
24 app.update_departments()

Subscribers

People subscribed via source and target branches