Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extract: rework the extraction of a package
Before for each file /a/path/to/a/file we were creating a temporary file: /a/path/to/a/.pkgtemp.file.XXXZZZ (creating the missing directories if needed). The problem with this approach is during upgrades, an element of the path could be changed to become a file and vice versa which would break the upgrade. Now we are checking each element of the path until we do find a directory which exists eg: considering /a/path/to is a file in the old package /a/path/to/a/file will become /a/path/.pkgtemp.to.XYZ/a/file at the end of the extraction (after old files have been removed) all the temporary directories are renamed after their final name. As a side effect at best we reduce the number of I/O as we reduce the number of renmaes that are needed
- Loading branch information