Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Classes/NVHGzipFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ typedef NS_ENUM(NSInteger, NVHGzipFileErrorType)

@interface NVHGzipFile ()

@property (nonatomic,assign) CGFloat fileSizeFraction;
@property (nonatomic,assign) double fileSizeFraction;

@end

Expand Down
16 changes: 15 additions & 1 deletion Classes/NVHTarFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

// Logging mode
// Comment this line for production
//#define TAR_VERBOSE_LOG_MODE
// #define TAR_VERBOSE_LOG_MODE

// const definition
#define TAR_BLOCK_SIZE 512
Expand Down Expand Up @@ -243,6 +243,20 @@ - (BOOL)createFilesAndDirectoriesAtPath:(NSString *)path withTarObject:(id)objec
break;
}

// This fixes the following issue for tar files genetrated on the mac...
// https://github.com/nvh/NVHTarGzip/issues/8
case ' ': // .DS_Store filea manifest with an empty string as their type.
{
#ifdef TAR_VERBOSE_LOG_MODE
NSLog(@"UNTAR - unsupported block");
#endif
@autoreleasepool {
unsigned long long objectSize = [NVHTarFile sizeForObject:object atOffset:location];
blockCount += ceil(objectSize / TAR_BLOCK_SIZE);
}
break;
}

default: // It's not a tar type
{
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:@"Invalid block type found"
Expand Down
25 changes: 25 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

let package = Package(
name: "NVHTarGzip",
defaultLocalization: "en",
platforms: [
.iOS(.v12),
.tvOS(.v12),
.macOS(.v10_13),
],
products: [
.library(
name: "NVHTarGzip", targets: ["NVHTarGzip"]),
],
dependencies: [
],
targets: [
.target(name: "NVHTarGzip",
path: "Classes",
publicHeadersPath: ""),
]
)