Skip to content

Commit

Permalink
Merge pull request #349 from lindegroup/v1.2.3-beta
Browse files Browse the repository at this point in the history
Version 1.2.3 merge to master.
  • Loading branch information
homebysix committed May 8, 2015
2 parents 4bb8255 + 15cd495 commit 1a43a1e
Show file tree
Hide file tree
Showing 26 changed files with 627 additions and 326 deletions.
75 changes: 55 additions & 20 deletions AutoPkgr.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@
BEE42DAD1AC6E2D100599238 /* report_malformed.plist in Resources */ = {isa = PBXBuildFile; fileRef = BEE42DAB1AC6E2D100599238 /* report_malformed.plist */; };
BEE42DAE1AC6E2D100599238 /* report_none.plist in Resources */ = {isa = PBXBuildFile; fileRef = BEE42DAC1AC6E2D100599238 /* report_none.plist */; };
BEE8CF1319E0E7F400981C4B /* NSTextField+setSafeStringValue.m in Sources */ = {isa = PBXBuildFile; fileRef = BEE8CF1219E0E7F400981C4B /* NSTextField+setSafeStringValue.m */; };
BEEFE6B71AE9D01200882C89 /* LGAutoPkgErrorHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = BEEFE6B61AE9D01200882C89 /* LGAutoPkgErrorHandler.m */; };
BEEFE6B81AE9D01200882C89 /* LGAutoPkgErrorHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = BEEFE6B61AE9D01200882C89 /* LGAutoPkgErrorHandler.m */; };
BEEFE6BB1AE9E8A600882C89 /* LGLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = BEEFE6B91AE9E8A600882C89 /* LGLogger.m */; };
BEEFE6BC1AE9E8A600882C89 /* LGLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = BEEFE6B91AE9E8A600882C89 /* LGLogger.m */; };
BEEFE6BD1AE9E9D500882C89 /* LGLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = BEEFE6B91AE9E8A600882C89 /* LGLogger.m */; };
BEFC3C761A3DF16700C789E9 /* LGUserNotifications.m in Sources */ = {isa = PBXBuildFile; fileRef = BE6815D41A0B18DE004AD310 /* LGUserNotifications.m */; };
BEFC3C771A3DF16700C789E9 /* LGGitHubJSONLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A1BAD9D197A4133008192A7 /* LGGitHubJSONLoader.m */; };
BEFC3C781A3DF16700C789E9 /* LGInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = BEAA76CB19BFD635002D73EE /* LGInstaller.m */; };
Expand Down Expand Up @@ -278,6 +283,10 @@
BEE42DAC1AC6E2D100599238 /* report_none.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = report_none.plist; sourceTree = "<group>"; };
BEE8CF1119E0E7F400981C4B /* NSTextField+setSafeStringValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSTextField+setSafeStringValue.h"; path = "Custom Categories/NSTextField+setSafeStringValue.h"; sourceTree = "<group>"; };
BEE8CF1219E0E7F400981C4B /* NSTextField+setSafeStringValue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSTextField+setSafeStringValue.m"; path = "Custom Categories/NSTextField+setSafeStringValue.m"; sourceTree = "<group>"; };
BEEFE6B51AE9D01200882C89 /* LGAutoPkgErrorHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LGAutoPkgErrorHandler.h; sourceTree = "<group>"; };
BEEFE6B61AE9D01200882C89 /* LGAutoPkgErrorHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LGAutoPkgErrorHandler.m; sourceTree = "<group>"; };
BEEFE6B91AE9E8A600882C89 /* LGLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LGLogger.m; sourceTree = "<group>"; };
BEEFE6BA1AE9E8A600882C89 /* LGLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LGLogger.h; sourceTree = "<group>"; };
BEFC931B1995F0710074C938 /* LGError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LGError.h; sourceTree = "<group>"; };
BEFC931C1995F0710074C938 /* LGError.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LGError.m; sourceTree = "<group>"; };
FF435269A548437DA5380201 /* libPods-AutoPkgr.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AutoPkgr.a"; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -331,7 +340,7 @@
isa = PBXGroup;
children = (
1AC69556195B59ED00D2BD81 /* AutoPkgr */,
BE05CE6819DAF26B0089068B /* helper */,
BE05CE6819DAF26B0089068B /* Privileged Helper */,
1AC6954F195B59ED00D2BD81 /* Frameworks */,
1AC6954E195B59ED00D2BD81 /* Products */,
1AC69574195B59EE00D2BD81 /* AutoPkgrTests */,
Expand Down Expand Up @@ -381,16 +390,13 @@
1AC69556195B59ED00D2BD81 /* AutoPkgr */ = {
isa = PBXGroup;
children = (
1AC86D36195E0972006FDD2B /* Feature Classes */,
BEEFE6BE1AEA82CD00882C89 /* AutoPkg Classes */,
1AC86D36195E0972006FDD2B /* Model Classes */,
BE40CB7719D4441600A1DABD /* UI Classes */,
BE40CB7819D4444D00A1DABD /* Utility Classes */,
BE05CE8419DAF63D0089068B /* Helper Tool Communication */,
BE39FE5419DFBB2900C1B4A1 /* Custom Categories */,
1AC69565195B59EE00D2BD81 /* MainMenu.xib */,
1AC9841E195CEC360071CAB3 /* LGConfigurationWindowController.xib */,
BE0BACD01A2560AE00554989 /* LGJSSDistributionPointsPrefPanel.xib */,
BE67E8741A44E10500484151 /* LGRecipeSearchPanel.xib */,
1AC69568195B59EE00D2BD81 /* Images.xcassets */,
BEEFE6BF1AEA873800882C89 /* XIBs */,
1AC98423195DF6270071CAB3 /* Resources */,
1AC69557195B59ED00D2BD81 /* Supporting Files */,
);
Expand Down Expand Up @@ -433,30 +439,35 @@
name = "Supporting Files";
sourceTree = "<group>";
};
1AC86D36195E0972006FDD2B /* Feature Classes */ = {
1AC86D36195E0972006FDD2B /* Model Classes */ = {
isa = PBXGroup;
children = (
BE344F531ABFBEAB00500AAE /* LGAutoPkgReport.h */,
BE344F541ABFBEAB00500AAE /* LGAutoPkgReport.m */,
BE025CFC19BAEF8800D36345 /* LGAutoPkgSchedule.h */,
BE025CFD19BAEF8800D36345 /* LGAutoPkgSchedule.m */,
BE025CF419BAE93400D36345 /* LGAutoPkgTask.h */,
BE025CF519BAE93400D36345 /* LGAutoPkgTask.m */,
1AC98410195CE8510071CAB3 /* LGEmailer.h */,
1AC98411195CE8520071CAB3 /* LGEmailer.m */,
BE6815D31A0B18DE004AD310 /* LGUserNotifications.h */,
BE6815D41A0B18DE004AD310 /* LGUserNotifications.m */,
1A1BAD9C197A4133008192A7 /* LGGitHubJSONLoader.h */,
1A1BAD9D197A4133008192A7 /* LGGitHubJSONLoader.m */,
BEAA76CA19BFD635002D73EE /* LGInstaller.h */,
BEAA76CB19BFD635002D73EE /* LGInstaller.m */,
6A53625B1988BE59008A949C /* LGTestPort.h */,
6A53625C1988BE59008A949C /* LGTestPort.m */,
BE8C7D6C1A86CEF600EBD32A /* LGTools.h */,
BE8C7D6D1A86CEF600EBD32A /* LGTools.m */,
BE6815D31A0B18DE004AD310 /* LGUserNotifications.h */,
BE6815D41A0B18DE004AD310 /* LGUserNotifications.m */,
BEBF7B151A4894AC00E9967F /* LGVersioner.h */,
BEBF7B161A4894AC00E9967F /* LGVersioner.m */,
);
name = "Feature Classes";
name = "Model Classes";
sourceTree = "<group>";
};
1AC98423195DF6270071CAB3 /* Resources */ = {
isa = PBXGroup;
children = (
1AC69568195B59EE00D2BD81 /* Images.xcassets */,
1A2C7FAC19CC9F8300CFF472 /* scripts */,
8BB217F519709A2C00EF8B93 /* AutoPkgrIcon.png */,
1AC98425195DF6350071CAB3 /* autopkgr.png */,
Expand All @@ -479,7 +490,7 @@
name = Pods;
sourceTree = "<group>";
};
BE05CE6819DAF26B0089068B /* helper */ = {
BE05CE6819DAF26B0089068B /* Privileged Helper */ = {
isa = PBXGroup;
children = (
BE05CE6919DAF26B0089068B /* main.m */,
Expand All @@ -488,6 +499,7 @@
BE05CE7B19DAF5A30089068B /* LGAutoPkgrProtocol.h */,
BE05CE7D19DAF5B80089068B /* Supporting Files */,
);
name = "Privileged Helper";
path = helper;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -573,18 +585,14 @@
BEFC931C1995F0710074C938 /* LGError.m */,
1AC86D3B195E0AC6006FDD2B /* LGHostInfo.h */,
1AC86D3C195E0AC6006FDD2B /* LGHostInfo.m */,
BE8C7D6C1A86CEF600EBD32A /* LGTools.h */,
BE8C7D6D1A86CEF600EBD32A /* LGTools.m */,
BEEFE6BA1AE9E8A600882C89 /* LGLogger.h */,
BEEFE6B91AE9E8A600882C89 /* LGLogger.m */,
BE0E857719D668F600B25B5E /* LGHTTPRequest.h */,
BE0E857819D668F600B25B5E /* LGHTTPRequest.m */,
BE053D131A8F90920021D97B /* LGPasswords.h */,
BE053D141A8F90920021D97B /* LGPasswords.m */,
1A1BAD94197A0407008192A7 /* LGVersionComparator.h */,
1A1BAD95197A0407008192A7 /* LGVersionComparator.m */,
BEBF7B151A4894AC00E9967F /* LGVersioner.h */,
BEBF7B161A4894AC00E9967F /* LGVersioner.m */,
BE344F531ABFBEAB00500AAE /* LGAutoPkgReport.h */,
BE344F541ABFBEAB00500AAE /* LGAutoPkgReport.m */,
);
name = "Utility Classes";
sourceTree = "<group>";
Expand All @@ -601,6 +609,28 @@
name = "Html Categories";
sourceTree = "<group>";
};
BEEFE6BE1AEA82CD00882C89 /* AutoPkg Classes */ = {
isa = PBXGroup;
children = (
BE025CF419BAE93400D36345 /* LGAutoPkgTask.h */,
BE025CF519BAE93400D36345 /* LGAutoPkgTask.m */,
BEEFE6B51AE9D01200882C89 /* LGAutoPkgErrorHandler.h */,
BEEFE6B61AE9D01200882C89 /* LGAutoPkgErrorHandler.m */,
);
name = "AutoPkg Classes";
sourceTree = "<group>";
};
BEEFE6BF1AEA873800882C89 /* XIBs */ = {
isa = PBXGroup;
children = (
1AC69565195B59EE00D2BD81 /* MainMenu.xib */,
1AC9841E195CEC360071CAB3 /* LGConfigurationWindowController.xib */,
BE0BACD01A2560AE00554989 /* LGJSSDistributionPointsPrefPanel.xib */,
BE67E8741A44E10500484151 /* LGRecipeSearchPanel.xib */,
);
name = XIBs;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -897,6 +927,7 @@
BE0BACD11A2560AE00554989 /* LGJSSDistributionPointsPrefPanel.m in Sources */,
BEC1258919F046FA006696C4 /* main.m in Sources */,
BED136B71AC3BE04003EBF0F /* NSArray+html_report.m in Sources */,
BEEFE6BB1AE9E8A600882C89 /* LGLogger.m in Sources */,
BED02ADC1A194F9C00714CC2 /* NSArray+filtered.m in Sources */,
1AC69564195B59EE00D2BD81 /* LGAppDelegate.m in Sources */,
BEC1258619F0465C006696C4 /* LGConfigurationWindowController.m in Sources */,
Expand All @@ -918,6 +949,7 @@
BE0E857919D668F600B25B5E /* LGHTTPRequest.m in Sources */,
BED136B11AC262CB003EBF0F /* NSString+html_report.m in Sources */,
1A1BAD9E197A4133008192A7 /* LGGitHubJSONLoader.m in Sources */,
BEEFE6B71AE9D01200882C89 /* LGAutoPkgErrorHandler.m in Sources */,
BEC1258C19F049A1006696C4 /* LGTableView.m in Sources */,
6A53625D1988BE59008A949C /* LGTestPort.m in Sources */,
BEFC931D1995F0710074C938 /* LGError.m in Sources */,
Expand All @@ -939,11 +971,13 @@
BEFC3C761A3DF16700C789E9 /* LGUserNotifications.m in Sources */,
BED136B81AC3BE04003EBF0F /* NSArray+html_report.m in Sources */,
BEFC3C771A3DF16700C789E9 /* LGGitHubJSONLoader.m in Sources */,
BEEFE6BC1AE9E8A600882C89 /* LGLogger.m in Sources */,
BED136AD1AC0F993003EBF0F /* LGPasswords.m in Sources */,
BED136AB1AC05B1D003EBF0F /* LGAutoPkgReport.m in Sources */,
BEFC3C781A3DF16700C789E9 /* LGInstaller.m in Sources */,
BEFC3C791A3DF16700C789E9 /* LGTestPort.m in Sources */,
BEFC3C7C1A3DF16700C789E9 /* LGPopularRepositories.m in Sources */,
BEEFE6B81AE9D01200882C89 /* LGAutoPkgErrorHandler.m in Sources */,
BEFC3C7D1A3DF16700C789E9 /* LGRecipes.m in Sources */,
BE67E8771A44F02B00484151 /* LGRecipeSearch.m in Sources */,
BED136AC1AC05B4C003EBF0F /* LGEmailer.m in Sources */,
Expand Down Expand Up @@ -976,6 +1010,7 @@
files = (
BE05CE9119DB380F0089068B /* LGConstants.m in Sources */,
BE1C810419E8224000EF77F3 /* NSImage+statusLight.m in Sources */,
BEEFE6BD1AE9E9D500882C89 /* LGLogger.m in Sources */,
BE05CE6A19DAF26B0089068B /* main.m in Sources */,
BE053D1B1A8F9DC00021D97B /* SNTCertificate.m in Sources */,
BE053D181A8F9DAA0021D97B /* SNTCodesignChecker.m in Sources */,
Expand Down
4 changes: 2 additions & 2 deletions AutoPkgr/AutoPkgr-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.2</string>
<string>1.2.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>751</string>
<string>780</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
2 changes: 2 additions & 0 deletions AutoPkgr/Custom Categories/NSString+cleaned.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@

- (NSString *)truncateToLength:(NSInteger)length;

- (NSString *)truncateToNumberOfLines:(NSInteger)count;

@end
12 changes: 12 additions & 0 deletions AutoPkgr/Custom Categories/NSString+cleaned.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,16 @@ - (NSString *)truncateToLength:(NSInteger)length
return self;
}

- (NSString *)truncateToNumberOfLines:(NSInteger)count
{
if (self.length) {
NSArray *lines = [self componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]];
// If the count is less, we don't need to do anything just send self back
if (lines.count > count) {
NSIndexSet *idxSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, count)];
return [[lines objectsAtIndexes:idxSet] componentsJoinedByString:@"\n"];
}
}
return self;
}
@end
24 changes: 16 additions & 8 deletions AutoPkgr/LGAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,15 @@ - (void)checkNowFromMenu:(id)sender
{
DLog(@"Received 'Check Now' menulet command.");

[self startProgressWithMessage:@"Running selected AutoPkg recipes."];
[self startProgressWithMessage:@"Running selected AutoPkg recipes..."];
NSString *recipeList = [LGRecipes recipeList];
BOOL updateRepos = [[LGDefaults standardUserDefaults] checkForRepoUpdatesAutomaticallyEnabled];

_taskManager = [[LGAutoPkgTaskManager alloc] init];
_taskManager.progressDelegate = self;
if (!_taskManager) {
_taskManager = [[LGAutoPkgTaskManager alloc] init];
_taskManager.progressDelegate = self;
}

[_taskManager runRecipeList:recipeList
updateRepo:updateRepos
reply:^(NSDictionary *report, NSError *error) {
Expand Down Expand Up @@ -295,6 +298,9 @@ - (void)startProgressWithMessage:(NSString *)message

[_runUpdatesNowMenuItem setTitle:@"Cancel AutoPkg Run"];
[_runUpdatesNowMenuItem setAction:@selector(cancelRunFromMenu:)];

NSMenuItem *runStatus = [self.statusMenu itemAtIndex:0];
runStatus.title = [message truncateToLength:50];
}];
}

