Perform compatibility checks in the install hook/upgrade action
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Landscape Charm |
Invalid
|
Wishlist
|
Unassigned |
Bug Description
The install hook/upgrade action should check if it they handle the version of the landscape-server that is going to be installed (and that comes from the repository configured with the "source" configuration option of the charm).
A way to do that would be:
- Add a CHARM.info file to the landscape-server Debian package that declares the minimum charm version required in order to install this version of the package.
- Run apt-get install with the "-d" (download only) option at first, then use gzip/ar to extract the content of the CHARM.info file from the downloaded landscape-server deb (debs are really compressed ar files) and finally check if the current charm version on the unit is greater or equal than the one advertised in the CHARM.info file of the package
If the check doesn't pass the script will fail.
tags: | added: upgradable-charm |
FWIW, I believe we should use custom fields in .deb control files instead: https:/ /www.debian. org/doc/ debian- policy/ ch-controlfield s.html# s5.7
Using "XB-Required- Charm-Version: X" would put "Required- Charm-Version: X" in the landscape-server binary deb control file, and we'd be able to read it with something like "dpkg -f landscape- server* .deb Required- Charm-Version" (or maybe "apt-cache showpkg landscape-server", though I haven't checked that).