Merge lp:~cjwatson/launchpad/remove-contents-header into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18249
Proposed branch: lp:~cjwatson/launchpad/remove-contents-header
Merge into: lp:launchpad
Diff against target: 139 lines (+2/-70)
4 files modified
cronscripts/publishing/gen-contents/Contents.top (+0/-32)
cronscripts/publishing/gen-contents/apt_conf_header.template (+0/-2)
lib/lp/archivepublisher/scripts/generate_contents_files.py (+2/-22)
lib/lp/archivepublisher/tests/test_generate_contents_files.py (+0/-14)
To merge this branch: bzr merge lp:~cjwatson/launchpad/remove-contents-header
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+309750@code.launchpad.net

Commit message

Remove headers from Contents files.

Description of the change

Primarily machine-readable files are no place for documentation. This follows a change to dak (https://anonscm.debian.org/cgit/mirror/dak.git/commit/?id=33c8477957525ae6b929a5b0e34eb6ea1ff85c89).

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'cronscripts/publishing/gen-contents/Contents.top'
--- cronscripts/publishing/gen-contents/Contents.top 2011-04-18 14:03:06 +0000
+++ cronscripts/publishing/gen-contents/Contents.top 1970-01-01 00:00:00 +0000
@@ -1,32 +0,0 @@
1This file maps each file available in the %(distrotitle)s
2system to the package from which it originates. It includes packages
3from the DIST distribution for the ARCH architecture.
4
5You can use this list to determine which package contains a specific
6file, or whether or not a specific file is available. The list is
7updated weekly, each architecture on a different day.
8
9When a file is contained in more than one package, all packages are
10listed. When a directory is contained in more than one package, only
11the first is listed.
12
13The best way to search quickly for a file is with the Unix `grep'
14utility, as in `grep <regular expression> CONTENTS':
15
16 $ grep nose Contents
17 etc/nosendfile net/sendfile
18 usr/X11R6/bin/noseguy x11/xscreensaver
19 usr/X11R6/man/man1/noseguy.1x.gz x11/xscreensaver
20 usr/doc/examples/ucbmpeg/mpeg_encode/nosearch.param graphics/ucbmpeg
21 usr/lib/cfengine/bin/noseyparker admin/cfengine
22
23This list contains files in all packages, even though not all of the
24packages are installed on an actual system at once. If you want to
25find out which packages on an installed Debian system provide a
26particular file, you can use `dpkg --search <filename>':
27
28 $ dpkg --search /usr/bin/dselect
29 dpkg: /usr/bin/dselect
30
31
32FILE LOCATION
330
=== modified file 'cronscripts/publishing/gen-contents/apt_conf_header.template'
--- cronscripts/publishing/gen-contents/apt_conf_header.template 2014-01-17 02:03:41 +0000
+++ cronscripts/publishing/gen-contents/apt_conf_header.template 2016-11-01 12:26:30 +0000
@@ -15,8 +15,6 @@
1515
16TreeDefault16TreeDefault
17{17{
18 // Header for Contents file.
19 Contents "$(DIST)/Contents-$(ARCH)";18 Contents "$(DIST)/Contents-$(ARCH)";
20 Contents::Header "%(content_archive)s/%(distribution)s-misc/Contents.top";
21};19};
2220
2321
=== modified file 'lib/lp/archivepublisher/scripts/generate_contents_files.py'
--- lib/lp/archivepublisher/scripts/generate_contents_files.py 2016-02-05 16:51:12 +0000
+++ lib/lp/archivepublisher/scripts/generate_contents_files.py 2016-11-01 12:26:30 +0000
@@ -205,21 +205,6 @@
205 else:205 else:
206 self.logger.debug("Did not find overrides; not copying.")206 self.logger.debug("Did not find overrides; not copying.")
207207
208 def writeContentsTop(self, distro_name, distro_title):
209 """Write Contents.top file.
210
211 This method won't access the database.
212 """
213 output_filename = os.path.join(
214 self.content_archive, '%s-misc' % distro_name, "Contents.top")
215 parameters = {
216 'distrotitle': distro_title,
217 }
218 output_file = file(output_filename, 'w')
219 text = file(get_template("Contents.top")).read() % parameters
220 output_file.write(text)
221 output_file.close()
222
223 def runAptFTPArchive(self, distro_name):208 def runAptFTPArchive(self, distro_name):
224 """Run apt-ftparchive to produce the Contents files.209 """Run apt-ftparchive to produce the Contents files.
225210
@@ -233,7 +218,7 @@
233 "apt-contents.conf"),218 "apt-contents.conf"),
234 ])219 ])
235220
236 def generateContentsFiles(self, override_root, distro_name, distro_title):221 def generateContentsFiles(self, override_root, distro_name):
237 """Generate Contents files.222 """Generate Contents files.
238223
239 This method may take a long time to run.224 This method may take a long time to run.
@@ -243,13 +228,10 @@
243 evaluated without accessing the database.228 evaluated without accessing the database.
244 :param distro_name: Copy of `self.distribution.name` that can be229 :param distro_name: Copy of `self.distribution.name` that can be
245 evaluated without accessing the database.230 evaluated without accessing the database.
246 :param distro_title: Copy of `self.distribution.title` that can be
247 evaluated without accessing the database.
248 """231 """
249 self.logger.debug(232 self.logger.debug(
250 "Running apt in private tree to generate new contents.")233 "Running apt in private tree to generate new contents.")
251 self.copyOverrides(override_root)234 self.copyOverrides(override_root)
252 self.writeContentsTop(distro_name, distro_title)
253 self.runAptFTPArchive(distro_name)235 self.runAptFTPArchive(distro_name)
254236
255 def updateContentsFile(self, suite, arch):237 def updateContentsFile(self, suite, arch):
@@ -309,14 +291,12 @@
309291
310 overrideroot = self.config.overrideroot292 overrideroot = self.config.overrideroot
311 distro_name = self.distribution.name293 distro_name = self.distribution.name
312 distro_title = self.distribution.title
313294
314 # This takes a while. Ensure that we do it without keeping a295 # This takes a while. Ensure that we do it without keeping a
315 # database transaction open.296 # database transaction open.
316 self.txn.commit()297 self.txn.commit()
317 with DatabaseBlockedPolicy():298 with DatabaseBlockedPolicy():
318 self.generateContentsFiles(299 self.generateContentsFiles(overrideroot, distro_name)
319 overrideroot, distro_name, distro_title)
320300
321 self.updateContentsFiles(suites)301 self.updateContentsFiles(suites)
322302
323303
=== modified file 'lib/lp/archivepublisher/tests/test_generate_contents_files.py'
--- lib/lp/archivepublisher/tests/test_generate_contents_files.py 2016-01-13 17:09:34 +0000
+++ lib/lp/archivepublisher/tests/test_generate_contents_files.py 2016-11-01 12:26:30 +0000
@@ -257,20 +257,6 @@
257 'Architectures "%s source";' % das.architecturetag,257 'Architectures "%s source";' % das.architecturetag,
258 apt_contents_conf)258 apt_contents_conf)
259259
260 def test_writeContentsTop(self):
261 # writeContentsTop writes a Contents.top file based on a
262 # standard template, with the distribution's title interpolated.
263 distro = self.makeDistro()
264 script = self.makeScript(distro)
265 content_archive = script.content_archive
266 script.writeContentsTop(distro.name, distro.title)
267
268 contents_top = file(
269 "%s/%s-misc/Contents.top" % (content_archive, distro.name)).read()
270
271 self.assertIn("This file maps", contents_top)
272 self.assertIn(distro.title, contents_top)
273
274 def test_setUp_places_content_archive_in_distroroot(self):260 def test_setUp_places_content_archive_in_distroroot(self):
275 # The contents files are kept in subdirectories of distroroot.261 # The contents files are kept in subdirectories of distroroot.
276 script = self.makeScript()262 script = self.makeScript()