[127232] trunk/dports/multimedia/mythtv-core.27

ctreleaven at macports.org ctreleaven at macports.org
Thu Oct 23 18:11:37 PDT 2014


Revision: 127232
          https://trac.macports.org/changeset/127232
Author:   ctreleaven at macports.org
Date:     2014-10-23 18:11:37 -0700 (Thu, 23 Oct 2014)
Log Message:
-----------
mythtv-core.27: Myth_Start_Stop.applescript fixes

Modified Paths:
--------------
    trunk/dports/multimedia/mythtv-core.27/Portfile
    trunk/dports/multimedia/mythtv-core.27/files/Myth_Stop_Start.applescript

Modified: trunk/dports/multimedia/mythtv-core.27/Portfile
===================================================================
--- trunk/dports/multimedia/mythtv-core.27/Portfile	2014-10-23 22:44:57 UTC (rev 127231)
+++ trunk/dports/multimedia/mythtv-core.27/Portfile	2014-10-24 01:11:37 UTC (rev 127232)
@@ -16,7 +16,7 @@
 
 name                mythtv-core${majorversion}
 version             0${majorversion}${minorversion}-Fixes-20141017
-revision            2
+revision            3
 categories          multimedia
 platforms           darwin
 # i386 unsupported -- https://trac.macports.org/ticket/40337

Modified: trunk/dports/multimedia/mythtv-core.27/files/Myth_Stop_Start.applescript
===================================================================
--- trunk/dports/multimedia/mythtv-core.27/files/Myth_Stop_Start.applescript	2014-10-23 22:44:57 UTC (rev 127231)
+++ trunk/dports/multimedia/mythtv-core.27/files/Myth_Stop_Start.applescript	2014-10-24 01:11:37 UTC (rev 127232)
@@ -52,7 +52,7 @@
 		default button "Close" -- cancel button "Close" 
 	set myResult to button returned of myResult
 	if myResult contains "Start MythBackend" then
-		do shell script "sudo launchctl load -w /Library/LaunchDaemons/org.mythtv.mythbackend.plist" with administrator privileges
+		my startBackend()
 	else if myResult contains "Stop MythBackend" then
 		if ((do shell script "sudo launchctl list" with administrator privileges) contains "mythbackend") then
 			do shell script "sudo launchctl unload -w /Library/LaunchDaemons/org.mythtv.mythbackend.plist" with administrator privileges
@@ -62,22 +62,31 @@
 		end if
 		set myResult to "Close"
 	else if myResult contains "Schedule log rotation" then
-		--check for existence of 
-		if not FileExists("@PREFIX@/etc/logrotate.conf") then
-			do shell script "sudo cp @PREFIX@/share/logrotate/logrotate.conf.example @PREFIX@/etc/logrotate.conf" with administrator privileges
-		end if
-		if FileExists("@PREFIX@/etc/logrotate.d/logrotate.mythtv") then
-			display dialog "Missing logrotate.conf to be added" buttons {"Close"}
-			do shell script "sudo launchctl load -w /Library/LaunchDaemons/org.macports.logrotate.plist" with administrator privileges
-		else
-			display dialog "logrotate is not configured.  Please see http://www.mythtv.org/wiki/MacPorts for instructions." buttons {"Close"}
-			set myResult to "Close"
-		end if
+		my enableLogRotation()
 	else if myResult contains "Disable log rotation" then
 		do shell script "sudo launchctl unload -w /Library/LaunchDaemons/org.macports.logrotate.plist" with administrator privileges
 	end if
 end repeat
 
+on startBackend()
+	--ensure plist is ready
+	if (not my FileExists("/Library/LaunchDaemons/org.mythtv.mythbackend.plist")) then
+		do shell script "sudo ln -s @PREFIX@/Library/LaunchDaemons/org.mythtv.mythbackend.plist /Library/LaunchDaemons/org.mythtv.mythbackend.plist" with administrator privileges
+	end if
+	do shell script "sudo launchctl load -w /Library/LaunchDaemons/org.mythtv.mythbackend.plist" with administrator privileges
+end startBackend
+
+on enableLogRotation()
+	--check for existence of conf file
+	if (not my FileExists("@PREFIX@/etc/logrotate.conf")) then
+		do shell script "sudo cp @PREFIX@/share/logrotate/logrotate.conf.example @PREFIX@/etc/logrotate.conf" with administrator privileges
+	end if
+	if (not my FileExists("/Library/LaunchDaemons/org.macports.logrotate.plist")) then
+		do shell script "sudo ln -s @PREFIX@/share/logrotate/org.macports.logrotate.plist.example /Library/LaunchDaemons/org.macports.logrotate.plist" with administrator privileges
+	end if
+	do shell script "sudo launchctl load -w /Library/LaunchDaemons/org.macports.logrotate.plist" with administrator privileges
+end enableLogRotation
+
 on FileExists(theFile) -- (String) as Boolean
 	tell application "System Events" to return (exists file theFile)
 end FileExists
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20141023/79e40c8e/attachment.html>


More information about the macports-changes mailing list