|
@@ -15,6 +15,7 @@
|
|
|
NSString *dpkg = [@"dpkg" runPathForSearchPath];
|
|
|
NSString *packageName = [HelperClass singleLineReturnForProcess:@"%@ -f %@ Package",dpkg, debFile];
|
|
|
NSString *packageVersion = [HelperClass singleLineReturnForProcess:@"%@ -f %@ Version", dpkg, debFile];
|
|
|
+ NSString *architecture = [HelperClass singleLineReturnForProcess:@"%@ -f %@ Architecture", dpkg, debFile];
|
|
|
NSArray <InputPackageFile *> *fileList = [HelperClass returnForProcess:[NSString stringWithFormat:@"%@ -c %@", dpkg, debFile]];
|
|
|
|
|
|
__block NSMutableArray *finalArray = [NSMutableArray new];
|
|
@@ -33,6 +34,7 @@
|
|
|
pkg.path = debFile;
|
|
|
pkg.packageName = packageName;
|
|
|
pkg.version = packageVersion;
|
|
|
+ pkg.architecture = architecture;
|
|
|
pkg.validLDIDPath = [HelperClass validLDIDPath];
|
|
|
return pkg;
|
|
|
|
|
@@ -134,7 +136,9 @@
|
|
|
return fileList;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+- (NSString *)fullPackageName {
|
|
|
+ return [NSString stringWithFormat:@"%@_%@_%@.deb", self.packageName, self.version, self.architecture];
|
|
|
+}
|
|
|
|
|
|
- (int)installToBootstrapPath:(NSString *)bootstrapPath {
|
|
|
|
|
@@ -347,6 +351,9 @@
|
|
|
//DLog(@"skipping file: %@", file);
|
|
|
return;
|
|
|
}
|
|
|
+ if (![FM fileExistsAtPath:file]){
|
|
|
+ return;
|
|
|
+ }
|
|
|
DLog(@"processing file: %@", file);
|
|
|
NSString *fat = [HelperClass singleLineReturnForProcess:@"/usr/bin/lipo -info %@",file];
|
|
|
if ([fat containsString:@"Architectures"]){
|
|
@@ -385,8 +392,8 @@
|
|
|
- (BOOL)shouldCodesignFile:(NSString *)file {
|
|
|
NSArray *codesignPrefixes = @[@"py", @"so", @"dylib", @"appex"];
|
|
|
BOOL isDir = false;
|
|
|
- [FM fileExistsAtPath:file isDirectory:&isDir];
|
|
|
- if (isDir) return false;
|
|
|
+ BOOL exists = [FM fileExistsAtPath:file isDirectory:&isDir];
|
|
|
+ if (isDir || !exists) return false;
|
|
|
return ([FM isExecutableFileAtPath:file] || [codesignPrefixes containsObject:[[file pathExtension] lowercaseString]]);
|
|
|
}
|
|
|
|
|
@@ -477,12 +484,13 @@
|
|
|
NSString *controlPath = [debian stringByAppendingPathComponent:@"control"];
|
|
|
NSMutableString *controlFile = [[NSMutableString alloc] initWithContentsOfFile:controlPath encoding:NSASCIIStringEncoding error:nil];
|
|
|
//@"appletvos-arm64"
|
|
|
- [controlFile replaceOccurrencesOfString:self.version withString:[self.version nextVersionNumber] options:NSLiteralSearch range:NSMakeRange(0, [controlFile length])];
|
|
|
+ NSString *nextVersionNumber = [self.version nextVersionNumber];
|
|
|
+ [controlFile replaceOccurrencesOfString:self.version withString:nextVersionNumber options:NSLiteralSearch range:NSMakeRange(0, [controlFile length])];
|
|
|
#pragma clang diagnostic push
|
|
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
|
[controlFile writeToFile:controlPath atomically:TRUE];
|
|
|
-
|
|
|
- [self sanitizeScriptsIfNecessary:debian];
|
|
|
+ self.version = nextVersionNumber;
|
|
|
+ //[self sanitizeScriptsIfNecessary:debian];
|
|
|
|
|
|
//at this point we have the files extracted, time to determine what needs to be changed
|
|
|
|
|
@@ -556,9 +564,9 @@
|
|
|
DLog(@"[INFO] moving %@ to %@", oldPath, newPath);
|
|
|
[FM moveItemAtPath:oldPath toPath:newPath error:nil];
|
|
|
}];
|
|
|
- NSString *depArchiveInfo = [NSString stringWithFormat:@"%@ -b %@", dpkg, self.packageName];
|
|
|
+ NSString *depArchiveInfo = [NSString stringWithFormat:@"%@ -b %@ %@", dpkg, self.packageName, [self fullPackageName]];
|
|
|
if (fakeRoot) {
|
|
|
- depArchiveInfo = [NSString stringWithFormat:@"%@ %@ -b %@", fakeRoot, dpkg, self.packageName];
|
|
|
+ depArchiveInfo = [NSString stringWithFormat:@"%@ %@ -b %@ %@", fakeRoot, dpkg, self.packageName, [self fullPackageName]];
|
|
|
}
|
|
|
[[HelperClass returnForProcess:depArchiveInfo] componentsJoinedByString:@"\n"];
|
|
|
DLog(@"\nDone!\n\n");
|
|
@@ -653,7 +661,7 @@
|
|
|
[controlFile writeToFile:controlPath atomically:TRUE];
|
|
|
#pragma clang diagnostic pop
|
|
|
}
|
|
|
- [self sanitizeScriptsIfNecessary:debian];
|
|
|
+ //[self sanitizeScriptsIfNecessary:debian];
|
|
|
//at this point we have the files extracted, time to determine what needs to be changed
|
|
|
NSArray *ignoreFiles = @[@".fauxsu", @".DS_Store"];
|
|
|
NSArray *forbiddenRoots = @[@"etc", @"var", @"tmp"];
|