[CalendarServer-changes] [12683] CalendarServer/trunk/bin

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:21:28 PDT 2014


Revision: 12683
          http://trac.calendarserver.org//changeset/12683
Author:   cdaboo at apple.com
Date:     2014-02-12 13:28:22 -0800 (Wed, 12 Feb 2014)
Log Message:
-----------
Fix various run scripts issues that were causing -d, -k invocations to fail.

Modified Paths:
--------------
    CalendarServer/trunk/bin/_build.sh
    CalendarServer/trunk/bin/_calendarserver_preamble.py
    CalendarServer/trunk/bin/run

Modified: CalendarServer/trunk/bin/_build.sh
===================================================================
--- CalendarServer/trunk/bin/_build.sh	2014-02-12 21:24:47 UTC (rev 12682)
+++ CalendarServer/trunk/bin/_build.sh	2014-02-12 21:28:22 UTC (rev 12683)
@@ -25,8 +25,10 @@
 
 
 using_system () {
-  local name="$1"; shift;
-  echo_header "Using system version of ${name}.";
+  if "${do_setup}"; then
+    local name="$1"; shift;
+    echo_header "Using system version of ${name}.";
+  fi;
 }
 
 
@@ -471,11 +473,13 @@
 
 
 ruler () {
-  echo "____________________________________________________________";
-  echo "";
+  if "${do_setup}"; then
+    echo "____________________________________________________________";
+    echo "";
 
-  if [ $# -gt 0 ]; then
-    echo "$@";
+    if [ $# -gt 0 ]; then
+      echo "$@";
+    fi;
   fi;
 }
 

Modified: CalendarServer/trunk/bin/_calendarserver_preamble.py
===================================================================
--- CalendarServer/trunk/bin/_calendarserver_preamble.py	2014-02-12 21:24:47 UTC (rev 12682)
+++ CalendarServer/trunk/bin/_calendarserver_preamble.py	2014-02-12 21:28:22 UTC (rev 12683)
@@ -34,7 +34,7 @@
     """
 
     home = dirname(dirname(abspath(__file__)))
-    run = join(home, "run")
+    run = join(home, join("bin", "run"))
 
     if not exists(run) or not exists(join(home, "setup.py")):
         # This doesn't look enough like a development checkout; let's not

Modified: CalendarServer/trunk/bin/run
===================================================================
--- CalendarServer/trunk/bin/run	2014-02-12 21:24:47 UTC (rev 12682)
+++ CalendarServer/trunk/bin/run	2014-02-12 21:28:22 UTC (rev 12683)
@@ -66,8 +66,8 @@
   echo "	-s  Run setup only; don't run server";
   echo "	-f  Force setup to run";
   echo "	-n  Do not run setup";
-  # echo "	-p  Print PYTHONPATH value for server and exit";
-  # echo "	-e  Print =-separated environment variables required to run and exit";
+  echo "	-p  Print PYTHONPATH value for server and exit";
+  echo "	-e  Print =-separated environment variables required to run and exit";
   echo "	-d  Run caldavd as a daemon";
   echo "	-k  Stop caldavd";
   echo "	-r  Restart caldavd";
@@ -91,6 +91,8 @@
 # functions in build.sh.
 parse_options () {
   OPTIND=1;
+  print_path="false";
+  print_environment="false";
   while getopts "ahsfnpedkrK:i:I:b:t:S:P:R:" option; do
     case "${option}" in
       '?') usage; ;;
@@ -105,13 +107,13 @@
       'K')     read_key="${OPTARG}"; ;;
       'S')      profile="-p ${OPTARG}"; ;;
       's') do_setup="true"; run="false"; ;;
-      # 'p')
-      #   do_get="false"; do_setup="false"; run="false"; print_path="true";
-      #   ;;
-      # 'e')
-      #   do_get="false"; do_setup="false"; run="false"; print_path="true";
-      #   print_environment="true";
-      #   ;;
+      'p')
+        do_get="false"; do_setup="false"; run="false"; print_path="true";
+        ;;
+      'e')
+        do_get="false"; do_setup="false"; run="false"; print_path="true";
+        print_environment="true";
+        ;;
       # 'i')
       #   do_get="true";
       #   do_setup="true";
@@ -216,6 +218,13 @@
     exit $?;
   fi;
 
+  # About to do something for real; let's enumerate (and depending on options,
+  # possibly download and/or install) the dependencies.
+
+  export _DEVELOP="true";
+
+  develop;
+
   if "${kill}" || "${restart}"; then
     pidfile="$("${wd}/bin/calendarserver_config" "PIDFile")";
     # Split key and value on "=" and just grab the value
@@ -236,24 +245,17 @@
     fi;
   fi;
 
-  # About to do something for real; let's enumerate (and depending on options,
-  # possibly download and/or install) the dependencies.
+  # Now that all the dependencies are set up, let's see if we're just being
+  # asked to print the path.
+  if "${print_path}"; then
+    if "${print_environment}"; then
+      ${python} -c "import os; print repr(dict(os.environ))"
+    else
+      echo "${PYTHONPATH}";
+    fi;
+    exit 0;
+  fi;
 
-  export _DEVELOP="true";
-
-  develop;
-
-  # # Now that all the dependencies are set up, let's see if we're just being
-  # # asked to print the path.
-  # if "${print_path}"; then
-  #   if "${print_environment}"; then
-  #     "${PYTHON}" -c "import os; print repr(dict(os.environ))"
-  #   else
-  #     echo "${PYTHONPATH}";
-  #   fi;
-  #   exit 0;
-  # fi;
-
   # # If we're installing, install the calendar server itself.
   # py_install "Calendar Server" "${wd}";
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/98e88728/attachment.html>


More information about the calendarserver-changes mailing list