[CalendarServer-changes] [9380] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Fri Jun 22 16:10:14 PDT 2012


Revision: 9380
          http://trac.macosforge.org/projects/calendarserver/changeset/9380
Author:   sagen at apple.com
Date:     2012-06-22 16:10:13 -0700 (Fri, 22 Jun 2012)
Log Message:
-----------
Adds UninstallExtra (11729688)

Modified Paths:
--------------
    CalendarServer/trunk/contrib/migration/calendarpromotion.py
    CalendarServer/trunk/support/Makefile.Apple

Added Paths:
-----------
    CalendarServer/trunk/contrib/migration/calendardemotion.py

Added: CalendarServer/trunk/contrib/migration/calendardemotion.py
===================================================================
--- CalendarServer/trunk/contrib/migration/calendardemotion.py	                        (rev 0)
+++ CalendarServer/trunk/contrib/migration/calendardemotion.py	2012-06-22 23:10:13 UTC (rev 9380)
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+#
+# UninstallExtra script for calendar server.
+#
+# Copyright (c) 2011-2012 Apple Inc.  All Rights Reserved.
+#
+# IMPORTANT NOTE:  This file is licensed only for use on Apple-labeled
+# computers and is subject to the terms and conditions of the Apple
+# Software License Agreement accompanying the package this file is a
+# part of.  You may not port this file to another platform without
+# Apple's written consent.
+
+import os
+from plistlib import readPlist, writePlist
+
+CALENDAR_SERVER_ROOT = "/Library/Server/Calendar and Contacts"
+DEST_CONFIG_DIR = "%s/Config" % (CALENDAR_SERVER_ROOT,)
+CALDAVD_PLIST = "caldavd.plist"
+
+def main():
+
+    plistPath = os.path.join(DEST_CONFIG_DIR, CALDAVD_PLIST)
+
+    if os.path.exists(plistPath):
+        try:
+            plistData = readPlist(plistPath)
+
+            # Turn off services
+            plistData["EnableCalDAV"] = False
+            plistData["EnableCardDAV"] = False
+
+            # Disable XMPPNotifier now that we're directly talking to APNS
+            try:
+                if plistData["Notifications"]["Services"]["XMPPNotifier"]["Enabled"]:
+                    plistData["Notifications"]["Services"]["XMPPNotifier"]["Enabled"] = False
+            except KeyError:
+                pass
+
+            writePlist(plistData, plistPath)
+        except Exception, e:
+            print "Unable to disable services in %s: %s" % (plistPath, e)
+
+
+if __name__ == '__main__':
+    main()

Modified: CalendarServer/trunk/contrib/migration/calendarpromotion.py
===================================================================
--- CalendarServer/trunk/contrib/migration/calendarpromotion.py	2012-06-21 20:26:25 UTC (rev 9379)
+++ CalendarServer/trunk/contrib/migration/calendarpromotion.py	2012-06-22 23:10:13 UTC (rev 9380)
@@ -14,7 +14,6 @@
 import shutil
 from pwd import getpwnam
 from grp import getgrnam
-from plistlib import readPlist, writePlist
 
 SRC_CONFIG_DIR = "/Applications/Server.app/Contents/ServerRoot/private/etc/caldavd"
 CALENDAR_SERVER_ROOT = "/Library/Server/Calendar and Contacts"
@@ -42,26 +41,7 @@
 
     plistPath = os.path.join(DEST_CONFIG_DIR, CALDAVD_PLIST)
 
-    if os.path.exists(plistPath):
-        try:
-            plistData = readPlist(plistPath)
-
-            # Turn off services in case this is a re-promotion
-            plistData["EnableCalDAV"] = False
-            plistData["EnableCardDAV"] = False
-
-            # Disable XMPPNotifier now that we're directly talking to APNS
-            try:
-                if plistData["Notifications"]["Services"]["XMPPNotifier"]["Enabled"]:
-                    plistData["Notifications"]["Services"]["XMPPNotifier"]["Enabled"] = False
-            except KeyError:
-                pass
-
-            writePlist(plistData, plistPath)
-        except Exception, e:
-            print "Unable to disable services in %s: %s" % (plistPath, e)
-
-    else:
+    if not os.path.exists(plistPath):
         # Copy configuration
         srcPlistPath = os.path.join(SRC_CONFIG_DIR, CALDAVD_PLIST)
         shutil.copy(srcPlistPath, DEST_CONFIG_DIR)

Modified: CalendarServer/trunk/support/Makefile.Apple
===================================================================
--- CalendarServer/trunk/support/Makefile.Apple	2012-06-21 20:26:25 UTC (rev 9379)
+++ CalendarServer/trunk/support/Makefile.Apple	2012-06-22 23:10:13 UTC (rev 9380)
@@ -111,6 +111,10 @@
 	$(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)$(SERVERSETUP)/PromotionExtras"
 	$(_v) $(INSTALL_FILE) "$(Sources)/contrib/migration/calendarpromotion.py" "$(DSTROOT)$(SERVERSETUP)/PromotionExtras/59_calendarpromotion.py"
 	$(_v) chmod ugo+x "$(DSTROOT)$(SERVERSETUP)/PromotionExtras/59_calendarpromotion.py"
+	@echo "Installing server demotion config..."
+	$(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)$(SERVERSETUP)/UninstallExtras"
+	$(_v) $(INSTALL_FILE) "$(Sources)/contrib/migration/calendardemotion.py" "$(DSTROOT)$(SERVERSETUP)/UninstallExtras/59_calendardemotion.py"
+	$(_v) chmod ugo+x "$(DSTROOT)$(SERVERSETUP)/UninstallExtras/59_calendardemotion.py"
 	@echo "Installing database configuration scripts..."
 	$(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)$(SERVERSETUP)/CommonExtras/PostgreSQLExtras"
 	$(_v) $(INSTALL_FILE) "$(Sources)/contrib/create_caldavd_db.sh" "$(DSTROOT)$(SERVERSETUP)/CommonExtras/PostgreSQLExtras/create_caldavd_db.sh"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120622/29127092/attachment.html>


More information about the calendarserver-changes mailing list