[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
Part1 - Part2 - Part3 - Part4 - Part5 - Single Page
Top Document: comp.lang.tcl Frequently Asked Questions (January 31, 2002) (3/6)
Previous Document: -O- http files without a WWW client
Next Document: -Q- Source code from published books
-
Search the FAQ Archives
Part1 - Part2 - Part3 - Part4 - Part5 - Single Page
Top Document: comp.lang.tcl Frequently Asked Questions (January 31, 2002) (3/6)
Previous Document: -O- http files without a WWW client
Next Document: -Q- Source code from published books
-P- The patch and gzip commands, along with other useful utilities
The patch command is used to apply updates to a source package. It assumes that you have the previous version of the source package in an uncompressed format as well as a file containing one or more modifications that need to be applied to the original code. The GNU project's version of the patch command is the one most commonly used on USENET. The primary archive for this project is <URL: ftp://prep.ai.mit.edu/pub/gnu/>. You will find the source code located at this FTP site. Source code for the gzip package, a very common compression format used on Unix (files compressed with gzip typically end in either .gz or .tgz), can be found at this site as well. For binary versions of either of these programs, you will have to search what ever the appropriate archive sites are for your machine. First, get a version of patch and compile and install it. Then you might follow a hypothetical scenario such as this: The tcl8.3/README says "apply them to the source directory"! $ mkdir /usr/tcl83 # Pick this directory as appropriate $ cd /usr/tcl83 $ mv $HOME/tcl8.3.0.tar.gz /usr/tcl83/. $ mv $HOME/tcl8.3.1.patch.gz $HOME/tcl8.3.2.patch.gz /usr/tcl83/. $ mv $HOME/tcl8.3.3.patch.gz /usr/tcl83/. $ gzip -d < $PWD/tcl8.3.0.tar.gz | tar xvf - $ cd tcl8.3 $ gzip -d < ../tcl8.3.1.patch.gz | patch -p1 $ gzip -d < ../tcl8.3.2.patch.gz | patch -p1 $ gzip -d < ../tcl8.3.3.patch.gz | patch -p1 $ $PWD/configure --prefix=/usr/tcl83 $ make $ make test $ make install assuming your *.gz files all reside in your $HOME directory initially. This ends up creating a /usr/tcl83/bin, include, and lib directory. The binary program tclsh8.3 goes into /usr/tcl83/bin . If you already have gunzip-ed the files in a different directory (such as /usr/tcl83/patch/), you could use them like this: $ cd /usr/tcl83/tcl8.3 $ patch -p < ../patch/tcl8.3.1.patch You will get messages from patch ("hmm, this looks like" and "hunk #n succeeded") which will scroll off your screen quite fast. One user has suggested that if you are using Unix, you can use the script command to keep all of the output in a log file which you can then peruse later. You should not get rejected, failed, or wrong version messages. If you get those types of messages, you may have missed a patch that needed to be made, or may be attempting to patch a version of the files not intended to be patched, or may be in an incorrect directory, or using a bad version of patch. If the patch is being applied later, you will want to execute a "make clean" before the make without arguments, to be sure that you have gotten rid of any files which need to be recreated during the install process. You need to be careful as well trying to perform make on different machines - if you have to switch computers between makes, you should execute a "make distclean" followed by another configure command. This ensures that the various assumptions made by the configuration program are accurate. Another alternative would be to create different subdirectories for each hardware/software platform on which you build the tcl binaries. Also, be aware that most patches to date have been built expecting patch version 2.1. Patch version 2.2 thru 2.3 at least, and perhaps version 2.4, have had incompatibilities that may fail in peculiar ways. Also note that at least Solaris 2.5.1 comes with a patch command quite a bit older than 2.1, and it too is incompatibile with many patch files, causing many different kinds of failures. Another command to which <URL: news:comp.lang.tcl> users sometimes are referred is a command history filter. These are programs which sit between the user's shell and a program and attempt to provide a history mechanism to commands which have no such capability. The most frequently mentioned of these programs is "ile". The master site for the newest version of ile is <URL: ftp://ftp.inria.fr/system/user/lile-2.0.tar.z>. Another commonly referred command history program is "fep". The master ftp site for the source code for it is <URL: ftp://ftp.sra.co.jp/pub/cmd/fep.tar.gz>. A useful place to begin looking for source code for these and other programs is <URL: ftp://ftp.freebsd.org/> and its mirrors. A WWW site for this would be <URL: http://www.freebsd.org/>. Windows users have begun asking how to format and display the man pages which come with Tcl, Tk and other applications. One recently recommended tool was CAWF. Cawf v1.0 is a C version of the nroff-like "Amazingly Workable (text) Formatter. Source & executables are available at various DOS software archives such as <URL: http://www.execnet.com/>. With cawf, it seems likely you could format the raw nroff into text. Another alternative might be <URL: http://web.dcs.bbk.ac.uk/%7Emick/html/> which is a Perl script which formats raw roff codes into formatted output. <URL: http://www.parallax.co.uk/%7Erolf/download/manServer.html> is another of this genre - perl scripts which convert man pages to html without using nroff. <URL: http://www-rn.informatik.uni-bremen.de/software/unroff/> is a Scheme package which translates *roff documents into HTML. Then, you could go to <URL: http://www.oac.uci.edu/indiv/ehood/> and pick up the man2html, which will take the formatted files produced and generate HTML. Or you could get RosettaMan , which is a part of the TkMan suite. In the tknt package (which was a port of Tcl/Tk/Tcl-DP/BLT/itcl to Windows NT, there was included a man2hlp.zip file containing the free source for a utility which converted the Tcl man pages into WinHelp pages. There are of course commercial packages that folk will be willing to sell you for this purpose as well. The package <URL: ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/gro110b.zip> has a README which begins: This is a port of GNU Groff version 1.10 to DJGPP v2.01 or later. It appears to work even under MSDOS, not just Win*. Find the home page for DJGPP at <URL: http://www.delorie.com/djgpp/>. Another user suggestions locating a package called DOS/DPMI from a simtel mirror site to find Windows versions of man.exe and groff. To extract files from gzip'd tar files while using Windows, see Winzip <URL: http://www.winzip.com/>. I believe there is a free alternative - perhaps someone will let me know about it. <URL: http://www.edv.agrar.tu-muenchen.de/~syring/win32/UnxUtils.html > is a distribution of common GNU utilities ported to native Win32. Another useful utility, this time for the Macintosh folk, is suntar, which can extract files from a tar file. I have seen notes indicating that Tcl and Tk can be compiled using the gcc free compiler in unix as well as Win32 (EGCS, FSF, cygwin32, mingw32) environments. Also, Win32's lcc should work. See <URL: http://www.xraylith.wisc.edu/%7Ekhan/software/gnu-win32/> <URL: http://www.xraylith.wisc.edu/%7Ekhan/software/tcl/> <URL: http://www.cygnus.com/misc/gnu-win32/> <URL: http://sourceware.cygnus.com/cygwin/> <URL: http://www.cs.virginia.edu/%7Elcc-win32> <URL: ftp://ftp.franken.de/pub/win32/develop/gnuwin32/mingw32/porters/Mikey/> <URL: ftp://ftp.freesoftware.com/pub/sourceware/cygwin/latest/setup.exe > <URL: ftp://ftp.yggdrasil.com/mirrors/site/sourceware.cygnus.com/pub/cygwin/latest/ > <URL: ftp://ftp.freesoftware.com/pub/sourceware/cygwin/latest/ > <URL: http://www.hwaci.com/sw/mktclapp/win32-compile.html> In gnu-win32 directory on cygnus, fetch either usertools.exe for the user level Unix-like tools, or cde.exe for the complete C development environment. At the sourceware web site, pick the full.exe file to install a full development environment. Many users mention using the bash shell or other similar shells on their Windows machines, so that they can get a mechanism similar to #! on Unix for launching their scripts. Be sure that you understand <URL: http://sources.redhat.com/cygwin/faq/faq_9.html#SEC145> very well, perhaps even discussing it with a lawyer, before using cygwin to produce software you wish to sell. Nothing there prevents you from doing this - however, there are a variety of considerations that one needs to make, when using tools some of which are covered by the GPL. Some users ask about additional sources of icons to use. One person suggests <URL: http://www.ibm.com/IBM/hci/resources/icons/icons.html>. Emacs can convert Tcl code into HTML using the M-x htmlize-buffer command on an Emacs buffer full of Tcl. This requires Hrvoje Niksic's htmlize.el package. Contact Emil Astrom <URL: mailto:emil@sics.se> if you need help locating the package. At least one user has recommended "Noweb" as a program for building documentation into your Tcl application. See <URL: http://www.cs.virginia.edu/%7Enr/noweb/intro.html> for more details. If you visit <URL: http://www.cs.wisc.edu/%7Eghost/>, you will find pointers to source and binary distributions (Linux, Windows, MacOS, other) of PostScript viewing software, useful for viewing a variety of PostScript versions of man pages, Tcl reference manuals, etc. If you visit <URL: http://www.adobe.com/> you can find a number of binary versions of acroread, which is a PDF viewer useful for some of the other reference documents. One Windows NT tool occasionally mentioned is the kill command found <URL: http://phoenix.liu.edu/~mdevi/util/page1.htm> . This is another set of NT tools that includes a kill: <URL: http://www.itribe.net/virtunix/files/unix95.7.zip >.
Top Document: comp.lang.tcl Frequently Asked Questions (January 31, 2002) (3/6)
Previous Document: -O- http files without a WWW client
Next Document: -Q- Source code from published books
Part1 - Part2 - Part3 - Part4 - Part5 - Single Page
[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
Send corrections/additions to the FAQ Maintainer:
lvirden@yahoo.com (Larry W. Virden)
Last Update October 22 2009 @ 05:35 AM