[64811] trunk/dports/x11/xinit

jeremyhu at macports.org jeremyhu at macports.org
Mon Mar 15 17:17:19 PDT 2010


Revision: 64811
          http://trac.macports.org/changeset/64811
Author:   jeremyhu at macports.org
Date:     2010-03-15 17:17:16 -0700 (Mon, 15 Mar 2010)
Log Message:
-----------
xinit: Update to 1.2.1

Modified Paths:
--------------
    trunk/dports/x11/xinit/Portfile
    trunk/dports/x11/xinit/files/font_cache.sh

Modified: trunk/dports/x11/xinit/Portfile
===================================================================
--- trunk/dports/x11/xinit/Portfile	2010-03-16 00:01:35 UTC (rev 64810)
+++ trunk/dports/x11/xinit/Portfile	2010-03-16 00:17:16 UTC (rev 64811)
@@ -3,7 +3,7 @@
 PortSystem          1.0
 
 name                xinit
-version             1.2.0
+version             1.2.1
 categories          x11
 platforms           darwin
 maintainers         jeremyhu
@@ -14,9 +14,9 @@
 homepage            http://www.x.org
 master_sites        http://xorg.freedesktop.org/archive/individual/app/
 
-checksums           md5     fe1696cab2fbed6fa059d0cd1c53ac13 \
-                    sha1    85a838c2010f27ef6d09d6ec4b1208a66cc8d697 \
-                    rmd160  c2895db985482c13ef300a037bf2e182aeda1442
+checksums           md5     56f2d202b3dc10fcd21931a67bb270f7 \
+                    sha1    baf36374aa1632054816a8281e55e1539459664b \
+                    rmd160  993b068e4758521ed930bd78069c291b68d88037
 
 use_bzip2	    yes
 use_parallel_build  yes
@@ -42,6 +42,5 @@
 	reinplace "s|@PREFIX@|${prefix}|g" ${destroot}${prefix}/lib/X11/xinit/xinitrc.d/99-quartz-wm.sh
 
 	xinstall -m 755 ${filespath}/font_cache.sh ${destroot}${prefix}/bin/font_cache
-	reinplace "s|^X11DIR=.*$|X11DIR=${prefix}|" ${destroot}${prefix}/bin/font_cache
-	reinplace "s|^X11FONTDIR=.*$|X11FONTDIR=${prefix}/share/fonts|" ${destroot}${prefix}/bin/font_cache
+	reinplace "s|__PREFIX__|${prefix}|" ${destroot}${prefix}/bin/font_cache
 }

Modified: trunk/dports/x11/xinit/files/font_cache.sh
===================================================================
--- trunk/dports/x11/xinit/files/font_cache.sh	2010-03-16 00:01:35 UTC (rev 64810)
+++ trunk/dports/x11/xinit/files/font_cache.sh	2010-03-16 00:17:16 UTC (rev 64811)
@@ -1,33 +1,28 @@
 #!/bin/bash
-# Copyright (c) 2008 Apple Inc.
+# Copyright (c) 2008-2010 Apple Inc. All Rights Reserved.
 #
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this software and associated documentation files
-# (the "Software"), to deal in the Software without restriction,
-# including without limitation the rights to use, copy, modify, merge,
-# publish, distribute, sublicense, and/or sell copies of the Software,
-# and to permit persons to whom the Software is furnished to do so,
-# subject to the following conditions:
+# @APPLE_LICENSE_HEADER_START@
 #
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
+# This file contains Original Code and/or Modifications of Original Code
+# as defined in and that are subject to the Apple Public Source License
+# Version 2.0 (the 'License'). You may not use this file except in
+# compliance with the License. Please obtain a copy of the License at
+# http://www.opensource.apple.com/apsl/ and read it before using this
+# file.
 #
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT.  IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
-# HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
+# The Original Code and all software distributed under the License are
+# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+# Please see the License for the specific language governing rights and
+# limitations under the License.
 #
-# Except as contained in this notice, the name(s) of the above
-# copyright holders shall not be used in advertising or otherwise to
-# promote the sale, use or other dealings in this Software without
-# prior written authorization.
+# @APPLE_LICENSE_HEADER_END@
 
