Merge lp:~jelmer/launchpad/remove-archiveuploader-utils into lp:launchpad

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merged at revision: 11454
Proposed branch: lp:~jelmer/launchpad/remove-archiveuploader-utils
Merge into: lp:launchpad
Diff against target: 79 lines (+0/-59)
2 files modified
lib/lp/archiveuploader/tests/test_utils.py (+0/-11)
lib/lp/archiveuploader/utils.py (+0/-48)
To merge this branch: bzr merge lp:~jelmer/launchpad/remove-archiveuploader-utils
Reviewer Review Type Date Requested Status
Michael Nelson (community) code Approve
Review via email: mp+33764@code.launchpad.net

Commit message

Remove lp.archiveuploader.utils.build_file_list.

Description of the change

build_file_list() in lp.archiveuploader.utils is not used anywhere except its own test. This branch removes it.

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Nice and easy :)

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/archiveuploader/tests/test_utils.py'
--- lib/lp/archiveuploader/tests/test_utils.py 2010-08-20 20:31:18 +0000
+++ lib/lp/archiveuploader/tests/test_utils.py 2010-08-26 12:51:50 +0000
@@ -124,17 +124,6 @@
124 self.assertEquals(sect, "libs")124 self.assertEquals(sect, "libs")
125 self.assertEquals(comp, "restricted")125 self.assertEquals(comp, "restricted")
126126
127 def testBuildFileListFromChanges(self):
128 """lp.archiveuploader.utils.build_file_list should be capable of
129 reading changes files
130 """
131 from lp.archiveuploader.utils import build_file_list
132 from lp.archiveuploader.tagfiles import parse_tagfile
133
134 ch = parse_tagfile(datadir("good-signed-changes"))
135 fl = build_file_list(ch)
136 self.assertEquals("abiword_2.0.10-1.2_mips.deb" in fl, True)
137
138 def testFixMaintainerOkay(self):127 def testFixMaintainerOkay(self):
139 """lp.archiveuploader.utils.fix_maintainer should parse correct values128 """lp.archiveuploader.utils.fix_maintainer should parse correct values
140 """129 """
141130
=== modified file 'lib/lp/archiveuploader/utils.py'
--- lib/lp/archiveuploader/utils.py 2010-08-20 20:31:18 +0000
+++ lib/lp/archiveuploader/utils.py 2010-08-26 12:51:50 +0000
@@ -133,54 +133,6 @@
133 return (section, component)133 return (section, component)
134134
135135
136def build_file_list(tagfile, is_dsc = False, default_component="main"):
137 files = {}
138
139 if "files" not in tagfile:
140 raise ValueError("No Files section in supplied tagfile")
141
142 format = tagfile["format"]
143
144 format = float(format)
145
146 if not is_dsc and (format < 1.5 or format > 2.0):
147 raise ValueError("Unsupported format '%s'" % tagfile["format"])
148
149 for line in tagfile["files"].split("\n"):
150 if not line:
151 break
152
153 tokens = line.split()
154
155 section = priority = ""
156
157 try:
158 if is_dsc:
159 (md5, size, name) = tokens
160 else:
161 (md5, size, section, priority, name) = tokens
162 except ValueError:
163 raise TagFileParseError(line)
164
165 if section == "":
166 section = "-"
167 if priority == "":
168 priority = "-"
169
170 (section, component) = extract_component_from_section(
171 section, default_component)
172
173 files[name] = {
174 "md5sum": md5,
175 "size": size,
176 "section": section,
177 "priority": priority,
178 "component": component,
179 }
180
181 return files
182
183
184def force_to_utf8(s):136def force_to_utf8(s):
185 """Forces a string to UTF-8.137 """Forces a string to UTF-8.
186138