From: Andrea M. <debian@Tonelli.sns.it> - 2002-04-14 09:38:23
|
these patches have a bug: this printtool deletes master-filter I am testing the new one (it is debian as versione 4.5-7) this version works with LPRNG a. On Wed, Apr 03, 2002 at 05:28:22PM +0200, debian wrote: > > hi > > I know that you plan not to include printtool in future releases of > gnulpr; still, you may be interested in (some of) these patches > > a. > > -- > Andrea Mennucc > "E' un mondo difficile. Che vita intensa!" (Renato Carotone) > --- printtool-4.5.orig/printtool.in > +++ printtool-4.5/printtool.in > @@ -5,7 +5,7 @@ > # (C) Copyright 1995 by Michael Callahan > # Version 3.0 additions made by Michael Fulbright (Red Hat Software) > # Smb printing support supplied by Miquel de Icaza > -# NCP printing support supplied by Fernando Lozano, BL Informática Ltda. > +# NCP printing support supplied by Fernando Lozano, BL Informática Ltda. > # uniprint support supplied by Osamu Aoki, Cupertino, USA > # Direct to port support supplied by Josh Buysse, University of Minnesota > > @@ -30,7 +30,10 @@ > set warn_samba 1 > set warn_ncpfs 1 > > -catch {source $env(CONTROL_PANEL_LIB_DIR)/printtool.warn} > +## A.M. : scripts should not write in /usr/source > +#catch {source $env(CONTROL_PANEL_LIB_DIR)/printtool.warn} > +catch {source @localstatedir@/printtool.warn} > +# > > ######################################################### > ## @@ Random Data > @@ -136,9 +139,26 @@ > # > > set filtersrcdir "@prefix@/share/printfilters" > -set libexecdir "@prefix@/libexec" > set sbindir "@prefix@/sbin" > > +if {[catch {set fd [open "@prefix@/libexec/master-filter" r]}] == 0} { > + set libexecdir "@prefix@/libexec" > +} else { > + if {[catch {set fd [open "@prefix@/lib/printfilters/master-filter" r]}] == 0} { > + # we're in an FHS-compliant system, like Debian > + set libexecdir "@prefix@/lib/printfilters" > + } else { > + rhs_info_dialog "Could not find master-filter, either in > +@prefix@/lib/printfilters/ or in @prefix@/libexec/. > +Make sure that the printfilters package (by gnulpr) is > +properly installed." > + exit > + }} > + > + > + > + > + > # > # The location of PPD files > # > @@ -1267,7 +1287,9 @@ > set i_filter [printcap_field $i "if=" ""] > if {$i_filter == $auto_flag} { > set spool_dir [printcap_field $i "sd=" ""] > - set i_filter "$spool_dir/filter" > +#A. Mennucci: NO! lprng changes the permissions of every file in the spool dir > +# set i_filter "$spool_dir/filter" > + set i_filter "$libexecdir/master-filter" > set_printcap_field $i "if=" $i_filter > catch {exec rm -f $i_filter} > # > @@ -1279,7 +1301,9 @@ > > # first put a link to the master filter into place > # > - catch {exec ln -s "$libexecdir/master-filter" $i_filter} > + > +#A. Mennucci: NO! lprng changes the permissions of every file in the spool dir > +# catch {exec ln -s "$libexecdir/master-filter" $i_filter} > > # > # create the appropriate queue specific fpi config files > @@ -1746,7 +1770,9 @@ > # check to make sure the upp file exists > set fname [ format "%s.upp" [lindex $x 0] ] > > - if { ([ glob -nocomplain "/usr/share/ghostscript/*/$fname" ] != "") || ([ glob -nocomplain "/usr/lib/ghostscript/*/$fname" ] != "") } { > + #A.M.: for newer gs; thanks Osamu Aoki > +# if { ([ glob -nocomplain "/usr/share/ghostscript/*/$fname" ] != "") || ([ glob -nocomplain "/usr/lib/ghostscript/*/$fname" ] != "") } > + if { ([ glob -nocomplain "/usr/share/ghostscript/*/$fname" ] != "") || ([ glob -nocomplain "/usr/lib/ghostscript/*/$fname" ] != "") || ([ glob -nocomplain "/usr/share/gs/*/$fname" ] != "")} { > set g [format "%8s, %-30s" [lindex $x 0] [lindex $x 1]] > $color insert end $g > } > @@ -2448,6 +2474,14 @@ > # pack $w.l6 -pady 3 -side top -fill x -in $w.f1 > # pack $w.v5 $w.v6 -side top -expand true -fill x -in $w.f2 > > +#A. Mennucc: http://lpr.sourceforge.net/caveats.html > + if { [is_lprng_spooler] } { > + label $w.lw -text "warning: REMOTE printing does not work with LPRNG : > + read /usr/share/doc/printtool/caveats.html or > + http://lpr.sourceforge.net/caveats.html" -anchor w > + pack $w.lw -side top -fill x -in $w.f1 > + } > + > pack $w.l5 -side left -anchor w -fill x -in $w.rhost > pack $w.v5 -side right -anchor e -fill x -in $w.rhost > pack $w.l6 -side left -anchor w -fill x -in $w.rqueue > @@ -2664,7 +2698,9 @@ > frame $w.smbpasswd > frame $w.smbworkgroup > > - label $w.l5 -text "Hostname of Printer Server" -anchor w > +#see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=89099&repeatmerged=yes > + label $w.l5 -text "Samba name of Printer Server" -anchor w > + #label $w.l5 -text "Hostname of Printer Server" -anchor w > entry $w.v5 -font fixed -relief sunken -borderwidth 2 > $w.v5 insert 0 [lindex $config 0] > > @@ -3665,7 +3701,12 @@ > } > > proc menu_restart_lpd {} { > - if {[file executable "/etc/rc.d/init.d/lprng"] == 1} { > + #A.M. : first and foremost: check for lpr-ppd and lprng daemon > + if {[file executable "/etc/init.d/lpd-ppd"] == 1} { > + catch {exec /etc/init.d/lpd-ppd restart} > + } elseif {[file executable "/etc/init.d/lpd"] == 1} { > + catch {exec /etc/init.d/lpd restart} > + } elseif {[file executable "/etc/rc.d/init.d/lprng"] == 1} { > # Imperfect check for lprng. > catch {exec /etc/rc.d/init.d/lprng restart} > } elseif {[file executable "/etc/init.d/lpr"] == 1} { > @@ -3936,10 +3977,14 @@ > if { $warn_ncpfs != 0 } { > find_nprint > } > -set fd [ open $env(CONTROL_PANEL_LIB_DIR)/printtool.warn w ] > -puts $fd "set warn_samba $warn_samba" > -puts $fd "set warn_ncpfs $warn_ncpfs" > -close $fd > +## A.M. : scripts should not write in /usr/source > +#set fd [ open $env(CONTROL_PANEL_LIB_DIR)/printtool.warn w ] > +catch { > + set fd [ open @localstatedir@/printtool.warn w ] > + puts $fd "set warn_samba $warn_samba" > + puts $fd "set warn_ncpfs $warn_ncpfs" > + close $fd > +} > write_printcap > # If this is an LPRng system, run checkpc to > # take care of spool directory issues. > @@ -4025,23 +4070,25 @@ > #---------------------------------------------------- > set lprng_found 0 > > - # Check output of "rpm -q LPRng". > - if [catch {open "| rpm -q LPRng"} input] { > - return $lprng_found > - } > +#A Mennucc: not everyone is using rpm :-) > + if {[file executable "/bin/rpm"]} { > + # Check output of "rpm -q LPRng". > + if [catch {open "| rpm -q LPRng"} input] { > + return $lprng_found > + } > > - # Look at output to look for string "not installed" > - if {[gets $input line] >= 0} { > - if {[string first "not installed" $line] == -1} { > - set lprng_found 1 > + # Look at output to look for string "not installed" > + if {[gets $input line] >= 0} { > + if {[string first "not installed" $line] == -1} { > + set lprng_found 1 > + } > } > + catch {close $input} > } > - catch {close $input} > - > if {[file executable "/etc/rc.d/init.d/lprng"] == 1} { > # Imperfect check for lprng. > set lprng_found 1 > - } elseif {[file executable "/etc/init.d/lpr"] == 1} { > + } elseif {[file executable "/etc/init.d/lprng"] == 1} { > # This is a check for debian running lprng. > set lprng_found 1 > } elseif {[file executable "/usr/sbin/checkpc"] == 1} { > @@ -4220,7 +4267,9 @@ > "The detected printer may not work > correctly with your print spooler (lprng). > If you encounter printing problems, > -consider setup as a DIRECT printer." > +consider setup as a DIRECT printer. > +Read /usr/share/doc/printtool/caveats.html or > + http://lpr.sourceforge.net/caveats.html" > } > > } elseif {$detect_type == "DIRECT"} { > @@ -4377,29 +4426,23 @@ > # of setup-method radio buttons: > #------------------------------------------------ > > - list packed > + #list packed > set i 1 > set methlist {"NONE" "REMOTE" "DIRECT"} > set setmeth [lindex $methlist 1] > > - catch { > - radiobutton .winFound.fra23.rad$i \ > - -justify left -text "Setup as REMOTE printer" \ > - -variable setmeth -value [lindex $methlist $i] > + #A. Mennucc: cosmetic rewrite: I hope to show both radiobuttons! > + foreach i { 2 1 } { > + set lp [lindex $methlist $i] > + catch { radiobutton .winFound.fra23.rad$i \ > + -justify left -text "Setup as $lp printer" \ > + -variable setmeth -value "$lp" > + } > + pack .winFound.fra23.rad$i -padx 0 -pady 0 \ > + -anchor center -expand 1 -fill x -in .winFound.fra23 > + #-side top > + lappend packed .winFound.fra23.rad$i > } > - pack .winFound.fra23.rad$i \ > - -in .winFound.fra23 -anchor center -expand 1 -fill x -side top > - lappend packed .winFound.fra23.rad$i > - > - incr i > - catch { > - radiobutton .winFound.fra23.rad$i \ > - -justify left -text "Setup as DIRECT printer" \ > - -variable setmeth -value [lindex $methlist $i] > - } > - pack .winFound.fra23.rad$i \ > - -in .winFound.fra23 -anchor center -expand 1 -fill x -side top > - lappend packed .winFound.fra23.rad$i > > #------------------------------------------------ > # fill the list box with detected printers > @@ -4848,7 +4891,8 @@ > ################### > toplevel $base -class Toplevel > wm focusmodel $base passive > - wm geometry $base 288x326 > + #A.Mennucc : window was too small > + wm geometry $base 288x426 > wm maxsize $base 1009 738 > wm minsize $base 1 1 > wm overrideredirect $base 0 > @@ -4874,8 +4918,10 @@ > -command button_autodetect_add -padx 9 -pady 3 -text {Add Printer} > button $base.fra19.but21 \ > -command winFound_hide -padx 9 -pady 3 -text Cancel > - frame $base.fra23 \ > - -borderwidth 2 -height 126 -relief raised -width 125 > + #A.Mennucc: height is completely ignored... why? and then the radiobuttons > + # do not show correctly!! > + frame $base.fra23 -background #000000 \ > + -borderwidth 2 -height 1226 -relief raised -width 125 > ################### > # SETTING GEOMETRY > ################### > @@ -4904,7 +4950,7 @@ > -in .winFound.fra19 -anchor center -expand 0 -fill none -ipadx 5 \ > -padx 3 -side right > pack $base.fra23 \ > - -in .winFound -anchor center -expand 0 -fill x -side top > + -in .winFound -anchor center -expand 1 -fill x -side top > } -- Andrea Mennucc "E' un mondo difficile. Che vita intensa!" (Renato Carotone) |