]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - tools/testosx
Load cups into easysw/current.
[thirdparty/cups.git] / tools / testosx
index 8f0be27101e4e200856513f39e822150d316385d..550a4ae3cd9551cc62a7527a67dca08567db1d8c 100755 (executable)
@@ -3,7 +3,15 @@
 if test ! -f tools/testosx; then
        echo "Run this script from the top-level CUPS source directory, e.g.:"
        echo ""
-       echo "    tools/testosx [version]"
+       echo "    sudo tools/testosx [version]"
+       echo ""
+       exit 1
+fi
+
+if test `whoami` != root; then
+       echo "Run this script with sudo, e.g.:"
+       echo ""
+       echo "    sudo tools/testosx [version]"
        echo ""
        exit 1
 fi
@@ -37,11 +45,12 @@ cp packaging/installer.tif $pkgdir/Resources/background.tif
 if test -x /bin/launchctl; then
        cat >$pkgdir/Resources/preflight <<EOF
 #!/bin/sh
-# Tell launchd to reload cupsd...
-launchctl stop org.cups.cups-lpd || exit 0
-launchctl stop org.cups.cupsd || exit 0
-launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist || exit 0
-launchctl unload /System/Library/LaunchDaemons/org.cups.cups-lpd.plist || exit 0
+# Tell launchd to stop cupsd...
+if test "x`whoami`" = xroot; then
+       sudo launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist || exit 0
+       sudo launchctl unload /System/Library/LaunchDaemons/org.cups.cups-lpd.plist || exit 0
+fi
+killall cupsd || exit 0
 EOF
 else
        cat >$pkgdir/Resources/preflight <<EOF
@@ -61,9 +70,10 @@ if test -x /bin/launchctl; then
 rm -f /etc/xinetd.d/cups-lpd
 
 # Tell launchd to reload cupsd...
-launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist
-launchctl load /System/Library/LaunchDaemons/org.cups.cupsd-lpd.plist || exit 0
-launchctl start org.cups.cupsd
+if test "x`whoami`" = xroot; then
+       sudo launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist
+       sudo launchctl load /System/Library/LaunchDaemons/org.cups.cupsd-lpd.plist || exit 0
+fi
 EOF
 else
        cat >$pkgdir/Resources/postflight <<EOF
@@ -76,6 +86,13 @@ fi
 
 chmod 755 $pkgdir/Resources/postflight
 
+case `uname -r` in
+       8.* | 9.*)
+               cp packaging/InstallationCheck $pkgdir/Resources
+               chmod 755 $pkgdir/Resources/InstallationCheck
+               ;;
+esac
+
 # Tag the current revision in the plist and web interface files...
 for file in packaging/cups-desc.plist packaging/cups-info.plist \
                doc/index.html doc/ja/index.html templates/header.tmpl; do