Skip to content

Commit

Permalink
extract: rework the extraction of a package
Browse files Browse the repository at this point in the history
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
bapt committed Aug 1, 2022
1 parent 3fbc61c commit c82baac
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 50 deletions.
Loading

0 comments on commit c82baac

Please sign in to comment.