[BACK]Return to tkpkg CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / pkgtools / pkg_install / files

File: [cvs.NetBSD.org] / pkgsrc / pkgtools / pkg_install / files / tkpkg (download)

Revision 1.1.1.1 (vendor branch), Fri Dec 20 18:13:52 2002 UTC (17 years, 6 months ago) by schmonz
Branch: TNF, MAIN
CVS Tags: pkgsrc-base, pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-2016Q2-base, pkgsrc-2016Q2, pkgsrc-2016Q1-base, pkgsrc-2016Q1, pkgsrc-2015Q4-base, pkgsrc-2015Q4, pkgsrc-2015Q3-base, pkgsrc-2015Q3, pkgsrc-2015Q2-base, pkgsrc-2015Q2, pkgsrc-2015Q1-base, pkgsrc-2015Q1, pkgsrc-2014Q4-base, pkgsrc-2014Q4, pkgsrc-2014Q3-base, pkgsrc-2014Q3, pkgsrc-2014Q2-base, pkgsrc-2014Q2, pkgsrc-2014Q1-base, pkgsrc-2014Q1, pkgsrc-2013Q4-base, pkgsrc-2013Q4, pkgsrc-2013Q3-base, pkgsrc-2013Q3, pkgsrc-2013Q2-base, pkgsrc-2013Q2, pkgsrc-2013Q1-base, pkgsrc-2013Q1, pkgsrc-2012Q4-base, pkgsrc-2012Q4, pkgsrc-2012Q3-base, pkgsrc-2012Q3, pkgsrc-2012Q2-base, pkgsrc-2012Q2, pkgsrc-2012Q1-base, pkgsrc-2012Q1, pkgsrc-2011Q4-base, pkgsrc-2011Q4, pkgsrc-2011Q3-base, pkgsrc-2011Q3, pkgsrc-2011Q2-base, pkgsrc-2011Q2, pkgsrc-2011Q1-base, pkgsrc-2011Q1, pkgsrc-2010Q4-base, pkgsrc-2010Q4, pkgsrc-2010Q3-base, pkgsrc-2010Q3, pkgsrc-2010Q2-base, pkgsrc-2010Q2, pkgsrc-2010Q1-base, pkgsrc-2010Q1, pkgsrc-2009Q4-base, pkgsrc-2009Q4, pkgsrc-2009Q3-base, pkgsrc-2009Q3, pkgsrc-2009Q2-base, pkgsrc-2009Q2, pkgsrc-2009Q1-base, pkgsrc-2009Q1, pkgsrc-2008Q4-base, pkgsrc-2008Q4, pkgsrc-2008Q3-base, pkgsrc-2008Q3, pkgsrc-2008Q2-base, pkgsrc-2008Q2, pkgsrc-2008Q1-base, pkgsrc-2008Q1, pkgsrc-2007Q4-base, pkgsrc-2007Q4, pkgsrc-2007Q3-base, pkgsrc-2007Q3, pkgsrc-2007Q2-base, pkgsrc-2007Q2, pkgsrc-2007Q1-base, pkgsrc-2007Q1, pkgsrc-2006Q4-base, pkgsrc-2006Q4, pkgsrc-2006Q3-base, pkgsrc-2006Q3, pkgsrc-2006Q2-base, pkgsrc-2006Q2, pkgsrc-2006Q1-base, pkgsrc-2006Q1, pkgsrc-2005Q4-base, pkgsrc-2005Q4, pkgsrc-2005Q3-base, pkgsrc-2005Q3, pkgsrc-2005Q2-base, pkgsrc-2005Q2, pkgsrc-2005Q1-base, pkgsrc-2005Q1, pkgsrc-2004Q4-base, pkgsrc-2004Q4, pkgsrc-2004Q3-base, pkgsrc-2004Q3, pkgsrc-2004Q2-base, pkgsrc-2004Q2, pkgsrc-2004Q1-base, pkgsrc-2004Q1, pkgsrc-2003Q4-base, pkgsrc-2003Q4, pkg_install-renovation-base, pkg_install-renovation, netbsd-1-6-1-base, netbsd-1-6-1, cwrapper-base, cwrapper, cube-native-xorg-base, cube-native-xorg, HEAD
Changes since 1.1: +0 -0 lines

