[yast-commit] r68109 - in /trunk/printer: src/Printer.ycp src/driveradd.ycp tools/create_printer_ppd_database
Author: jsmeix Date: Wed May 9 11:29:34 2012 New Revision: 68109 URL: http://svn.opensuse.org/viewcvs/yast?rev=68109&view=rev Log: Fixed Bug 726316: Adapt it for "hplip-sane" Enhanced progress in tools/create_printer_ppd_database and adapted expected progress file size in src/Printer.ycp Modified: trunk/printer/src/Printer.ycp trunk/printer/src/driveradd.ycp trunk/printer/tools/create_printer_ppd_database Modified: trunk/printer/src/Printer.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/Printer.ycp?rev=68109&r1=68108&r2=68109&view=diff ============================================================================== --- trunk/printer/src/Printer.ycp (original) +++ trunk/printer/src/Printer.ycp Wed May 9 11:29:34 2012 @@ -388,10 +388,10 @@ `DownloadProgress( // Header of a DownloadProgress indicator: _("Retrieving printer driver information..."), create_database_progress_filename, - // On my openSUSE 11.4 the size is about 110000 bytes. - // The number 122880 results exactly "120.0 KB" in the + // On my openSUSE 11.4 the size is about 80000 bytes. + // The number 102400 results exactly "100.0 KB" in the // YaST Gtk user inteface for a DownloadProgress: - 122880 + 102400 ) ) ) Modified: trunk/printer/src/driveradd.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/driveradd.ycp?rev=68109&r1=68108&r2=68109&view=diff ============================================================================== --- trunk/printer/src/driveradd.ycp (original) +++ trunk/printer/src/driveradd.ycp Wed May 9 11:29:34 2012 @@ -50,7 +50,7 @@ boolean OpenPrintingPPDs_hpijs_installed = Printerlib::TestAndInstallPackage( "OpenPrintingPPDs-hpijs", "installed" ); boolean OpenPrintingPPDs_postscript_installed = Printerlib::TestAndInstallPackage( "OpenPrintingPPDs-postscript", "installed" ); boolean gutenprint_installed = Printerlib::TestAndInstallPackage( "gutenprint", "installed" ); - boolean hplip_installed = Printerlib::TestAndInstallPackage( "hplip", "installed" ); + boolean hplip_installed = Printerlib::TestAndInstallPackage( "hplip-hpijs", "installed" ); boolean manufacturer_PPDs_installed = Printerlib::TestAndInstallPackage( "manufacturer-PPDs", "installed" ); boolean splix_installed = Printerlib::TestAndInstallPackage( "splix", "installed" ) || Printerlib::TestAndInstallPackage( "cups-drivers-splix", "installed" ); @@ -418,14 +418,42 @@ } } else - { if( Printerlib::TestAndInstallPackage( "hplip", "remove" ) ) - { package_changed = true; - // The user is free to decide to keep hplip-hpijs installed - // because hplip-hpijs contains only the hpijs binary and required libraries - // but all the rest (in particular the PPDs and the hp backend) is in hplip - // so that after hplip was removed neither a "hp:/" DeviceURI is autodetected - // nor a hplip/hpijs driver description exists. - Printerlib::TestAndInstallPackage( "hplip-hpijs", "remove" ); + { // HPLIP should be removed: + // Removing HPLIP means to remove the packages hplip, hplip-sane, and hplip-hpijs where + // hplip must be removed first, then hplip-sane and finally hplip-hpijs because + // hplip-hpijs is needed by hplip and hplip-sane and hplip-sane is needed by hplip. + // Since openSUSE 12.1 the HPLIP SANE driver (libsane-hpaio.* files) + // is split from the hplip package into a separated subpackage hplip-sane, + // see https://bugzilla.novell.com/show_bug.cgi?id=723870 + // and https://bugzilla.novell.com/show_bug.cgi?id=726316 + if( Printerlib::TestAndInstallPackage( "hplip", "installed" ) ) + { // In TestAndInstallPackage there is a confirmation popup before a package + // is actually removed so that the user is free to decide to keep hplip installed: + if( Printerlib::TestAndInstallPackage( "hplip", "remove" ) ) + { package_changed = true; + } + } + // Only if there is no package hplip installed (regardless if it was removed right now + // or if it was not installed all the time) it makes sense to remove hplip-sane. + if( ! Printerlib::TestAndInstallPackage( "hplip", "installed" ) ) + { if( Printerlib::TestAndInstallPackage( "hplip-sane", "installed" ) ) + { // In TestAndInstallPackage there is a confirmation popup before a package + // is actually removed so that the user is free to decide to keep hplip-sane installed: + if( Printerlib::TestAndInstallPackage( "hplip-sane", "remove" ) ) + { package_changed = true; + } + } + // Only if there is no package hplip-sane installed (regardless if it was removed right now + // or if it was not installed all the time) it makes sense to remove hplip-hpijs: + if( ! Printerlib::TestAndInstallPackage( "hplip-sane", "installed" ) ) + { // When hplip_installed is true it means hplip-hpijs is installed + // so that a test if hplip-hpijs is installed is not needed here. + // In TestAndInstallPackage there is a confirmation popup before a package + // is actually removed so that the user is free to decide to keep hplip-hpijs installed: + if( Printerlib::TestAndInstallPackage( "hplip-hpijs", "remove" ) ) + { package_changed = true; + } + } } } } Modified: trunk/printer/tools/create_printer_ppd_database URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/tools/create_printer_ppd_database?rev=68109&r1=68108&r2=68109&view=diff ============================================================================== --- trunk/printer/tools/create_printer_ppd_database (original) +++ trunk/printer/tools/create_printer_ppd_database Wed May 9 11:29:34 2012 @@ -21,8 +21,16 @@ TMP_DATA=$(mktemp -u /tmp/$MY_NAME.XXXXXX) TMP_DATA_RAW=$(mktemp -u /tmp/$MY_NAME.XXXXXX) +echo 'This file is used as progress indicator for DownloadProgress in Printer.ycp' >$PROGRESS +# Provide some amount of dummy content in the progress file so that the +# the DownloadProgress bar in YaST initially shows a first bit of progress +# to initially show to the user that something is actually going on: +for i in $( seq 10 ) +do echo 'Dummy content so that DownloadProgress in YaST initially shows a first bit of progress' >>$PROGRESS +done + # Test if lpstat and lpinfo are executable: -echo 'Testing if lpstat and lpinfo are executable...' >$PROGRESS +echo 'Testing if lpstat and lpinfo are executable...' >>$PROGRESS LPSTAT="$( type -P lpstat )" if ! test -x "$LPSTAT" then echo "Cannot execute lpstat" 1>&2 @@ -64,7 +72,9 @@ for i in $( seq $MAXIMUM_WAIT ) do ps $lpinfoPID &>/dev/null || break echo "Waiting for response from $LPINFO (PID $lpinfoPID)..." >>$PROGRESS - sleep 1 + # Sleep only 1/10 of a second to make the "waiting for lpinfo" part sufficiently big + # in the progress file to be really visible in the DownloadProgress bar in YaST: + usleep 100 done if ps $lpinfoPID &>/dev/null then kill -9 $lpinfoPID &>/dev/null @@ -93,16 +103,14 @@ echo "[" # Function to output one entry. -# Limit what is written to the PROGRESS file here to 8 characters per PPD. -# Otherwise the PROGRESS file would grow up to more than 300000 bytes here +# Limit what is written to the PROGRESS file here to 4 characters per PPD. +# Otherwise the PROGRESS file would grow up too much here # which would make the above "waiting for lpinfo" part too small # to be really visible in the DownloadProgress bar in YaST. -# With the limited output here the PROGRESS file grows to about 80000 bytes -# for the about 8000 PPDs which are installed by default in openSUSE 11.0: Output() { if [ -n "$PPD" -a -n "$NICKNAME" ] then echo -e " \$[ \"ppd\":\"$PPD\",\n \"nickname\":\"$NICKNAME\",\n \"deviceID\":\"$ID\",\n \"language\":\"$LANGUAGE\",\n \"manufacturer\":\"$MANUFACTURER\",\n \"modelname\":\"$MODELNAME\"\n ]," - echo "$NICKNAME" | cut -b-8 >>$PROGRESS + echo "$NICKNAME" | cut -b-4 >>$PROGRESS fi } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsmeix@svn2.opensuse.org