[CalendarServer-changes] [7038] CalendarServer/trunk/support/build.sh

source_changes at macosforge.org source_changes at macosforge.org
Thu Feb 17 14:25:44 PST 2011


Revision: 7038
          http://trac.macosforge.org/projects/calendarserver/changeset/7038
Author:   wsanchez at apple.com
Date:     2011-02-17 14:25:42 -0800 (Thu, 17 Feb 2011)
Log Message:
-----------
cleanup

Modified Paths:
--------------
    CalendarServer/trunk/support/build.sh

Modified: CalendarServer/trunk/support/build.sh
===================================================================
--- CalendarServer/trunk/support/build.sh	2011-02-17 22:18:51 UTC (rev 7037)
+++ CalendarServer/trunk/support/build.sh	2011-02-17 22:25:42 UTC (rev 7038)
@@ -181,7 +181,8 @@
     if [ -n "${cache_deps}" ] && [ -n "${hash}" ]; then
       mkdir -p "${cache_deps}";
 
-      cache_file="${cache_deps}/${name}-$(echo "${url}" | hash)-$(basename "${url}")";
+      local cache_basename="$(echo "${url}" | hash)-$(basename "${url}")";
+      local cache_file="${cache_deps}/${name}-${cache_basename}";
 
       check_hash () {
         local file="$1"; shift;
@@ -203,11 +204,14 @@
       if [ ! -f "${cache_file}" ]; then
         echo "Downloading ${name}...";
 
+        local pkg_host="static.calendarserver.org";
+        local pkg_path="/pkg";
+
         #
         # Try getting a copy from calendarserver.org.
         #
-        local tmp="$(mktemp -t cache)";
-        curl -L "http://static.calendarserver.org/pkg/$(basename "${cache_file}")" -o "${tmp}";
+        local tmp="$(mktemp -t "${cache_basename}")";
+        curl -L "http://${pkg_host}${pkg_path}/${cache_basename}" -o "${tmp}";
         echo "";
         if [ ! -s "${tmp}" ] || grep '<title>404 Not Found</title>' "${tmp}" > /dev/null; then
           rm -f "${tmp}";
@@ -234,10 +238,10 @@
             exit 1;
           fi;
 
-          if egrep '^static.calendarserver.org ' "${HOME}/.ssh/known_hosts" > /dev/null 2>&1; then
-            echo "Copying cache file up to static.calendarserver.org.";
-            if ! scp "${tmp}" "static.calendarserver.org:/www/hosts/static.calendarserver.org/pkg/$(basename "${cache_file}")"; then
-              echo "Failed to copy cache file up to static.calendarserver.org.";
+          if egrep '^${pkg_host} ' "${HOME}/.ssh/known_hosts" > /dev/null 2>&1; then
+            echo "Copying cache file up to ${pkg_host}.";
+            if ! scp "${tmp}" "${pkg_host}:/www/hosts/${pkg_host}${pkg_path}/${cache_basename}"; then
+              echo "Failed to copy cache file up to ${pkg_host}.";
             fi;
             echo ""
           fi;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110217/dc0916c6/attachment.html>


More information about the calendarserver-changes mailing list