Import autoconf'd pkg_install source from
othersrc/bootstrap-pkgsrc/pkg_install into ${FILESDIR}.

Using autoconf greatly simplifies maintenance of this package across
multiple platforms. Placing the extracted source under ${FILESDIR}
will eventually let us use the same source for bootstrapping as
well, though we're not ready for this yet.

#!/usr/pkg/bin/wish -f
# from FreeBSD Id: tkpkg,v 1.4 1997/02/22 16:09:13 peter Exp
#
set pkgname ""
wm title . "Package Installation"
#--------------------------------------------------------------
# The top level main window, consisting of a bar of buttons and a list
# of packages and a description of the current package.
#--------------------------------------------------------------
frame .menu -relief raised -borderwidth 1
frame .frame -borderwidth 4

scrollbar .frame.scroll -relief sunken -command ".frame.list yview"
listbox .frame.list -yscroll ".frame.scroll set" -relief sunken -setgrid 1
pack append .frame .frame.scroll {right filly} \
        .frame.list {left expand fill}

# build the lower window shoing the complete description of a pacage
frame .f -borderwidth 4
text .f.t -width 80 -height 20 -yscrollcommand ".f.s set" -relief sunken

# Initially display instructions in this window.  Erase the
# 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 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}

bind .frame.list <Double-Button-1> \
    { do_description [selection get] }
pack append .  .menu {top fill} \
   .f {bottom expand fill} \
   .frame {bottom expand fill}

#----------------------------------------------------------------
# Make menu bar:
#----------------------------------------------------------------
button .menu.inst -text "Install" \
   -command "apply_to_pkg \"pkg_add -v\""
button .menu.dein -text "Deinstall" \
   -command "apply_to_pkg \"pkg_delete -v\""
button .menu.installed -text "What is Installed?" \
   -command "list_pkgs \"pkg_info -I -a |tr '	' ' '\""
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 "apply_to_pkg \"pkg_info -d -v\""
button .menu.quit -text "Quit" -command "destroy ."
button .menu.help -text "Help" -command "do_help"

pack append .menu \
  .menu.inst left \
  .menu.dein left \
  .menu.installed left \
  .menu.available left \
  .menu.cont left \
  .menu.quit left \
  .menu.help right
#-------------------------------------------------------
# Display the package description.
#-------------------------------------------------------
proc list_pkgs {s} {
  set line ""
  set f [eval "open {| sh -c \"$s\" } r"]
  .frame.list delete 0 end
  while {[gets $f line] > 0} {
    .frame.list insert end $line
  }
  close $f
}

# display the list of available packages
set archives [glob -nocomplain *.{tgz,tar.z,tar.gz,tar.Z}]
if {$archives == ""} {
  .frame.list delete 0 end
 .frame.list insert end "Warning: no compressed tar archives files found."
} else {
  list_pkgs "pkg_info -I -c $archives |tr '	' ' '"
}

#-------------------------------------------------------
# Display the package description.
#-------------------------------------------------------
proc do_description {s} {
  global pkgname
  regexp {[^ 	]*} $s filename
  set pkgname $filename
  .f.t delete 0.0 end
  set cmd "pkg_info -d $filename |tr -d ''"
  set f [eval "open {| csh -c \"$cmd\" } r"]
  while {![eof $f]} {
    .f.t insert end [read $f]
  }
}
#-------------------------------------------------------
# package install window.
#-------------------------------------------------------
proc do_help {{w .help}} {
  catch {destroy $w}
  toplevel $w
  wm title $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 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\n"
    set f [eval "open {| sh -c \"$s $errredir\" } r"]
    while {![eof $f]} {
      .f.t insert end [read $f 64]
    }
}
#-------------------------------------------------------
# Invoke an arbitrary command.
#-------------------------------------------------------
proc do_command {s} {
  .f.t delete 0.0 end
  .f.t insert end "Running: $s\n"
  set f [eval "open {| $s} r"]
  while {![eof $f]} {
    .f.t insert end [read $f 64]
  }
}
# local variables:
# mode: csh
# compile-command: ""
# comment-start: "# "
# comment-start-skip: "# "
# end: