Merge lp:~wgrant/launchpad/fix-sprite-rebuild-rules into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 13172
Proposed branch: lp:~wgrant/launchpad/fix-sprite-rebuild-rules
Merge into: lp:launchpad
Diff against target: 13 lines (+2/-1)
1 file modified
Makefile (+2/-1)
To merge this branch: bzr merge lp:~wgrant/launchpad/fix-sprite-rebuild-rules
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code Approve
Review via email: mp+63791@code.launchpad.net

Commit message

Rebuild icon-sprites(.positioning) on sprite.css.in changes.

Description of the change

icon-sprites and icon-sprites.positioning were recently changed to no longer be version-controlled, instead being built during deployment or on developer machines. This has made a Makefile bug apparent: they are not regenerated when new sprites are added to sprite.css.in. This manifests itself as a crash when a new sprite is added, like so:

utilities/shhh.py bin/sprite-util create-css
Traceback (most recent call last):
  File "bin/sprite-util", line 64, in <module>
    sprite_util.saveConvertedCSS(css_file, '../icon-sprites')
  File "/home/wgrant/launchpad/lp-branches/devel/lib/lp/services/spriteutils.py", line 246, in saveConvertedCSS
    position = self.positions[sprite['filename']]
KeyError: u'../images/mute.png'

This branch fixes the Makefile to regenerate positioning when the CSS is changed.

To post a comment you must log in.
Revision history for this message
Steve Kowalik (stevenk) wrote :

Excellent catch.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2011-04-22 14:02:29 +0000
3+++ Makefile 2011-06-08 01:02:32 +0000
4@@ -163,7 +163,8 @@
5
6 sprite_image: ${ICING}/icon-sprites ${ICING}/icon-sprites.positioning
7
8-${ICING}/icon-sprites.positioning ${ICING}/icon-sprites: bin/sprite-util
9+${ICING}/icon-sprites.positioning ${ICING}/icon-sprites: bin/sprite-util \
10+ ${ICING}/sprite.css.in
11 ${SHHH} bin/sprite-util create-image
12
13 # We absolutely do not want to include the lazr.testing module and