Skip to content

Commit

Permalink
Add Spanish resources + POSIX permissions fix
Browse files Browse the repository at this point in the history
  • Loading branch information
packagesdev committed Sep 12, 2019
1 parent 30a85ba commit a7434ca
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 75 deletions.
2 changes: 1 addition & 1 deletion distribution/Documents/en.lproj/Welcome.rtfd/TXT.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

\f0\b\fs36 \cf0 \
\
Packages 1.2.6
Packages 1.2.7
\i\b0\fs26 \
\i0 \
Expand Down
Binary file not shown.
21 changes: 21 additions & 0 deletions distribution/Documents/es.lproj/Welcome.rtfd/TXT.rtf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{\rtf1\ansi\ansicpg1252\cocoartf1348\cocoasubrtf170
\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww9020\viewh7500\viewkind0
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc

\f0\b\fs36 \cf0 \
\
Packages 1.2.7
\i\b0\fs26 \
\i0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\fs24 \cf0 {{\NeXTGraphic Pasted Graphic.tiff \width2560 \height2560 \noorient
}¬}\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
\cf0 \
Copyright \'a9 2009-2019 St\'e9phane Sudre\
Todos los derechos reservados}
2 changes: 1 addition & 1 deletion distribution/Documents/fr.lproj/Welcome.rtfd/TXT.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

\f0\b\fs36 \cf0 \
\
Packages 1.2.6
Packages 1.2.7
\i\b0\fs26 \
\i0 \
Expand Down
13 changes: 13 additions & 0 deletions distribution/Packages.pkgproj
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,8 @@
</dict>
<key>PAYLOAD_TYPE</key>
<integer>0</integer>
<key>PRESERVE_EXTENDED_ATTRIBUTES</key>
<false/>
<key>SHOW_INVISIBLE</key>
<true/>
<key>SPLIT_FORKS</key>
Expand Down Expand Up @@ -1306,6 +1308,17 @@
<integer>1</integer>
</dict>
</dict>
<dict>
<key>LANGUAGE</key>
<string>Spanish</string>
<key>VALUE</key>
<dict>
<key>PATH</key>
<string>Documents/es.lproj/Welcome.rtfd</string>
<key>PATH_TYPE</key>
<integer>1</integer>
</dict>
</dict>
<dict>
<key>LANGUAGE</key>
<string>French</string>
Expand Down
85 changes: 12 additions & 73 deletions packages_builder/packages_builder/PKGProjectBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -6843,7 +6843,7 @@ - (BOOL)buildScriptsAndResources:(PKGPackageScriptsAndResources *)inScriptsAnRes

// Create the Temporary directory

NSString * tTemporaryDirectoryPath=[_scratchLocation stringByAppendingPathComponent:[NSString stringWithFormat:@"%d/%@",self.userID,[[_buildOrder.projectPath lastPathComponent] stringByDeletingPathExtension]]];
NSString * tTemporaryDirectoryPath=[_scratchLocation stringByAppendingPathComponent:[NSString stringWithFormat:@"%d/%@",self.userID,[_buildOrder.projectPath.lastPathComponent stringByDeletingPathExtension]]];

if ([_fileManager fileExistsAtPath:tTemporaryDirectoryPath]==YES)
{
Expand Down Expand Up @@ -6972,7 +6972,7 @@ - (BOOL)buildScriptsAndResources:(PKGPackageScriptsAndResources *)inScriptsAnRes
BOOL (^copyScript)(NSString *,NSString *,NSString *__autoreleasing *)=^BOOL(NSString * bSourcePath,NSString *bDestinationPath,NSString *__autoreleasing *bOutScriptName){

NSString * tDestinationFolder=[bDestinationPath stringByDeletingLastPathComponent];
NSString * tBaseName=[[bDestinationPath lastPathComponent] stringByDeletingPathExtension];
NSString * tBaseName=[bDestinationPath.lastPathComponent stringByDeletingPathExtension];
NSString * tSuitableFileName=[self suitableFileNameForProposedFileName:tBaseName inDirectory:tDestinationFolder];

if (tSuitableFileName==nil)
Expand Down Expand Up @@ -7018,67 +7018,6 @@ - (BOOL)buildScriptsAndResources:(PKGPackageScriptsAndResources *)inScriptsAnRes
*bOutScriptName=tSuitableFileName;

return YES;


/*NSString * tBaseName=[[bDestinationPath lastPathComponent] stringByDeletingPathExtension];

NSUInteger tIndex=1;
NSString * tFileScriptName=tBaseName;

do
{
NSString * tDestinationPath=[tDestinationFolder stringByAppendingPathComponent:tFileScriptName];

if ([_fileManager fileExistsAtPath:tDestinationPath]==NO)
{
NSError * tError=nil;

if ([_fileManager PKG_copyItemAtPath:bSourcePath toPath:tDestinationPath options:0 error:&tError]==NO)
{
PKGBuildErrorEvent * tErrorEvent=[PKGBuildErrorEvent errorEventWithCode:PKGBuildErrorFileCanNotBeCopied filePath:bSourcePath fileKind:PKGFileKindRegularFile];
tErrorEvent.otherFilePath=tDestinationPath;

if (tError!=nil && [tError.domain isEqualToString:NSCocoaErrorDomain]==YES)
{
switch(tError.code)
{
case NSFileWriteVolumeReadOnlyError:
tErrorEvent.subcode=PKGBuildErrorReadOnlyVolume;
break;

case NSFileWriteNoPermissionError:
tErrorEvent.subcode=PKGBuildErrorWriteNoPermission;
break;

case NSFileWriteOutOfSpaceError:
tErrorEvent.subcode=PKGBuildErrorNoMoreSpaceOnVolume;
break;
}
}

[self postCurrentStepFailureEvent:tErrorEvent];

return NO;
}

if (bOutScriptName!=NULL)
*bOutScriptName=tFileScriptName;

return YES;
}

tFileScriptName=[NSString stringWithFormat:@"%@_%d",tBaseName,(int)tIndex];

tIndex++;
}
while (tIndex<PKGRenamingAttemptsMax);

[self postCurrentStepFailureEvent:nil];

// A COMPLETER

return NO;*/

};


Expand Down Expand Up @@ -7742,19 +7681,10 @@ - (BOOL)buildFileHierarchyComponent:(PKGTreeNode *) inFileTreeNode atPath:(NSStr
return NO;
}

if (inBuildPackageAttributes!=nil || _buildFormat==PKGProjectBuildFormatFlat) // A VOIR
if (inBuildPackageAttributes!=nil || _buildFormat==PKGProjectBuildFormatFlat) // A VOIR (inBuildPackageAttributes==nil is useful for scripts and additional resources step)
{
NSError * tError=nil;

// Set the Privileges of the item

if ([_fileManager PKG_setPosixPermissions:tPrivileges ofItemAtPath:tDestinationPath error:&tError]==NO)
{
[self postCurrentStepFailureEvent:[PKGBuildErrorEvent errorEventWithCode:PKGBuildErrorFilePosixPermissionsCanNotBeSet filePath:tDestinationPath fileKind:PKGFileKindRegularFile]];

return NO;
}

// Set the owner and group recursively

if ([_fileManager PKG_setOwnerAccountID:tFileItem.uid groupAccountID:tFileItem.gid ofItemAndDescendantsAtPath:tDestinationPath error:&tError]==NO)
Expand All @@ -7763,6 +7693,15 @@ - (BOOL)buildFileHierarchyComponent:(PKGTreeNode *) inFileTreeNode atPath:(NSStr

return NO;
}

// Set the Privileges of the item

if ([_fileManager PKG_setPosixPermissions:tPrivileges ofItemAtPath:tDestinationPath error:&tError]==NO)
{
[self postCurrentStepFailureEvent:[PKGBuildErrorEvent errorEventWithCode:PKGBuildErrorFilePosixPermissionsCanNotBeSet filePath:tDestinationPath fileKind:PKGFileKindRegularFile]];

return NO;
}
}
}
else
Expand Down

0 comments on commit a7434ca

Please sign in to comment.