Merge lp:~rockstar/launchpad/makefile-hackery into lp:launchpad

Proposed by Paul Hummer
Status: Merged
Approved by: Edwin Grubbs
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~rockstar/launchpad/makefile-hackery
Merge into: lp:launchpad
Diff against target: 58 lines (+21/-7)
2 files modified
Makefile (+5/-0)
buildout-templates/bin/combine-css.in (+16/-7)
To merge this branch: bzr merge lp:~rockstar/launchpad/makefile-hackery
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) Approve
Review via email: mp+19533@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) wrote :

Hi Edwin-

  This branch fixes two bugs. The first makes it so that the combined css file
isn't generated if it doesn't need to be changed. The second creates a
run_codehosting make target so that we don't need to have mailman and all the
superfluous services when all we want is codehosting.

Cheers,
Paul

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Looks good.

merge-approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2010-02-09 03:57:08 +0000
3+++ Makefile 2010-02-17 22:01:25 +0000
4@@ -215,6 +215,11 @@
5 stop_codebrowse:
6 $(PY) sourcecode/launchpad-loggerhead/stop-loggerhead.py
7
8+run_codehosting: inplace stop hosted_branches
9+ $(RM) thread*.request
10+ bin/run -r librarian,sftp,codebrowse -i $(LPCONFIG)
11+
12+
13 start_librarian: build
14 bin/start_librarian
15
16
17=== modified file 'buildout-templates/bin/combine-css.in'
18--- buildout-templates/bin/combine-css.in 2010-02-10 06:02:33 +0000
19+++ buildout-templates/bin/combine-css.in 2010-02-17 22:01:25 +0000
20@@ -2,11 +2,13 @@
21
22 import os
23
24+from lazr.js.build import ComboFile
25 from lazr.js.combo import combine_files
26
27
28 root = '${buildout:directory}'
29 icing = os.path.join(root, 'lib/canonical/launchpad/icing')
30+target = os.path.join(icing, 'combo.css')
31 # It'd probably be nice to have this script find all the CSS files we might
32 # need and combine them together, but if we do that we'd certainly end up
33 # including lots of styles that we don't need/want, so keeping this hard-coded
34@@ -27,10 +29,17 @@
35 # This one goes at the end because it's our main stylesheet and should
36 # take precedence over the others.
37 'build/style-3-0.css']
38-result = ''
39-for content in combine_files(names, icing):
40- result += content
41-
42-f = open(os.path.join(icing, 'combo.css'), 'w')
43-f.write(result)
44-f.close()
45+
46+absolute_names = []
47+for name in names:
48+ absolute_names.append(os.path.join(icing, name))
49+
50+combo = ComboFile(absolute_names, target)
51+if combo.needs_update():
52+ result = ''
53+ for content in combine_files(names, icing):
54+ result += content
55+
56+ f = open(target, 'w')
57+ f.write(result)
58+ f.close()