Upgrading a package, migrating forward

I’m developing a new snap package and I’m testing the upgrade process. It appears that the “install” command does not create or copy the contents of the user directories forward for root but it does for my user “admin.” If I run the command as root then it will create the new directories but not copy the config forward. Is this intentional? Is there something I can do to correct this behavior?

Bump. Checking on this specifically for a service running as root.

I don’t recall this being intentional, no. Can you provide some more details of what you observed?

Sure. Take a look at this:

admin@localhost:~$ ls snap/dvn-vtc/
common current x16 x17 x18
admin@localhost:~$ ls snap/dvn-vtc/x18
upgr vtc_config.jsec vtc_reg.json vtc_upgr.log
admin@localhost:~$ sudo ls /root/snap/dvn-vtc/
common current x1 x11 x12 x13 x15 x16 x18 x2 x4 x5 x6 x7 x8 x9
admin@localhost:~$ sudo ls /root/snap/dvn-vtc/x18/
vtc_config.jsec vtc_reg.json
admin@localhost:~$ sudo snap install dvn-vtc_3.6.7.10495_amd64.snap --dangerous
dvn-vtc 3.6.7 installed
admin@localhost:~$ ls snap/dvn-vtc/
common current x17 x18 x19
admin@localhost:~$ ls snap/dvn-vtc/x19
upgr vtc_config.jsec vtc_reg.json vtc_upgr.log
admin@localhost:~$ sudo ls /root/snap/dvn-vtc/
common current x1 x11 x12 x13 x15 x16 x18 x2 x4 x5 x6 x7 x8 x9

Notice that when I upgrade the package, the directory for the admin user is automatically created and its contents copied. The same does not happen for the root user.

admin@localhost:~$ snap --version
snap 2.24
snapd 2.24
series 16
kernel 4.4.0-77-generic

x18 was the old release, x19 is the new.

Bumping one more time. Looking for some feedback. Thanks!