Merge lp:~marcoceppi/charms/oneiric/minecraft/trunk into lp:charms/oneiric/minecraft
| Status: | Merged |
|---|---|
| Approved by: | Clint Byrum on 2012-03-14 |
| Approved revision: | 30 |
| Merged at revision: | 25 |
| Proposed branch: | lp:~marcoceppi/charms/oneiric/minecraft/trunk |
| Merge into: | lp:charms/oneiric/minecraft |
| Diff against target: |
83 lines (+37/-21) 4 files modified
hooks/install (+25/-20) hooks/start (+1/-0) hooks/stop (+4/-1) hooks/upgrade-charm (+7/-0) |
| To merge this branch: | bzr merge lp:~marcoceppi/charms/oneiric/minecraft/trunk |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Clint Byrum (community) | 2012-03-13 | Approve on 2012-03-14 | |
|
Review via email:
|
|||
Description of the Change
Updated to nix old form of checksum checking (since HTTPS) and added upgrade hook
- 27. By Marco Ceppi on 2012-03-13
-
Proper name for upgrade hook
- 28. By Marco Ceppi on 2012-03-13
-
Look! The stop hook does something
- 29. By Marco Ceppi on 2012-03-13
-
Updated hooks to be better players at the idempotent game
| Marco Ceppi (marcoceppi) wrote : | # |
Hey Clint,
Thanks for the review! I've changed the hook name to follow the proper naming scheme.
Also, per your recommendations I've set the upgrade-charm script to invoke stop, install, start hooks and moved the various logics for each around so they work in tandem with one another and also separately. Just as well I've replaced diff with CMP.
Thanks!
- 30. By Marco Ceppi on 2012-03-13
-
Delete the tmp file if we don't use it
| Clint Byrum (clint-fewbar) wrote : | # |
Looking quite good, seems a bit more elegant now.
One thing.. stop and start should also be idempotent if possible.. so
if status minecraft | grep -q stop/ ; then
start minecraft
fi
This just makes things more resilient in case of unexpected system state.. as this asserts start but retains any error checking.
(and yes, we should probably push the logic above all the way back into upstart's 'start' utility so we cane make it something more like 'start --ok-no-change minecraft')
Thats really a nit pick though, the rest looks good. Also another nit.. there's not much good reason to source the scripts instead of run them... and sourcing them means variables used in both scripts might have unexpected values.. so I'd just drop the '. hooks/install' and make it 'hooks/install'. Again, just a nit! Approved.

Hi Marco, the download changes look good. +1
The name of 'upgrade' should be 'upgrade-charm' if you mean for it to be runnable by juju.
IMO, upgrade-charm should just call stop, install, config-changed, and start, rather than have a special method just for checking for upgrades, since you might have changed any of those hooks as well.
Also, minor niggle.. 'cmp' is better for comparing binaries than diff.