Differences From Artifact [45466f7ad4]:
- File utils/ofzip/TarArchive.m — part of check-in [dc0a020230] at 2017-08-06 22:24:20 on branch trunk — ofzip: Include UID & GID in tar archives (user: js, size: 14766) [annotate] [blame] [check-ins using]
To Artifact [e256d7b4a3]:
- File
utils/ofzip/TarArchive.m
— part of check-in
[57551c2e32]
at
2017-10-07 08:21:37
on branch trunk
— ofzip: Do not skip over directory type tar entries
Previously, directories were only created as soon as there is a file in
them. (user: js, size: 14965) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | OFMutableSet OF_GENERIC(OFString *) *missing = [OFMutableSet setWithArray: files]; OFTarArchiveEntry *entry; while ((entry = [_archive nextEntry]) != nil) { void *pool = objc_autoreleasePoolPush(); OFString *fileName = [entry fileName]; OFString *outFileName = [fileName stringByStandardizingPath]; OFArray OF_GENERIC(OFString *) *pathComponents; OFString *directory; OFFile *output; OFStream *stream; uint64_t written = 0, size = [entry size]; int8_t percent = -1, newPercent; if (!all && ![files containsObject: fileName]) continue; | > | > | 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | OFMutableSet OF_GENERIC(OFString *) *missing = [OFMutableSet setWithArray: files]; OFTarArchiveEntry *entry; while ((entry = [_archive nextEntry]) != nil) { void *pool = objc_autoreleasePoolPush(); OFString *fileName = [entry fileName]; of_tar_archive_entry_type_t type = [entry type]; OFString *outFileName = [fileName stringByStandardizingPath]; OFArray OF_GENERIC(OFString *) *pathComponents; OFString *directory; OFFile *output; OFStream *stream; uint64_t written = 0, size = [entry size]; int8_t percent = -1, newPercent; if (!all && ![files containsObject: fileName]) continue; if (type != OF_TAR_ARCHIVE_ENTRY_TYPE_FILE && type != OF_TAR_ARCHIVE_ENTRY_TYPE_DIRECTORY) { if (app->_outputLevel >= 0) [of_stdout writeLine: OF_LOCALIZED( @"skipping_file", @"Skipping %[file]...", @"file", fileName)]; continue; } |
︙ | ︙ | |||
302 303 304 305 306 307 308 | outFileName = [OFString pathWithComponents: pathComponents]; if (app->_outputLevel >= 0) [of_stdout writeString: OF_LOCALIZED(@"extracting_file", @"Extracting %[file]...", @"file", fileName)]; | > > | | 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | outFileName = [OFString pathWithComponents: pathComponents]; if (app->_outputLevel >= 0) [of_stdout writeString: OF_LOCALIZED(@"extracting_file", @"Extracting %[file]...", @"file", fileName)]; if (type == OF_TAR_ARCHIVE_ENTRY_TYPE_DIRECTORY || (type == OF_TAR_ARCHIVE_ENTRY_TYPE_FILE && [fileName hasSuffix: @"/"])) { [fileManager createDirectoryAtPath: outFileName createParents: true]; setPermissions(outFileName, entry); if (app->_outputLevel >= 0) { [of_stdout writeString: @"\r"]; [of_stdout writeLine: OF_LOCALIZED( |
︙ | ︙ |