Merge lp:~mvo/aptdaemon/fix-multiarch-names into lp:aptdaemon

Proposed by Michael Vogt
Status: Merged
Merged at revision: 671
Proposed branch: lp:~mvo/aptdaemon/fix-multiarch-names
Merge into: lp:aptdaemon
Diff against target: 81 lines (+7/-15)
2 files modified
aptdaemon/core.py (+2/-6)
aptdaemon/worker.py (+5/-9)
To merge this branch: bzr merge lp:~mvo/aptdaemon/fix-multiarch-names
Reviewer Review Type Date Requested Status
Aptdaemon Developers Pending
Review via email: mp+72263@code.launchpad.net

Description of the change

This fixes the multiarch pkgname handling, notable bug #828162 and #828898 (reported by the unstopable Steve)

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 'aptdaemon/core.py'
2--- aptdaemon/core.py 2011-08-12 09:11:03 +0000
3+++ aptdaemon/core.py 2011-08-19 21:23:13 +0000
4@@ -87,7 +87,7 @@
5
6 # regexp for the pkgname, for details see
7 # http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source
8-REGEX_VALID_PACKAGENAME = "^[a-z0-9][a-z0-9\-+.]+$"
9+REGEX_VALID_PACKAGENAME = "^[a-z0-9][a-z0-9\-+.]+[:a-z0-9]*$"
10 # regexp for the version number, for details see:
11 # http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
12 REGEX_VALID_VERSION = "^[0-9][0-9.+\-A-Za-z:~]*$"
13@@ -1862,14 +1862,10 @@
14 exception.
15 """
16 for fullname in pkg_names:
17- name, arch, version, release = AptWorker._split_package_id(fullname)
18+ name, version, release = AptWorker._split_package_id(fullname)
19 if not re.match(REGEX_VALID_PACKAGENAME, name):
20 raise errors.AptDaemonError("%s isn't a valid package name" % \
21 name)
22- if (arch is not None and
23- not re.match(REGEX_VALID_ARCH, arch)):
24- raise errors.AptDaemonError("%s isn't a valid architecture" % \
25- arch)
26 if (version is not None and
27 not re.match(REGEX_VALID_VERSION, version)):
28 raise errors.AptDaemonError("%s isn't a valid version" % \
29
30=== modified file 'aptdaemon/worker.py'
31--- aptdaemon/worker.py 2011-04-15 10:21:28 +0000
32+++ aptdaemon/worker.py 2011-08-19 21:23:13 +0000
33@@ -304,11 +304,7 @@
34 else:
35 name = package
36 version = release = None
37- if ":" in name:
38- name, arch = package.split(":")
39- else:
40- arch = None
41- return name, arch, version, release
42+ return name, version, release
43
44 def _get_unauthenticated(self):
45 """Return a list of unauthenticated package names """
46@@ -328,7 +324,7 @@
47 def _mark_packages_for_installation(self, packages, resolver,
48 reinstall=False):
49 """Mark packages for installation."""
50- for pkg_name, pkg_arch, pkg_ver, pkg_rel in [self._split_package_id(pkg)
51+ for pkg_name, pkg_ver, pkg_rel in [self._split_package_id(pkg)
52 for pkg in packages]:
53 try:
54 pkg = self._cache[pkg_name]
55@@ -549,7 +545,7 @@
56
57 def _mark_packages_for_removal(self, packages, resolver, purge=False):
58 """Mark packages for installation."""
59- for pkg_name, pkg_arch, pkg_ver, pkg_rel in [self._split_package_id(pkg)
60+ for pkg_name, pkg_ver, pkg_rel in [self._split_package_id(pkg)
61 for pkg in packages]:
62 try:
63 pkg = self._cache[pkg_name]
64@@ -616,7 +612,7 @@
65
66 def _mark_packages_for_downgrade(self, packages, resolver):
67 """Mark packages for downgrade."""
68- for pkg_name, pkg_arch, pkg_ver, pkg_rel in [self._split_package_id(pkg)
69+ for pkg_name, pkg_ver, pkg_rel in [self._split_package_id(pkg)
70 for pkg in packages]:
71 try:
72 pkg = self._cache[pkg_name]
73@@ -657,7 +653,7 @@
74
75 def _mark_packages_for_upgrade(self, packages, resolver):
76 """Mark packages for upgrade."""
77- for pkg_name, pkg_arch, pkg_ver, pkg_rel in [self._split_package_id(pkg)
78+ for pkg_name, pkg_ver, pkg_rel in [self._split_package_id(pkg)
79 for pkg in packages]:
80 try:
81 pkg = self._cache[pkg_name]

Subscribers

People subscribed via source and target branches

to status/vote changes: