diff options
Diffstat (limited to 'usr.sbin/pkg_install/tkpkg')
| -rwxr-xr-x | usr.sbin/pkg_install/tkpkg | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/usr.sbin/pkg_install/tkpkg b/usr.sbin/pkg_install/tkpkg index c4c9273be241..5a3e500ae776 100755 --- a/usr.sbin/pkg_install/tkpkg +++ b/usr.sbin/pkg_install/tkpkg @@ -1,7 +1,10 @@ #!/usr/local/bin/wish -f -#$Id: pkg,v 1.1 1993/09/04 17:06:09 jkh Exp $ +#$Id: tkpkg,v 1.1 1994/01/06 08:16:20 jkh Exp $ +# +#$Log: tkpkg,v $ +# Revision 1.1 1994/01/06 08:16:20 jkh +# Cleaning house. # -#$Log: pkg,v $ # Revision 1.1 1993/09/04 17:06:09 jkh # Added Rich's wish front-end. # @@ -41,7 +44,7 @@ text .f.t -width 80 -height 20 -yscrollcommand ".f.s set" -relief sunken # instructions and show the package description when the user clicks # on a package. # -.f.t insert end "Double click on a package above to see it's +.f.t insert end "Double click on a package above to see its complete description here." scrollbar .f.s -relief sunken -command ".f.t yview" pack append .f .f.s {right filly} .f.t {left expand fill} @@ -64,7 +67,7 @@ button .menu.installed -text "What is Installed?" \ button .menu.available -text "What can I install?" \ -command "list_pkgs \"pkg_info -I -c [glob -nocomplain *.{tgz,tar.z,tar.gz,tar.Z}] |tr ' ' ' '\"" button .menu.cont -text "Contents?" \ - -command "global pkgname; apply_to_pkg \"pkg_info -d -v |tr -d ''\"" + -command "apply_to_pkg \"pkg_info -d -v\"" button .menu.quit -text "Quit" -command "destroy ." button .menu.help -text "Help" -command "do_help" @@ -81,7 +84,7 @@ pack append .menu \ #------------------------------------------------------- proc list_pkgs {s} { set line "" - set f [eval "open {| csh -c \"$s\" } r"] + set f [eval "open {| sh -c \"$s\" } r"] .frame.list delete 0 end while {[gets $f line] > 0} { .frame.list insert end $line @@ -91,7 +94,7 @@ proc list_pkgs {s} { # display the list of available packages set archives [glob -nocomplain *.{tgz,tar.z,tar.gz,tar.Z}] -if {$pkgname == ""} { +if {$archives == ""} { .frame.list delete 0 end .frame.list insert end "Warning: no compressed tar archives files found." } else { @@ -122,25 +125,34 @@ proc do_help {{w .help}} { wm iconname $w "Help" button $w.ok -text OK -command "destroy $w" message $w.t -relief raised -bd 2 \ - -text "You can install, deinstall and list info on the available packages. To select a package and see it's complete description, press mouse button 1 over the package name. To install a selected package, press the Install button. To exit, press the \"Quit\" button." + -text "You can install, deinstall and list info on the available packages. To select a package and see its complete description, press mouse button 1 over the package name. To install a selected package, press the Install button. To exit, press the \"Quit\" button." pack append $w $w.ok {bottom fillx} $w.t {expand fill} } #------------------------------------------------------- # Apply a command to a package. #------------------------------------------------------- proc apply_to_pkg {s} { + apply_to_pkg_err $s "" +} +#------------------------------------------------------- +# Apply a command to a package, with error stream redirection instructions. +#------------------------------------------------------- +proc apply_to_pkg_err {s errredir} { global pkgname .f.t delete 0.0 end if {$pkgname == ""} { .f.t insert end "You must double click on a package name first!" } else { + apply_to_pkg_int "$s $pkgname" "2>&1" + } +} +proc apply_to_pkg_int {s errredir} { .f.t delete 0.0 end - .f.t insert end "Running: $s $pkgname\n" - set f [eval "open {| $s $pkgname} r"] + .f.t insert end "Running: $s\n" + set f [eval "open {| sh -c \"$s $errredir\" } r"] while {![eof $f]} { .f.t insert end [read $f 64] } - } } #------------------------------------------------------- # Invoke an arbitrary command. |
