]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - test/waitjobs.sh
Stub out the PS and PCL print commands for ippeveprinter.
[thirdparty/cups.git] / test / waitjobs.sh
index d69e44080fc0f5fa2135a2691a918d5f519cf359..6e20e3caf1e3aba67129dd34e10cfadb52f66da7 100755 (executable)
@@ -1,37 +1,51 @@
 #!/bin/sh
 #
-# "$Id$"
-#
 # Script to wait for jobs to complete.
 #
-#   Copyright 2008 by Apple Inc.
+# Copyright © 2008-2009 by Apple Inc.
 #
-#   These coded instructions, statements, and computer programs are the
-#   property of Apple Inc. and are protected by Federal copyright
-#   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-#   which should have been included with this file.  If this file is
-#   file is missing or damaged, see the license at "http://www.cups.org/".
+# Licensed under Apache License v2.0.  See the file "LICENSE" for more
+# information.
 #
 
+#
 # Get timeout from command-line
+#
+
 if test $# = 1; then
        timeout=$1
 else
-       timeout=60
+       timeout=360
+fi
+
+#
+# Figure out the proper echo options...
+#
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+        ac_n=-n
+        ac_c=
+else
+        ac_n=
+        ac_c='\c'
 fi
 
-echo "Waiting for jobs to complete..."
+echo $ac_n "Waiting for jobs to complete...$ac_c"
+oldjobs=0
 
 while test $timeout -gt 0; do
-       jobs=`../systemv/lpstat 2>/dev/null`
-       if test "x$jobs" = "x"; then
+       jobs=`$runcups ../systemv/lpstat 2>/dev/null | wc -l | tr -d ' '`
+       if test $jobs = 0; then
                break
        fi
 
+       if test $jobs != $oldjobs; then
+               echo $ac_n "$jobs...$ac_c"
+               oldjobs=$jobs
+       fi
+
        sleep 5
        timeout=`expr $timeout - 5`
 done
 
-#
-# End of "$Id$".
-#
+echo ""