[138483] branches/gsoc15-pallet
ksammons at macports.org
ksammons at macports.org
Thu Jul 9 12:23:14 PDT 2015
Revision: 138483
https://trac.macports.org/changeset/138483
Author: ksammons at macports.org
Date: 2015-07-09 12:23:14 -0700 (Thu, 09 Jul 2015)
Log Message:
-----------
Added basic reclaim functionality
Modified Paths:
--------------
branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.h
branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.m
branches/gsoc15-pallet/Pallet/MPActionLauncher.h
branches/gsoc15-pallet/Pallet/MPActionLauncher.m
branches/gsoc15-pallet/Pallet/MPActionsController.m
branches/gsoc15-pallet/Pallet/Pallet.xcodeproj/project.xcworkspace/xcuserdata/mrappleseed.xcuserdatad/UserInterfaceState.xcuserstate
Modified: branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.h
===================================================================
--- branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.h 2015-07-09 19:22:08 UTC (rev 138482)
+++ branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.h 2015-07-09 19:23:14 UTC (rev 138483)
@@ -95,6 +95,12 @@
- (id)diagnose:(NSError**)sError;
/*!
+ @brief Runs the reclaim command.
+ */
+- (id)reclaim:(NSError**)sError;
+
+
+/*!
@brief Synchronizes the ports tree without checking for upgrades to the MacPorts base.
*/
- (id)sync:(NSError **)sError;
Modified: branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.m
===================================================================
--- branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.m 2015-07-09 19:22:08 UTC (rev 138482)
+++ branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.m 2015-07-09 19:23:14 UTC (rev 138483)
@@ -131,12 +131,39 @@
#pragma MacPorts API
+- (id)reclaim:(NSError**)sError
+{
+ NSString * result = nil;
+
+ [[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"MacPorts_reclaim_Started" object:nil];
+ [[MPNotifications sharedListener] setPerformingTclCommand:@"reclaim"];
+
+ //FIXME
+ /*
+ if ([self authorizationMode])
+ {
+ result = [interpreter evaluateStringWithMPHelperTool:@"mportdiagnose" error:sError];
+ }
+ else
+ {
+ result = [interpreter evaluateStringWithPossiblePrivileges:@"mportdiagnose" error:sError];
+ }*/
+
+ result = [interpreter evaluateStringAsString:@"reclaim::main \"\"" error:sError];
+
+ [[MPNotifications sharedListener] setPerformingTclCommand:@""];
+ [[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"MacPorts_reclaim_Finished" object:nil];
+
+ return result;
+}
+
+
- (id)diagnose:(NSError**)sError
{
NSString * result = nil;
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"MacPorts_diagnose_Started" object:nil];
- [[MPNotifications sharedListener] setPerformingTclCommand:@"sync"];
+ [[MPNotifications sharedListener] setPerformingTclCommand:@"diagnose"];
//FIXME
/*
Modified: branches/gsoc15-pallet/Pallet/MPActionLauncher.h
===================================================================
--- branches/gsoc15-pallet/Pallet/MPActionLauncher.h 2015-07-09 19:22:08 UTC (rev 138482)
+++ branches/gsoc15-pallet/Pallet/MPActionLauncher.h 2015-07-09 19:23:14 UTC (rev 138483)
@@ -85,6 +85,11 @@
- (void)diagnose;
/*!
+ @brief Runs the reclaim command.
+ */
+- (void)reclaim;
+
+/*!
@brief Syncs the MacPorts installation in another thread
*/
- (void)sync;
Modified: branches/gsoc15-pallet/Pallet/MPActionLauncher.m
===================================================================
--- branches/gsoc15-pallet/Pallet/MPActionLauncher.m 2015-07-09 19:22:08 UTC (rev 138482)
+++ branches/gsoc15-pallet/Pallet/MPActionLauncher.m 2015-07-09 19:23:14 UTC (rev 138483)
@@ -118,6 +118,22 @@
}
}
+- (void)reclaim
+{
+ errorReceived = NO;
+ NSError * error;
+ [[MPMacPorts sharedInstance] reclaim:&error];
+ if(errorReceived)
+ {
+ [self sendNotification:GROWL_RECLAIMFAILED];
+ }
+ else
+ {
+ [self sendNotification:GROWL_RECLAIM];
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"advanceQ" object:nil userInfo:nil];
+ }
+}
+
- (void)diagnose
{
errorReceived = NO;
Modified: branches/gsoc15-pallet/Pallet/MPActionsController.m
===================================================================
--- branches/gsoc15-pallet/Pallet/MPActionsController.m 2015-07-09 19:22:08 UTC (rev 138482)
+++ branches/gsoc15-pallet/Pallet/MPActionsController.m 2015-07-09 19:23:14 UTC (rev 138483)
@@ -445,6 +445,11 @@
NSLog(@"We have diagnose");
[[MPActionLauncher sharedInstance] performSelectorInBackground:@selector(diagnose) withObject:nil];
}
+ else if([[dict objectForKey:@"operation"] isEqualToString:@"reclaim"])
+ {
+ NSLog(@"We have reclaim");
+ [[MPActionLauncher sharedInstance] performSelectorInBackground:@selector(reclaim) withObject:nil];
+ }
}
else
{
Modified: branches/gsoc15-pallet/Pallet/Pallet.xcodeproj/project.xcworkspace/xcuserdata/mrappleseed.xcuserdatad/UserInterfaceState.xcuserstate
===================================================================
(Binary files differ)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150709/48c627f7/attachment-0001.html>
More information about the macports-changes
mailing list