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
=== modified file 'Makefile'
--- Makefile 2010-02-09 03:57:08 +0000
+++ Makefile 2010-02-17 22:01:25 +0000
@@ -215,6 +215,11 @@
215stop_codebrowse:215stop_codebrowse:
216 $(PY) sourcecode/launchpad-loggerhead/stop-loggerhead.py216 $(PY) sourcecode/launchpad-loggerhead/stop-loggerhead.py
217217
218run_codehosting: inplace stop hosted_branches
219 $(RM) thread*.request
220 bin/run -r librarian,sftp,codebrowse -i $(LPCONFIG)
221
222
218start_librarian: build223start_librarian: build
219 bin/start_librarian224 bin/start_librarian
220225
221226
=== modified file 'buildout-templates/bin/combine-css.in'
--- buildout-templates/bin/combine-css.in 2010-02-10 06:02:33 +0000
+++ buildout-templates/bin/combine-css.in 2010-02-17 22:01:25 +0000
@@ -2,11 +2,13 @@
22
3import os3import os
44
5from lazr.js.build import ComboFile
5from lazr.js.combo import combine_files6from lazr.js.combo import combine_files
67
78
8root = '${buildout:directory}'9root = '${buildout:directory}'
9icing = os.path.join(root, 'lib/canonical/launchpad/icing')10icing = os.path.join(root, 'lib/canonical/launchpad/icing')
11target = os.path.join(icing, 'combo.css')
10# It'd probably be nice to have this script find all the CSS files we might12# It'd probably be nice to have this script find all the CSS files we might
11# need and combine them together, but if we do that we'd certainly end up13# need and combine them together, but if we do that we'd certainly end up
12# including lots of styles that we don't need/want, so keeping this hard-coded14# including lots of styles that we don't need/want, so keeping this hard-coded
@@ -27,10 +29,17 @@
27 # This one goes at the end because it's our main stylesheet and should29 # This one goes at the end because it's our main stylesheet and should
28 # take precedence over the others.30 # take precedence over the others.
29 'build/style-3-0.css']31 'build/style-3-0.css']
30result = ''32
31for content in combine_files(names, icing):33absolute_names = []
32 result += content34for name in names:
3335 absolute_names.append(os.path.join(icing, name))
34f = open(os.path.join(icing, 'combo.css'), 'w')36
35f.write(result)37combo = ComboFile(absolute_names, target)
36f.close()38if combo.needs_update():
39 result = ''
40 for content in combine_files(names, icing):
41 result += content
42
43 f = open(target, 'w')
44 f.write(result)
45 f.close()