-X11DIR=/usr/X11
-X11FONTDIR=${X11DIR}/lib/X11/fonts
+X11DIR=__PREFIX__
+X11FONTDIR=${X11DIR}/share/fonts
+FC_LOCKFILE=""
 
 # Are we caching system fonts or user fonts?
 system=0
@@ -187,17 +182,15 @@
     IFS=$OIFS
 
     # Finally, update fontconfig's cache
-    if [[ -x ${X11DIR}/bin/fc-cache ]] ; then
-        echo "font_cache: Updating FC cache"
-        if [[ $system == 1 ]] ; then
-            ${X11DIR}/bin/fc-cache -s \
-                $([[ $force == 1 ]] && echo "-f -r") \
-                $([[ $verbose == 1 ]] && echo "-v")
-        else
-            ${X11DIR}/bin/fc-cache \
-                $([[ $force == 1 ]] && echo "-f -r") \
-                $([[ $verbose == 1 ]] && echo "-v")
-        fi
+    echo "font_cache: Updating FC cache"
+    if [[ $system == 1 ]] ; then
+        ${X11DIR}/bin/fc-cache -s \
+            $([[ $force == 1 ]] && echo "-f -r") \
+            $([[ $verbose == 1 ]] && echo "-v")
+    else
+        ${X11DIR}/bin/fc-cache \
+            $([[ $force == 1 ]] && echo "-f -r") \
+            $([[ $verbose == 1 ]] && echo "-v")
     fi
     echo "font_cache: Done"
 }
@@ -211,6 +204,11 @@
     echo "    -v, --verbose      : Verbose Output"
 }
 
+cleanup() {
+    [[ -r "${FC_LOCKFILE}" ]] && rm -f "${FC_LOCKFILE}"
+    exit 1
+}
+
 while [[ $# -gt 0 ]] ; do
     case $1 in
         -s|--system) system=1 ;;
@@ -223,4 +221,52 @@
     shift
 done
 
+if [[ $system == 1 ]] ; then
+    FC_LOCKFILE="${X11DIR}/var/run/font_cache.lock"
+elif [[ -w "${TMPDIR}" ]] ; then
+    FC_LOCKFILE="${TMPDIR}/font_cache.lock"
+elif [[ -w "/tmp" ]] ; then
+    FC_LOCKFILE="/tmp/font_cache.$UID.lock"
+else
+    FC_LOCKFILE="${HOME}/.font_cache.lock"
+fi
+
+if [[ -x /usr/bin/lockfile ]] ; then
+    if /usr/bin/lockfile -r 0 -l 240 -s 4 -! "${FC_LOCKFILE}" ; then
+            echo "font_cache is already running." >&2
+            echo "If you believe this to be erroneous, please remove ${FC_LOCKFILE}." >&2
+            exit 1
+    fi
+else
+    if [[ -r "${FC_LOCKFILE}" ]] ; then
+        read OLD_PID < "${FC_LOCKFILE}"
+        if kill -0 ${OLD_PID} >& /dev/null ; then
+            echo "font_cache is already running with PID ${OLD_PID}." >&2
+            echo "If you believe this to be erroneous, please remove ${FC_LOCKFILE}." >&2
+            exit 1
+        fi
+
+        echo "Removing stale ${FC_LOCKFILE}" >&2
+        rm -f "${FC_LOCKFILE}"
+    fi
+
+    echo $$ > "${FC_LOCKFILE}"
+
+    if [[ ! -r "${FC_LOCKFILE}" ]] ; then
+        echo "Unable to write to ${FC_LOCKFILE}." >&2
+        exit 1
+    fi
+
+    # Now make sure we didn't collide mid-air
+    read OLD_PID < "${FC_LOCKFILE}"
+    if [[ $$ != ${OLD_PID} ]] ; then
+        echo "font_cache is already running with PID ${OLD_PID}." >&2
+        exit 1
+    fi
+fi
+
+trap cleanup SIGINT SIGQUIT SIGABRT SIGTERM
+
 setup_fontdirs
+
+rm -f "${FC_LOCKFILE}"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100315/97908150/attachment.html>


More information about the macports-changes mailing list