Comment 0 for bug 1555305

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Create the files:
$ mkdir test
$ cd test
$ touch foo
$ ln -s foo bar
$ mkdir meta
$ cat >meta/snap.yaml <<EOM
name: test
version: 1.0
architectures: [all]
EOM

Create the initial snap
$ cd ..
$ snapcraft snap ./test
...
Snapped test_1.0_all.snap
$ mv test_1.0_all.snap test_1.0_all.snap.orig

Unsquash the snap:
$ unsquashfs -d unsquashed test_1.0_all.snap.orig
Parallel unsquashfs: Using 4 processors
3 inodes (2 blocks) to write

[=======================================================================|] 2/2 100%

created 2 files
created 2 directories
created 1 symlinks
created 0 devices
created 0 fifos

Resquash the snap:
$ snapcraft snap ./unsquashed
...
Snapped test_1.0_all.snap

Compare:
$ unsquashfs -lls ./test_1.0_all.snap.orig
Parallel unsquashfs: Using 4 processors
3 inodes (2 blocks) to write

drwxrwxr-x root/root 49 2016-03-09 13:26 squashfs-root
lrwxrwxrwx root/root 3 2016-03-09 13:26 squashfs-root/bar -> foo
-rw-rw-r-- root/root 0 2016-03-09 13:26 squashfs-root/foo
drwxrwxr-x root/root 32 2016-03-09 13:26 squashfs-root/meta
-rw-rw-r-- root/root 45 2016-03-09 13:26 squashfs-root/meta/snap.yaml

$ unsquashfs -lls ./test_1.0_all.snap
Parallel unsquashfs: Using 4 processors
3 inodes (2 blocks) to write

drwxrwxr-x root/root 49 2016-03-09 13:26 squashfs-root
lrwxrwxrwx root/root 3 2016-03-09 13:28 squashfs-root/bar -> foo
-rw-rw-r-- root/root 0 2016-03-09 13:26 squashfs-root/foo
drwxrwxr-x root/root 32 2016-03-09 13:26 squashfs-root/meta
-rw-rw-r-- root/root 45 2016-03-09 13:26 squashfs-root/meta/snap.yaml

Notice that the symlink 'bar' has a different timestamp from the original and the resquashed which is causing the review tools trouble.