Author: jsmeix Date: Thu Jul 9 14:19:53 2009 New Revision: 57977 URL: http://svn.opensuse.org/viewcvs/yast?rev=57977&view=rev Log: Since CUPS 1.4 'lpstat -r' results true even when scheduler is not running. Therefore we must now grep in its output, see https://bugzilla.novell.com/show_bug.cgi?id=520599 Now using $LPSTAT -h $SERVERNAME -r | grep -q 'scheduler is not running' in tools/autodetect_print_queues tools/determine_printer_driver_options tools/autodetect_printers tools/create_printer_ppd_database and /usr/bin/lpstat -h localhost -r | grep -q 'scheduler is running' in src/Printerlib.ycp Modified: trunk/printer/src/Printerlib.ycp trunk/printer/tools/autodetect_print_queues trunk/printer/tools/autodetect_printers trunk/printer/tools/create_printer_ppd_database trunk/printer/tools/determine_printer_driver_options Modified: trunk/printer/src/Printerlib.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/Printerlib.ycp?rev=57977&r1=57976&r2=57977&view=diff ============================================================================== --- trunk/printer/src/Printerlib.ycp (original) +++ trunk/printer/src/Printerlib.ycp Thu Jul 9 14:19:53 2009 @@ -241,8 +241,10 @@ global boolean GetAndSetCupsdStatus( string new_status ) { // Determine whether or not a local cupsd is accessible. // The value 'false' is also the right one when the command itself fails - // (e.g. when there is no /usr/bin/lpstat binary or whatever broken stuff): - string local_cupsd_accessible_commandline = "/usr/bin/lpstat -h localhost -r"; + // (e.g. when there is no /usr/bin/lpstat binary or whatever broken stuff). + // Since CUPS 1.4 'lpstat -r' results true even when scheduler is not running. + // Therefore we must now grep in its output: + string local_cupsd_accessible_commandline = "/usr/bin/lpstat -h localhost -r | grep -q 'scheduler is running'"; local_cupsd_accessible = ExecuteBashCommand( local_cupsd_accessible_commandline ); // Start cupsd: if( "start" == new_status ) Modified: trunk/printer/tools/autodetect_print_queues URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/tools/autodetect_print_queues?rev=57977&r1=57976&r2=57977&view=diff ============================================================================== --- trunk/printer/tools/autodetect_print_queues (original) +++ trunk/printer/tools/autodetect_print_queues Thu Jul 9 14:19:53 2009 @@ -38,7 +38,9 @@ if test -z "$SERVERNAME" then SERVERNAME="localhost" fi -if ! $LPSTAT -h $SERVERNAME -r &>/dev/null +# Since CUPS 1.4 'lpstat -r' results true even when scheduler is not running. +# Therefore we must now grep in its output: +if $LPSTAT -h $SERVERNAME -r | grep -q 'scheduler is not running' then echo "Cannot access cupsd on '$SERVERNAME'" 1>&2 exit 2 fi Modified: trunk/printer/tools/autodetect_printers URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/tools/autodetect_printers?rev=57977&r1=57976&r2=57977&view=diff ============================================================================== --- trunk/printer/tools/autodetect_printers (original) +++ trunk/printer/tools/autodetect_printers Thu Jul 9 14:19:53 2009 @@ -36,7 +36,9 @@ # CUPS supports even remote queue setup but this is not supported by YaST. # Therefore explicitely the cupsd on localhost is asked for autodetected printer information. echo 'Testing if cupsd on localhost is accessible...' >>$PROGRESS -if ! $LPSTAT -h localhost -r &>/dev/null +# Since CUPS 1.4 'lpstat -r' results true even when scheduler is not running. +# Therefore we must now grep in its output: +if $LPSTAT -h localhost -r | grep -q 'scheduler is not running' then echo "Cannot access cupsd on localhost" 1>&2 exit 2 fi Modified: trunk/printer/tools/create_printer_ppd_database URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/tools/create_printer_ppd_database?rev=57977&r1=57976&r2=57977&view=diff ============================================================================== --- trunk/printer/tools/create_printer_ppd_database (original) +++ trunk/printer/tools/create_printer_ppd_database Thu Jul 9 14:19:53 2009 @@ -36,7 +36,9 @@ # CUPS supports even remote queue setup but this is not supported by YaST. # Therefore explicitely the cupsd on localhost is asked for printer driver information. echo 'Testing if cupsd on localhost is accessible...' >>$PROGRESS -if ! $LPSTAT -h localhost -r &>/dev/null +# Since CUPS 1.4 'lpstat -r' results true even when scheduler is not running. +# Therefore we must now grep in its output: +if $LPSTAT -h localhost -r | grep -q 'scheduler is not running' then echo "Cannot access cupsd on localhost" 1>&2 exit 2 fi Modified: trunk/printer/tools/determine_printer_driver_options URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/tools/determine_printer_driver_options?rev=57977&r1=57976&r2=57977&view=diff ============================================================================== --- trunk/printer/tools/determine_printer_driver_options (original) +++ trunk/printer/tools/determine_printer_driver_options Thu Jul 9 14:19:53 2009 @@ -34,7 +34,9 @@ # Only on localhost print queue settings should be changed. # CUPS supports to modify even remote queues but this is not supported by YaST. # Therefore explicitely the cupsd on localhost is asked for printer driver options. -if ! $LPSTAT -h localhost -r &>/dev/null +# Since CUPS 1.4 'lpstat -r' results true even when scheduler is not running. +# Therefore we must now grep in its output: +if $LPSTAT -h localhost -r | grep -q 'scheduler is not running' then echo "Cannot access cupsd on localhost" 1>&2 exit 2 fi -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org