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
=== modified file 'src/webcatalog/management/commands/import_app_install_data.py'
--- src/webcatalog/management/commands/import_app_install_data.py 2012-07-02 21:25:30 +0000
+++ src/webcatalog/management/commands/import_app_install_data.py 2012-07-05 16:12:27 +0000
@@ -80,6 +80,8 @@
80 if not os.path.exists(series_cache_location):80 if not os.path.exists(series_cache_location):
81 self.create_apt_cache(series_cache_location)81 self.create_apt_cache(series_cache_location)
8282
83 # Force all packages into single architecture mode
84 apt.apt_pkg.config.set("APT::Architecture", "i386")
83 cache = apt.Cache(rootdir=series_cache_location)85 cache = apt.Cache(rootdir=series_cache_location)
84 try:86 try:
85 # XXX michaeln bug=879268 Lucid doesnt know about translations.87 # XXX michaeln bug=879268 Lucid doesnt know about translations.
@@ -193,6 +195,11 @@
193 form = ArchiveApplicationForm.get_form_from_desktop_data(195 form = ArchiveApplicationForm.get_form_from_desktop_data(
194 data, distroseries)196 data, distroseries)
195197
198 pkgname = form.data.get('package_name', '')
199 if ":" in pkgname:
200 self.output("skipped multiarch pkg '%s'" % pkgname)
201 return
202
196 if form.is_valid():203 if form.is_valid():
197 app = form.save()204 app = form.save()
198 app.update_departments()205 app.update_departments()

Subscribers

People subscribed via source and target branches