Expand Down Expand Up @@ -402,12 +408,14 @@ - (void)menuWillOpen:(NSMenu *)menu
// despite aggressive synchronization, so we need to pull the value from
// the actual preference file until a better work around is found...

NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:[@"~/Library/Preferences/com.lindegroup.AutoPkgr.plist" stringByExpandingTildeInPath]];
if (!_taskManager || _taskManager.operationCount == 0 ) {
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:[@"~/Library/Preferences/com.lindegroup.AutoPkgr.plist" stringByExpandingTildeInPath]];

NSString *date = dict[@"LastAutoPkgRun"];
if (date) {
NSString *status = [NSString stringWithFormat:@"Last AutoPkg Run: %@", date ?: @"Never by AutoPkgr"];
[_progressMenuItem setTitle:status];
NSString *date = [LGDefaults formattedDate:dict[@"LastAutoPkgRun"]];
if (date) {
NSString *status = [NSString stringWithFormat:@"Last AutoPkg Run: %@", date ?: @"Never by AutoPkgr"];
_progressMenuItem.title = status;
}
}
}

Expand Down
51 changes: 51 additions & 0 deletions AutoPkgr/LGAutoPkgErrorHandler.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// LGAutoPkgErrorHandler.h
//
// Created by Eldon Ahrold on 4/23/15.
//
// Copyright 2015 Eldon Ahrold
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import <Foundation/Foundation.h>

/* AutoPkg Task Verbs
*/
typedef NS_ENUM(NSInteger, LGAutoPkgVerb) {
kLGAutoPkgUndefinedVerb,
// recipe verbs
kLGAutoPkgRun,
kLGAutoPkgRecipeList,
kLGAutoPkgMakeOverride,
kLGAutoPkgSearch,

// repo verbs
kLGAutoPkgRepoAdd,
kLGAutoPkgRepoDelete,
kLGAutoPkgRepoUpdate,
kLGAutoPkgRepoList,

// other verbs
kLGAutoPkgVersion,
};

@interface LGAutoPkgErrorHandler : NSObject

@property (nonatomic, readonly) NSPipe *pipe;
@property (nonatomic, readonly) NSString *errorString;

- (instancetype)initWithVerb:(LGAutoPkgVerb)verb;
- (NSError *)errorWithExitCode:(NSInteger)exitCode;

@end
Loading

0 comments on commit 1a43a1e

Please sign in to comment.