[CalendarServer-changes] [14632] CalendarServer/trunk/bin
source_changes at macosforge.org
source_changes at macosforge.org
Sat Mar 28 22:57:59 PDT 2015
Revision: 14632
http://trac.calendarserver.org//changeset/14632
Author: dre at apple.com
Date: 2015-03-28 22:57:59 -0700 (Sat, 28 Mar 2015)
Log Message:
-----------
'type -p' and 'type -P' aren't POSIX-clean and produce errors in dash, the default /bin/sh shell in Ubuntu. Instead, use 'command -v' which is more portable and does the same thing. The find-replace parameter expansion '' is also not POSIX, and also is an error in dash. Use 'tr -d .' instead.
Modified Paths:
--------------
CalendarServer/trunk/bin/_build.sh
CalendarServer/trunk/bin/caldavd
Modified: CalendarServer/trunk/bin/_build.sh
===================================================================
--- CalendarServer/trunk/bin/_build.sh 2015-03-29 04:58:16 UTC (rev 14631)
+++ CalendarServer/trunk/bin/_build.sh 2015-03-29 05:57:59 UTC (rev 14632)
@@ -523,7 +523,7 @@
ruler;
- if type -P memcached > /dev/null; then
+ if command -v memcached > /dev/null; then
using_system "memcached";
else
local v="2.0.21-stable";
@@ -545,14 +545,14 @@
ruler;
- if type -P postgres > /dev/null; then
+ if command -v postgres > /dev/null; then
using_system "Postgres";
else
local v="9.3.1";
local n="postgresql";
local p="${n}-${v}";
- if type -P dtrace > /dev/null; then
+ if command -v dtrace > /dev/null; then
local enable_dtrace="--enable-dtrace";
else
local enable_dtrace="";
Modified: CalendarServer/trunk/bin/caldavd
===================================================================
--- CalendarServer/trunk/bin/caldavd 2015-03-29 04:58:16 UTC (rev 14631)
+++ CalendarServer/trunk/bin/caldavd 2015-03-29 05:57:59 UTC (rev 14632)
@@ -25,7 +25,7 @@
username="";
groupname="";
configfile="";
-twistdpath="$(type -p twistd)";
+twistdpath="$(command -v twistd)";
plugin_name="caldav";
service_type="";
profile="";
@@ -47,7 +47,7 @@
if ! type "${python}" > /dev/null 2>&1; then return 1; fi;
local py_version="$(py_version "${python}")";
- if [ "${py_version/./}" -lt "24" ]; then return 1; fi;
+ if [ $(echo ${py_version} | tr -d .) -lt "24" ]; then return 1; fi;
return 0;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150328/97fcce10/attachment-0001.html>
More information about the calendarserver-changes
mailing list