Commit 13f7b78
authored
Walk the unpacked tree without following symlinks in the mtime pass (#220)
After extracting a tarball to disk, unpack refreshed every file's mtime
by listing the tree with filelib:wildcard("**"), which descends into
symlinked directories, and file:write_file_info/3, which resolves
symlinks. Packages created by old clients can contain in-tree symlink
cycles (create rejects them today, unpack accepts them), and on such a
package the pass visits every file once per cycle expansion: svx 0.2.0
holds 1,171 files but the wildcard enumerates ~47k paths, turning a
260ms extraction into multiple seconds of mtime updates.
Replace the wildcard with a read_link_info walk that updates regular
files and directories and skips symlinks entirely, computing the
timestamp once.1 parent 0ee703d commit 13f7b78
2 files changed
Lines changed: 55 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
| 490 | + | |
494 | 491 | | |
495 | 492 | | |
496 | 493 | | |
| |||
1099 | 1096 | | |
1100 | 1097 | | |
1101 | 1098 | | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
| 1099 | + | |
1106 | 1100 | | |
1107 | 1101 | | |
1108 | 1102 | | |
| |||
1111 | 1105 | | |
1112 | 1106 | | |
1113 | 1107 | | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
1119 | 1132 | | |
1120 | 1133 | | |
1121 | 1134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
278 | 279 | | |
279 | 280 | | |
280 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
281 | 310 | | |
282 | 311 | | |
283 | 312 | | |
| |||
0 commit comments