removed file lists all files including their parent directory

Bug #1381134 reported by James Hunt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu system image
New
Undecided
Unassigned

Bug Description

The top-level "removed" file added to the .tar.xz system-images list all files, one per line, that should be removed prior to applying the new system image.

However, currently that file can list both a directory *and* all the files in that directory. Here's the relevant snippet of the removed file:

system/usr/lib/x86_64-linux-gnu/perl/5.20
system/usr/lib/x86_64-linux-gnu/perl/5.20.0
system/usr/lib/x86_64-linux-gnu/perl/5.20.0/B
system/usr/lib/x86_64-linux-gnu/perl/5.20.0/B.pm
system/usr/lib/x86_64-linux-gnu/perl/5.20.0/B/Concise.pm
system/usr/lib/x86_64-linux-gnu/perl/5.20.0/B/Showlex.pm
system/usr/lib/x86_64-linux-gnu/perl/5.20.0/B/Terse.pm
system/usr/lib/x86_64-linux-gnu/perl/5.20.0/B/Xref.pm
system/usr/lib/x86_64-linux-gnu/perl/5.20.0/CORE

The first entry ('system/usr/lib/x86_64-linux-gnu/perl/5.20') is a sym link which the upgrader handles correctly and just deletes.
The second entry ('system/usr/lib/x86_64-linux-gnu/perl/5.20.0') is a directory. The upgrader currently sees that as a directory and immediately recursively removes it.
Now, every subsequent file below 'system/usr/lib/x86_64-linux-gnu/perl/5.20.0' will generate a warning as they no longer exist.

We could get the upgrader to reverse-sort this file and process it backwards to avoid the issue, but to keep the upgrader as simple as possible we should handle this logic server-side and either:

1) Specify 'system/usr/lib/x86_64-linux-gnu/perl/5.20.0' meaning delete this directory and everything below it.

    In the scenario above, that would be sufficient since, in fact, every file relating to perl 5.20.0 should indeed be deleted. This makes the removed file a lot smaller of course as it only needs 1 line rather than the current 452 lines.

2) Specify every file within a directory that should be deleted, but *not* the directory name itself if the directory still contains files that should be retained.

As an aside, it would be good to add a trailing slash to directories in this file to allow the upgrader to check if the file type has changed (ideally, we'd encode all the permission bits). We never expect the removed file and the filesystem to get out of sync but...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.