On 11/02/2016 12:41 AM, Didier Roche wrote: > Le 28/10/2016 à 21:00, Aaron Ogle a écrit : >> Point definitely well made. I'm with you now. :) >> >> Now this being the case. I can't just swap the location. This is >> where I would need a rock solid upgrade hook. But I would only need >> to run it the once. Any suggestions? Or any good examples? > > Maybe Kyle missed that one. > For now, AFAIK, we don't have upgrade hook (yet ;)). I would go with the > wrapper script (that I think you already have) path. Check for the > database location in $SNAP_DATA. If nothing exists, do the migration, > remove $SNAP_COMMON database content once done.
Ah, sorry guys. You can likely use the `configure` hook for this, too (I believe it runs upon upgrade). The problem you'll run into with both approaches is that you'll have to maintain this migration code forever since you never know the version of the snap from which a user will be upgrading. This problem will be solved with stepped upgrades and epoch support, but we're not there yet. -- Kyle Fazzari (kyrofa) Software Engineer Canonical Ltd. k...@canonical.com
signature.asc
Description: OpenPGP digital signature
-- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft