debian/0000755000000000000000000000000012261307745007175 5ustar debian/expect.docs0000644000000000000000000000002011623002613011312 0ustar FAQ NEWS README debian/copyright0000644000000000000000000000110611266146442011125 0ustar Author: Don Libes Download: http://sourceforge.net/projects/expect/ Files: * Copyright: (C) 1987-2002 National Institute of Standards and Technology License: PD Design and implementation of this program was paid for by U.S. tax dollars. Therefore it is public domain. However, the author and NIST would appreciate credit if this program or parts of it are used. Files: debian/* Copyright: (C) 2006-2008 Daniel Baumann License: PD The Debian packaging is hereby placed in the public domain (no rights reserved). debian/changelog0000644000000000000000000005141012261307526011045 0ustar expect (5.45-5ubuntu1) trusty; urgency=medium * Build for Tcl/Tk 8.6. -- Matthias Klose Thu, 02 Jan 2014 17:09:36 +0100 expect (5.45-5) unstable; urgency=low * Added patch which replaces memcpy my memmove for copying possibly overlapping memory area, thanks to Per Cederqvist (closes: #728663). -- Sergei Golovan Mon, 04 Nov 2013 08:28:43 +0400 expect (5.45-4) unstable; urgency=low * Execute tclsh8.5 instead of tclsh in expect scripts because tcl8.5 will stop providing /usr/bin/tclsh. -- Sergei Golovan Sun, 06 Oct 2013 09:00:38 +0400 expect (5.45-3) unstable; urgency=low * Added conflicts header to the debian/control file which ensures that the no longer existing expectk package gets removed (closes: #686364). * Switched to 3.0 (quilt) source package format. * Bumped debhelper compatibility level to 8. * Bumped standards version to 3.9.4. * Added hardening linker flags. -- Sergei Golovan Mon, 06 May 2013 13:34:56 +0400 expect (5.45-2) unstable; urgency=low * Replaced ckalloc() call in exp_clib.c by malloc() because using the ordinary free() leads to memory corruption after ckalloc() (which is a macro for Tcl_Alloc()). See patches/22-segfault-with-stubs.patch for segfaulting examples. -- Sergei Golovan Fri, 04 Nov 2011 12:14:05 +0400 expect (5.45-1) unstable; urgency=low * New upstream release. * Removed unnecessary patches. * Removed the expectk package because expectk was dropped from the upstream distribution. See NEWS.Debian for possible workarounds. * Updated package to standards version 3.9.2 (no changes needed). -- Sergei Golovan Wed, 17 Aug 2011 21:50:29 +0400 expect (5.44.1.15-4) unstable; urgency=low * Added patch by upstream which fixes crash during exact string matching in expect command if the search pattern contains non-ASCII characters. -- Sergei Golovan Wed, 27 Oct 2010 10:29:04 +0400 expect (5.44.1.15-3) unstable; urgency=low * Added patch by upstream (proposed by Per Cederqvist) which fixes slow processing of certain regexp patterns by preventing their convertation to glob patterns (closes: #591695). * Don't load Expect package to tclsh 8.4 because it causes a segmentation fault. * Updated package to standards version 3.9.1 (no changes needed). -- Sergei Golovan Sun, 05 Sep 2010 09:48:27 +0400 expect (5.44.1.15-2) unstable; urgency=low * Removed a bit of implicit-declarations patch which included tcl.h into exp_clib.c and redefined memory allocation routines because of Tcl stubs (closes: #588817). * Updated package to standards version 3.9.0 (no changes needed). -- Sergei Golovan Thu, 15 Jul 2010 18:31:29 +0400 expect (5.44.1.15-1) unstable; urgency=low * New upstream release. -- Sergei Golovan Mon, 15 Mar 2010 20:56:14 +0300 expect (5.44.1.14-5) unstable; urgency=low * Fixed sourcing rc flies by expectk (closes: #555746). * Removed another unnecessary patch. * Adapted expect test suite to the changes in pkgIndex.tcl which can't load Expect package if it isn't installed into /usr/lib. -- Sergei Golovan Wed, 18 Nov 2009 22:42:44 +0300 expect (5.44.1.14-4) unstable; urgency=low * Added replaces field to expect-dev binary package because libexpect(3) manpage was moved from expect to expect-dev package (closes: #554947). -- Sergei Golovan Sat, 07 Nov 2009 15:53:09 +0300 expect (5.44.1.14-3) unstable; urgency=low * Removed build dependencies which are also dependencies of tk8.5-dev (since 8.5.7-2). * Use locally defined function Tcl_ErrnoMsg in exp_clib.c because this part of the library is supposed to be used without loading into a Tcl interpreter, which isn't possible if expect is build with Tcl stubs (closes: #552685). * Removed unneeded patches from debian/patches, cleaned up other ones. -- Sergei Golovan Tue, 03 Nov 2009 21:21:56 +0300 expect (5.44.1.14-2) unstable; urgency=low * Added buid conflict with autoconf2.13 because autoconf 2.50 or newer is required to process configure.in template. * Fixed building with the current config.sub and config.guess from autotools-dev package (closes: #551332). * Fixed cleaning after build is done. -- Sergei Golovan Fri, 23 Oct 2009 12:24:40 +0400 expect (5.44.1.14-1) unstable; urgency=low * New maintainer Sergei Golovan (closes: #543839). * New upstream CVS snapshot. * Switched to upstream which maintains CVN at SourceForge.net because Don Libet doesn't have time to develop Expect anymore. Therefore, changed upstream homepage. * Switched to Tcl/Tk 8.5 (closes: #512150). * Don't call configure and build targets twice anymore (closes: #441114). * Upstream includes patch which fixes empty writes (closes: #421187). * The new upstream fixed a regression which didn't allow to read from stdin (closes: #347259). * Added README.source with a link to /usr/share/doc/quilt/README.source where an instruction on how to patch upstream sources is located. * Removed examples from /usr/share/doc/expect-dev/examples because all of them are shipped in /usr/bin directory. This makes uncompressing them unnecessary (closes: #495605). * Added links all expect_* script to their original names, except mkpasswd, rftp and weather to avoid conflicts with other packages (closes: #508320, #532332). * Upstream removed useless "puts hello" from multixterm script (closes: #550909). -- Sergei Golovan Fri, 16 Oct 2009 23:39:56 +0400 expect (5.43.0-19) unstable; urgency=low * Updating package to standards version 3.8.3. * Removing vcs fields. * Orphaning package. -- Daniel Baumann Thu, 27 Aug 2009 07:22:39 +0200 expect (5.43.0-18) unstable; urgency=low * Adding patch from Adam Tkac to compile with tcl8.5, but not yet enabling it. * Updating vcs fields in control file. * Using patch-stamp rather than patch in rules file. * Replacing obsolete dh_clean -k with dh_prep. * Using correct rfc-2822 date formats in changelog. * Updating package to standards version 3.8.2. * Adding misc depends. * Removing shlibs file. * Using quilt rather than dpatch. * Adding patch from fedora to fix header comments. * Adding patch from fedora to fix permissions when accessing logfiles. * Adding patch from Vitezslav Crhonek for tcl 8.5.6, but not yet enabling it. * Minimizing rules file. -- Daniel Baumann Mon, 03 Aug 2009 12:00:29 +0200 expect (5.43.0-17) unstable; urgency=low * Reordering removal of config.guess and config.sub in clean target (Closes: #488489). * Updating to standards 3.8.0. -- Daniel Baumann Thu, 03 Jul 2008 10:38:00 +0200 expect (5.43.0-16) unstable; urgency=low * Reordering rules file. * Using lintian debhelper to install lintian overrides. * Rewriting copyright file in machine-interpretable format. * Removing watch file. * Adding vcs fields in control. * Upgrading package to debhelper 7. * Removing useless whitespace in changelog file. * Reverting config.guess and config.sub to upstream. -- Daniel Baumann Sat, 03 May 2008 12:44:00 +0200 expect (5.43.0-15) unstable; urgency=low * Bumping to new policy. * Using homepage field in control. * Don't hide make errors in clean target of rules. * Adding tk8.4-dev to expect-dev depends. * Including expect scripts in expect-dev (Closes: #442142). -- Daniel Baumann Sun, 23 Dec 2007 13:50:00 +0100 expect (5.43.0-14) unstable; urgency=low * Acknowledge NMU (Closes: #441115). * Rediffed 13-implicit-defs.dpatch. -- Daniel Baumann Wed, 10 Oct 2007 12:02:00 +0200 expect (5.43.0-13.1) unstable; urgency=low * Non-Maintainer Upload * Fix implicit definitions throughout. Closes: #441115 -- LaMont Jones Wed, 19 Sep 2007 15:38:18 -0600 expect (5.43.0-13) unstable; urgency=low * Applied patch from Ian Jackson to add fdout in expBusy (Closes: #440818). -- Daniel Baumann Tue, 04 Sep 2007 21:34:00 +0200 expect (5.43.0-12) unstable; urgency=low * Applied patch from Ian Jackson to check before call ttyname, so don't coredump in chroots without /proc (Closes: #440804). -- Daniel Baumann Tue, 04 Sep 2007 15:47:00 +0200 expect (5.43.0-11) unstable; urgency=low * Fixed clean: target in rules (Closes: #424200). -- Daniel Baumann Wed, 16 May 2007 11:17:00 +0200 expect (5.43.0-10) unstable; urgency=low * Removed double reference to expect in expecttk depends. -- Daniel Baumann Tue, 15 May 2007 15:34:00 +0200 expect (5.43.0-9) unstable; urgency=low * Minor cleanups. * Bumping package to debhelper 5. -- Daniel Baumann Tue, 01 May 2007 13:50:00 +0200 expect (5.43.0-8) unstable; urgency=medium * Added patch from Niko Tyni to fix static library name on alpha, mips and mipsel (Closes: #390366). * Added *.so symlink (Closes: #390365). -- Daniel Baumann Sun, 01 Oct 2006 22:23:00 +0200 expect (5.43.0-7) unstable; urgency=medium * Adjusted 06-pkgindex.dpatch to reflect the new soname introduced with 5.43.0-4 in pkgIndex.tcl (Closes: #381052). -- Daniel Baumann Tue, 01 Aug 2006 20:54:00 +0200 expect (5.43.0-6) unstable; urgency=low * Adjusted lintian overrides. -- Daniel Baumann Wed, 12 Jul 2006 18:48:00 +0200 expect (5.43.0-5) unstable; urgency=low * Moved examples from path to examples directory (Closes: #377851). -- Daniel Baumann Tue, 11 Jul 2006 18:54:00 +0200 expect (5.43.0-4) unstable; urgency=low * New maintainer (Closes: #368094). * Acknowledge NMU (Closes: #367618, #368364, #368580). * Redone debian directory based on newer debhelper templates, additionally: - Added lintian overrides. - Added watch file. - Fixed depends (Closes: #375869). - Rediffed all patches from scratch using dpatch, put descriptions to every patch and assigned correct credits. All patches get applied now. - Rewritten debian/copyright, it's the correct and relevant information now. - Running test suites while the build process. - Set soname to libexpect.so.5.43.0. -- Daniel Baumann Mon, 10 Jul 2006 15:40:00 +0200 expect (5.43.0-3.1) unstable; urgency=low * NMU to fix atlas3 FTBFS. * Apply patch from Paul Cupis: - Move libexpect5.43.so into expect package. (Closes: 367618) (libexpect-dev Depends on expect, so 367325 is still fixed.) -- Bill Allombert Sun, 21 May 2006 17:36:06 +0200 expect (5.43.0-3) unstable; urgency=high * Applied patch from Alec Berryman, fixing a symlink error. Closes: #367325 -- Jonathan Walther Tue, 16 Mar 2006 12:46:52 -0800 expect (5.43.0-2) unstable; urgency=high * Lintian fix: more hyphenation in the manpage. * Lintian fix: removed DH_COMPAT from rules file. -- Jonathan Walther Sun, 12 Mar 2006 22:24:52 -0800 expect (5.43.0-1) unstable; urgency=high * Latest upstream (still two years old though) * Better fix for infinite write bug -- Jonathan Walther Sun, 05 Mar 2006 02:06:52 -0800 expect (5.42.1-5) unstable; urgency=high * Lintian fix: standards version. * Lintian fix: linebreak in manpage. * Fixing hyphenation escaping in manpage too. * Previous release fixed this bug. Closes: #270628 -- Jonathan Walther Sun, 05 Mar 2006 02:06:52 -0800 expect (5.42.1-4) unstable; urgency=high * Depending on autoconf2.13 not necessary because config.{guess,sub} is properly updated now. Thank you LaMont Jones and Steve Langasek. Closes: #295633 * Fixed an infinite write bug. Thank you Martin Forssen for the patch. Closes: #294092 * Output problems should be fixed now that infinite write bug is fixed. Closes: #301556 * Incorrect use of fork() is not expect's problem. Without more information, I have to declare this a Tcl8.4 bug. Closes: #314224 * All the tests in the tests directory pass with flying colors. Closes: #156815 * Upstream fixed the autoexpect script at some point in the past. Closes: #197640 -- Jonathan Walther Sat, 21 Jan 2006 01:13:52 -0800 expect (5.42.1-3) unstable; urgency=high * Doing package ownership transfer properly. -- Jonathan Walther Fri, 20 Jan 2006 20:49:52 -0800 expect (5.42.1-2) unstable; urgency=high * Now does auto-update of config.guess and config.sub Closes: #277350 * Package transfered from Mike Markley, recently retired. * README.Debian file not needed; Mike dropped it on Aug 17, 2004. Closes: #253233 * Added -ansi -D_SVID_SOURCE -D_POSIX_SOURCE to CFLAGS Closes: #301558 * example/kibbitz was changed to not exec expect at some point in the past. If you still have problems, file a new bug. Closes: #291430 * Implemented Andrew Suffields security suggestion. Closes: #157902 -- Jonathan Walther Fri, 20 Jan 2006 20:09:52 -0800 expect (5.42.1-1.2) unstable; urgency=high * Non-maintainer upload. * High-urgency upload for sarge-targetted RC bugfix * Update config.sub and config.guess against current autotools, and pass --build=$(DEB_BUILD_GNU_TYPE) to configure, to avoid build failures on unknown host types (closes: #255743). -- Steve Langasek Thu, 06 Jan 2005 22:23:52 -0800 expect (5.42.1-1.1) unstable; urgency=high * Non-maintainer upload. * High-urgency upload for sarge-targetted RC bugfix * Update expect_cf.h.in to move all comments onto their own lines, for compatibility with autoconf 2.5 and fixing build failures. Closes: #282347 * Use TARGETDIR instead of TMPDIR as a variable name in debian/rules: the latter has special significance, and was interfering with the build process locally. -- Steve Langasek Sat, 04 Dec 2004 03:54:53 -0800 expect (5.42.1-1) unstable; urgency=low * New upstream version * Drop the README.Debian that I forgot to commit anyway because the caveats don't seem to have materialized -- Mike Markley Tue, 17 Aug 2004 00:34:18 -0700 expect (5.41.0-1) unstable; urgency=low * New upstream version (Closes: #251637, #251641) * Enable threading w/tcl8.4. Also added some information to README.Debian about the caveats of this change. Closes: #239550 -- Mike Markley Thu, 03 Jun 2004 01:19:26 -0700 expect (5.39.0-1) unstable; urgency=low * New upstream version (Closes: #216323) * Roll back to tcl8.3 because of problems with threading. This will hopefully be corrected at a later date with proper thread support (Closes: #196084) * Changed server in weather example since old one no longer works (Closes: #139343) * Manpage typo fix (Closes: #212875) * Cleanup descriptions (Closes: #209485) * Check for /usr/bin/crypt in cryptdir examples (Closes: #67197) * Correct upstream URL (Closes: #216321) -- Mike Markley Fri, 17 Oct 2003 16:53:02 -0700 expect (5.38.0-5) unstable; urgency=low * Fixed stupid typo in pkgIndex.in (Closes: #186179) -- Mike Markley Wed, 09 Apr 2003 00:32:30 -0700 expect (5.38.0-4) unstable; urgency=low * Cleaning out the BTS... * Rebuild against tcl 8.4 (Closes: #183113) * Fix occurences of /usr/local/bin in manpages (Closes: #112062) * While I'm uploading, this version uses -not instead of -n as the short form of -notransfer, manpage is up-to-date (Closes: #134769) * Added patch from Russell Coker to set fd3 to close on exit (Closes: #166677) * Fix for 64-bit unsafeness included already, never marked it (Closes: #126091) -- Mike Markley Tue, 11 Mar 2003 02:52:46 -0800 expect (5.38.0-3) unstable; urgency=low * Fixed pkgIndex.tcl (Closes: #167735) * The library name was still 5.37, bumped up to 5.38, this will require package recompilation... -- Mike Markley Mon, 04 Nov 2002 15:41:03 -0800 expect (5.38.0-2) unstable; urgency=low * Added patch from Andrew Suffield to fix segfault possibility when ending a script with open channels (Closes: #157901) -- Mike Markley Tue, 27 Aug 2002 03:11:45 -0700 expect (5.38.0-1) unstable; urgency=low * New upstream version * Added patch from Jack Howarth regarding spawn problems resulting in, among other things, failed "make check"s (Closes: #156854) -- Mike Markley Fri, 16 Aug 2002 20:04:30 -0700 expect (5.37-3) unstable; urgency=low * Fixed paths in examples (Closes: #152367) -- Mike Markley Wed, 10 Jul 2002 22:53:19 -0700 expect (5.37-2) unstable; urgency=low * Fixed the soname issue (the issue being that it wasn't there) Closes: #151153, #151160 -- Mike Markley Thu, 27 Jun 2002 22:29:38 -0700 expect (5.37-1) unstable; urgency=low * New upstream version. * Stubs patch needed slight tweaking to mesh with this version * Stubs patch also no longer patches configure (so run autoconf if it's changed!) * Updated debconf dependency (I'm now using DH_COMPAT=3...) * Removed the dummy packages into its own source package so we don't have to upload new ones everytime expect is updated... -- Mike Markley Tue, 25 Jun 2002 23:47:46 -0700 expect (5.32.2-4) unstable; urgency=low * Expectk was linked against a broken libtk8.3 that didn't provide proper soname; rebuild to fix (Closes: #107908) -- Mike Markley Tue, 07 Aug 2001 10:08:52 -0700 expect (5.32.2-3) unstable; urgency=low * Changed hardcoded path for write to the proper Debian path (Closes: #103833) * Removed old substvars.debhelper file * Fixed some Replaces/Conflicts lines (I typo'd on a couple of the upgrade ones...) * Fixed minor typos in descriptions, while I'm at it... * Removed $(vso) from debian/rules - it was a hack for the mis- matched package name and version numbers -- Mike Markley Thu, 02 Aug 2001 23:10:05 -0700 expect (5.32.2-2) unstable; urgency=low * Removed autoconf call (Closes: #102895) * Removed check for Tcl install (this is the age of Build-Deps) -- Mike Markley Sat, 30 Jun 2001 13:36:35 -0700 expect (5.32.2-1) unstable; urgency=low * New upstream release * Dropped separate packages, retaining 5.31 changelog since I'm carrying over that packaging... * Removed alternatives code from maintainer scripts -- Mike Markley Mon, 14 May 2001 01:00:59 -0700 expect5.31 (5.31.8-3) unstable; urgency=low * Added build-dep for autoconf (closes: #70411) -- Mike Markley Mon, 18 Sep 2000 22:02:40 -0700 expect5.31 (5.31.8-2) unstable; urgency=low * New maintainer. -- Mike Markley Fri, 25 Aug 2000 19:06:36 -0700 expect5.31 (5.31.8-1) unstable; urgency=low * New upstream version. * Added a Suggests for expectk (Bug#65702). -- David Engel Sun, 02 Jul 2000 15:20:28 -0500 expect5.31 (5.31.5-2) unstable; urgency=low * Rebuilt without stubs, but in a way that still works with Tcl/Tk 8.2. -- David Engel Mon, 10 Apr 2000 10:51:07 -0500 expect5.31 (5.31.5-1) unstable; urgency=low * New upstream version. * Rebuilt with Tcl/Tk 8.3. * Applied stubs patch to work with Tcl/Tk 8.2. -- David Engel Sat, 08 Apr 2000 20:43:54 -0500 expect5.31 (5.31.2-3) unstable; urgency=low * Removed dash patch fixes since they are no longer needed. -- David Engel Mon, 15 Nov 1999 12:09:58 -0600 expect5.31 (5.31.2-2) unstable; urgency=low * Run autoconf directly instead of letting the Makefile do it (Bug#49168). -- David Engel Thu, 04 Nov 1999 21:04:41 -0600 expect5.31 (5.31.2-1) unstable; urgency=low * New upstream version. * Fixed expectk to work with dash-enhanced Tk (Bug#48722). * Fixed build problems with non-compatible Tcl/Tk versions present (Bug#47399). -- David Engel Sat, 30 Oct 1999 21:40:06 -0500 expect5.31 (5.31.0-2) unstable; urgency=low * Fixed bad substitution in examples (Bug#46422). * FHS changes. -- David Engel Sat, 02 Oct 1999 10:55:25 -0500 expect5.31 (5.31.0-1) unstable; urgency=low * Initial packaging. -- David Engel Sat, 28 Aug 1999 23:53:51 -0500 debian/expect.links0000644000000000000000000000006311623000135011506 0ustar /usr/lib/libexpect.so.5.45 /usr/lib/libexpect.so.5 debian/NEWS0000644000000000000000000000054611623002613007664 0ustar expect (5.45-1) unstable; urgency=low As of Expect 5.45 expectk was removed from the upstream distribution and from the Debian package as well. If you're using expectk replace it either by 'expect' and 'package require Tk' or by 'wish' and 'package require Expect'. -- Sergei Golovan Wed, 17 Aug 2011 21:50:29 +0400 debian/expect-dev.install0000644000000000000000000000015411266146442012630 0ustar /usr/bin/expect_* /usr/include/* #/usr/lib/*.a /usr/share/man/man1/expect_* /usr/share/man/man3/libexpect.* debian/compat0000644000000000000000000000000212141673052010365 0ustar 8 debian/expect.install0000644000000000000000000000011611266146442012052 0ustar /usr/bin/expect /usr/lib/*.so.* /usr/lib/tcltk/* /usr/share/man/man1/expect.* debian/expect-dev.docs0000644000000000000000000000002011623002613012066 0ustar FAQ NEWS README debian/patches/0000755000000000000000000000000012235621525010620 5ustar debian/patches/12-fdout.patch0000644000000000000000000000107111623000135013165 0ustar Author: Ian Jackson Description: expBusy forgets to open fdout (Closes: #440818). --- expect-5.45.orig/exp_command.c +++ expect-5.45/exp_command.c @@ -315,7 +315,15 @@ fcntl(x,F_DUPFD,esPtr->fdin); close(x); } - expCloseOnExec(esPtr->fdin); + if (esPtr->fdout != EXP_NOFD && + esPtr->fdout != esPtr->fdin) { + fcntl(esPtr->fdin,F_DUPFD,esPtr->fdout); + } + if (esPtr->fdin > 2) + expCloseOnExec(esPtr->fdin); + if (esPtr->fdout != EXP_NOFD && + esPtr->fdout > 2) + expCloseOnExec(esPtr->fdout); esPtr->fdBusy = TRUE; } debian/patches/07-file-handle.patch0000644000000000000000000000140711623000135014223 0ustar Author: Russell Coker Description: Fixes file handle 3 to be left open when running programs (Closes: #166677). --- expect-5.45.orig/exp_clib.c +++ expect-5.45/exp_clib.c @@ -2040,6 +2040,7 @@ /* save error fd while we're setting up new one */ errorfd = fcntl(2,F_DUPFD,3); + fcntl(3, F_SETFD, FD_CLOEXEC); /* and here is the macro to restore it */ #define restore_error_fd {close(2);fcntl(errorfd,F_DUPFD,2);} --- expect-5.45.orig/exp_command.c +++ expect-5.45/exp_command.c @@ -1162,6 +1162,7 @@ /* save error fd while we're setting up new one */ errorfd = fcntl(2,F_DUPFD,3); + fcntl(3, F_SETFD, FD_CLOEXEC); /* and here is the macro to restore it */ #define restore_error_fd {close(2);fcntl(errorfd,F_DUPFD,2);} debian/patches/02-example-cryptdir.patch0000644000000000000000000000137411623000135015342 0ustar Author: Mike Markley Description: Checks for /usr/bin/crypt in cryptdir example (Closes: #67197). --- expect-5.45.orig/example/cryptdir +++ expect-5.45/example/cryptdir @@ -15,6 +15,11 @@ # # Encrypt or decrypts the current directory or named directory if given. +if {![file exists /usr/bin/crypt]} { + puts "This example requires the mcrypt package." + exit +} + if {[llength $argv] > 0} { cd $argv } --- expect-5.45.orig/example/decryptdir +++ expect-5.45/example/decryptdir @@ -15,6 +15,11 @@ # # Encrypt or decrypts the current directory or named directory if given. +if {![file exists /usr/bin/crypt]} { + puts "This example requires the mcrypt package." + exit +} + if {[llength $argv] > 0} { cd $argv } debian/patches/05-makefile-soname.patch0000644000000000000000000000054311623000135015106 0ustar Author: Sergei Golovan Description: Adds '-soname' to the Makefile. --- expect-5.45.orig/Makefile.in +++ expect-5.45/Makefile.in @@ -289,7 +289,7 @@ $(PKG_LIB_FILE): $(PKG_OBJECTS) -rm -f $(PKG_LIB_FILE) - ${MAKE_LIB} + ${MAKE_LIB} -Wl,-soname,$(SONAME) $(RANLIB) $(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) debian/patches/01-example-shebang.patch0000644000000000000000000000632611623000135015112 0ustar Author: Mike Markley Author: Sergei Golovan Description: Fixes shebangs in examples (Closes: #152367). --- expect-5.45.orig/example/beer.exp +++ expect-5.45/example/beer.exp @@ -1,4 +1,9 @@ -#!/depot/path/expect -f +#!/bin/sh +# -*- tcl -*- +# The next line is executed by /bin/sh, but not tcl \ +exec tclsh "$0" ${1+"$@"} + +package require Expect # 99 bottles of beer on the wall, Expect-style # Author: Don Libes --- expect-5.45.orig/example/expectd.proto +++ expect-5.45/example/expectd.proto @@ -1,4 +1,10 @@ -#!/depot/tcl/src/expect/e -- +#!/bin/sh +# -*- tcl -*- +# The next line is executed by /bin/sh, but not tcl \ +exec tclsh "$0" ${1+"$@"} + +package require Expect + # Description: Simple fragment to begin a telnet daemon # For more information, see Chapter 17 of "Exploring Expect" # Author: Don Libes, NIST --- expect-5.45.orig/example/irsh +++ expect-5.45/example/irsh @@ -1,4 +1,9 @@ -#!/depot/path/expect -- +#!/bin/sh +# -*- tcl -*- +# The next line is executed by /bin/sh, but not tcl \ +exec tclsh "$0" ${1+"$@"} + +package require Expect # Do rsh interactively. For example, consider the following command: # rsh ls -l "|" more --- expect-5.45.orig/example/passwd.cgi +++ expect-5.45/example/passwd.cgi @@ -1,4 +1,9 @@ -#!/depot/path/expect -- +#!/bin/sh +# -*- tcl -*- +# The next line is executed by /bin/sh, but not tcl \ +exec tclsh "$0" ${1+"$@"} + +package require Expect # This is a CGI script to process requests created by the accompanying # passwd.html form. This script is pretty basic, although it is --- expect-5.45.orig/example/passwdprompt +++ expect-5.45/example/passwdprompt @@ -1,4 +1,9 @@ -#!/depot/path/expect +#!/bin/sh +# -*- tcl -*- +# The next line is executed by /bin/sh, but not tcl \ +exec tclsh "$0" ${1+"$@"} + +package require Expect # This script prompts for a passwd from stdin while echoing *'s --- expect-5.45.orig/example/reprompt +++ expect-5.45/example/reprompt @@ -1,4 +1,9 @@ -#!/depot/path/expect -- +#!/bin/sh +# -*- tcl -*- +# The next line is executed by /bin/sh, but not tcl \ +exec tclsh "$0" ${1+"$@"} + +package require Expect # Name: reprompt # Description: reprompt every so often until user enters something --- expect-5.45.orig/example/term_expect +++ expect-5.45/example/term_expect @@ -1,4 +1,9 @@ -#!/depot/path/expectk +#!/bin/sh +# -*- tcl -*- +# The next line is executed by /bin/sh, but not tcl \ +exec wish "$0" ${1+"$@"} + +package require Expect # Name: tkterm - terminal emulator using Expect and Tk text widget, v3.0 # Author: Don Libes, July '94 --- expect-5.45.orig/example/vrfy +++ expect-5.45/example/vrfy @@ -1,4 +1,9 @@ -#!/depot/path/expect -f +#!/bin/sh +# -*- tcl -*- +# The next line is executed by /bin/sh, but not tcl \ +exec tclsh "$0" ${1+"$@"} + +package require Expect # separate address into user and host --- expect-5.45.orig/example/xrlogin +++ expect-5.45/example/xrlogin @@ -1,4 +1,10 @@ -#!/depot/path/expect -- +#!/bin/sh +# -*- tcl -*- +# The next line is executed by /bin/sh, but not tcl \ +exec tclsh "$0" ${1+"$@"} + +package require Expect + # xrlogin - rlogin but with current DISPLAY # # You can extend this idea to save any arbitrary information across rlogin debian/patches/13-implicit-defs.patch0000644000000000000000000001225511623000135014604 0ustar Author: LaMont Jones Description: Fix implicit definitions throughout (Closes: #441115). --- expect-5.45.orig/exp_chan.c +++ expect-5.45/exp_chan.c @@ -34,6 +34,7 @@ #include "exp_rename.h" #include "exp_prog.h" #include "exp_command.h" +#include "exp_event.h" #include "exp_log.h" #include "tcldbg.h" /* Dbg_StdinMode */ --- expect-5.45.orig/exp_clib.c +++ expect-5.45/exp_clib.c @@ -7,6 +7,9 @@ would appreciate credit if this program or parts of it are used. */ +#include +#include + #include "expect_cf.h" #include #include --- expect-5.45.orig/exp_command.h +++ expect-5.45/exp_command.h @@ -7,6 +7,9 @@ would appreciate credit if this program or parts of it are used. */ +#ifndef __EXP_COMMAND_H +#define __EXP_COMMAND_H + #ifdef HAVE_SYS_WAIT_H /* ISC doesn't def WNOHANG unless _POSIX_SOURCE is def'ed */ # ifdef WNOHANG_REQUIRES_POSIX_SOURCE @@ -100,11 +103,11 @@ char name[EXP_CHANNELNAMELEN+1]; /* expect and interact set variables to channel name, so for efficiency cache it here */ - int fdin; /* input fd */ - int fdout; /* output fd - usually the same as fdin, although + long fdin; /* input fd - may be used for storing ClientData, a pointer */ + long fdout; /* output fd - usually the same as fdin, although may be different if channel opened by tcl::open */ ExpOrigin* chan_orig; /* If opened by someone else, i.e. tcl::open */ - int fd_slave; /* slave fd if "spawn -pty" used */ + long fd_slave; /* slave fd if "spawn -pty" used */ /* this may go away if we find it is not needed */ /* it might be needed by inherited channels */ @@ -242,6 +245,7 @@ EXTERN void exp_init_send _ANSI_ARGS_((void)); EXTERN void exp_init_unit_random _ANSI_ARGS_((void)); EXTERN void exp_init_sig _ANSI_ARGS_((void)); +EXTERN void exp_ecmd_remove_state_direct_and_indirect _ANSI_ARGS_((Tcl_Interp *interp,ExpState *esPtr)); EXTERN void expChannelInit _ANSI_ARGS_((void)); EXTERN int expChannelCountGet _ANSI_ARGS_((void)); @@ -337,6 +341,8 @@ EXTERN ExpState * expStdinoutGet _ANSI_ARGS_((void)); EXTERN ExpState * expDevttyGet _ANSI_ARGS_((void)); +EXTERN int Exp_StringCaseMatch _ANSI_ARGS_((Tcl_UniChar *string, int strlen, Tcl_UniChar *pattern, int plen, int nocase, int *offset)); + /* generic functions that really should be provided by Tcl */ #if 0 /* Redefined as macros. */ EXTERN int expSizeGet _ANSI_ARGS_((ExpState *)); @@ -348,6 +354,8 @@ #define EXP_CMDINFO_CLOSE "expect/cmdinfo/close" #define EXP_CMDINFO_RETURN "expect/cmdinfo/return" + +#endif /* __EXP_COMMAND_H */ /* * Local Variables: --- expect-5.45.orig/exp_main_sub.c +++ expect-5.45/exp_main_sub.c @@ -2,6 +2,7 @@ #include "expect_cf.h" #include +#include #include #ifdef HAVE_INTTYPES_H # include --- expect-5.45.orig/exp_tty.h +++ expect-5.45/exp_tty.h @@ -21,6 +21,7 @@ int exp_tty_raw_noecho(Tcl_Interp *interp, exp_tty *tty_old, int *was_raw, int *was_echo); int exp_israw(void); int exp_isecho(void); +EXTERN int exp_tty_cooked_echo _ANSI_ARGS_((Tcl_Interp *interp, exp_tty *tty_old, int *was_raw, int *was_echo)); void exp_tty_set(Tcl_Interp *interp, exp_tty *tty, int raw, int echo); int exp_tty_set_simple(exp_tty *tty); --- expect-5.45.orig/exp_tty_in.h +++ expect-5.45/exp_tty_in.h @@ -11,6 +11,8 @@ #define __EXP_TTY_IN_H__ #include "expect_cf.h" +#include "expect.h" +#include #ifdef __MACHTEN__ #include "sys/types.h" --- expect-5.45.orig/exp_win.c +++ expect-5.45/exp_win.c @@ -51,6 +51,7 @@ # include #endif /* HAVE_SYS_PTEM_H */ +#include "expect.h" #include "exp_tty_in.h" #include "exp_win.h" --- expect-5.45.orig/exp_win.h +++ expect-5.45/exp_win.h @@ -1,3 +1,5 @@ +#ifndef __EXP_WIN_H +#define __EXP_WIN_H /* exp_win.h - window support Written by: Don Libes, NIST, 10/25/93 @@ -8,8 +10,8 @@ #include /* For _ANSI_ARGS_ */ -int exp_window_size_set(); -int exp_window_size_get(); +EXTERN int exp_window_size_set _ANSI_ARGS_((int fd)); +EXTERN int exp_window_size_get _ANSI_ARGS_((int fd)); void exp_win_rows_set _ANSI_ARGS_ ((char* rows)); char* exp_win_rows_get _ANSI_ARGS_ ((void)); @@ -20,3 +22,5 @@ char* exp_win2_rows_get _ANSI_ARGS_ ((int fd)); void exp_win2_columns_set _ANSI_ARGS_ ((int fd, char* columns)); char* exp_win2_columns_get _ANSI_ARGS_ ((int fd)); + +#endif /* __EXP_WIN_H */ --- expect-5.45.orig/pty_termios.c +++ expect-5.45/pty_termios.c @@ -9,12 +9,19 @@ #include #include +#include +#include +#include #if defined(SIGCLD) && !defined(SIGCHLD) #define SIGCHLD SIGCLD #endif #include "expect_cf.h" +#include +#include "expect.h" +#include "exp_tty_in.h" +#include "exp_int.h" /* expErrnoMsg() prototype */ /* The following functions are linked from the Tcl library. They @@ -99,7 +106,6 @@ #include "exp_win.h" -#include "exp_tty_in.h" #include "exp_rename.h" #include "exp_pty.h" @@ -369,7 +375,7 @@ #define W_OK 02 #endif -static int ttyname_checked(int fd) { +static char * ttyname_checked(int fd) { const char *result; result= ttyname(fd); if (!result) { debian/patches/16-logfile.patch0000644000000000000000000000071411623000135013474 0ustar Author: n/a Description: Corrects permissions when accessing logfiles. --- expect-5.45.orig/exp_log.c +++ expect-5.45/exp_log.c @@ -499,7 +499,7 @@ Tcl_DStringAppend(&tsdPtr->logFilename,filename,-1); } - tsdPtr->logChannel = Tcl_OpenFileChannel(interp,newfilename,mode,0777); + tsdPtr->logChannel = Tcl_OpenFileChannel(interp,newfilename,mode,0666); if (!tsdPtr->logChannel) { Tcl_DStringFree(&tsdPtr->logFilename); return TCL_ERROR; debian/patches/06-pkgindex.patch0000644000000000000000000000642011623000135013663 0ustar Author: Michael A. Cleverly , Sergei Golovan Description: Adjusted for new soname (Closes: #381052). Replaced [package require Expect] by direct loading libexpect library in all tests because package management can't load the library from its build location. Last-Modified: 2009-11-18 --- expect-5.45.orig/Makefile.in +++ expect-5.45/Makefile.in @@ -331,7 +331,7 @@ pkgIndex.tcl-hand: (echo 'if {![package vsatisfies [package provide Tcl] @TCL_VERSION@]} {return}' ; \ echo 'package ifneeded Expect $(PACKAGE_VERSION) \ - [list load [file join $$dir $(PKG_LIB_FILE)]]'\ + [list load [file join @prefix@ lib libexpect.so.@PACKAGE_VERSION@]]'\ ) > pkgIndex.tcl #======================================================================== --- expect-5.45.orig/tests/all.tcl +++ expect-5.45/tests/all.tcl @@ -7,7 +7,7 @@ package require tcltest # do this in a way that is backward compatible for Tcl 8.3 namespace import ::tcltest::test ::tcltest::cleanupTests -package require Expect +load [lindex [glob libexpect*.so] 0] set ::tcltest::testSingleFile false set ::tcltest::testsDirectory [file dirname [info script]] --- expect-5.45.orig/tests/cat.test +++ expect-5.45/tests/cat.test @@ -9,7 +9,7 @@ # do this in a way that is backward compatible for Tcl 8.3 namespace import ::tcltest::test ::tcltest::cleanupTests } -package require Expect +load [lindex [glob libexpect*.so] 0] #exp_internal -f /dev/ttyp5 0 --- expect-5.45.orig/tests/expect.test +++ expect-5.45/tests/expect.test @@ -9,7 +9,7 @@ # do this in a way that is backward compatible for Tcl 8.3 namespace import ::tcltest::test ::tcltest::cleanupTests } -package require Expect +load [lindex [glob libexpect*.so] 0] catch {unset x} --- expect-5.45.orig/tests/logfile.test +++ expect-5.45/tests/logfile.test @@ -9,7 +9,7 @@ # do this in a way that is backward compatible for Tcl 8.3 namespace import ::tcltest::test ::tcltest::cleanupTests } -package require Expect +load [lindex [glob libexpect*.so] 0] test logfile-1.1 {basic logfile} { set filename /tmp/logfile.[pid] --- expect-5.45.orig/tests/pid.test +++ expect-5.45/tests/pid.test @@ -9,7 +9,7 @@ # do this in a way that is backward compatible for Tcl 8.3 namespace import ::tcltest::test ::tcltest::cleanupTests } -package require Expect +load [lindex [glob libexpect*.so] 0] catch {unset x} --- expect-5.45.orig/tests/send.test +++ expect-5.45/tests/send.test @@ -9,7 +9,7 @@ # do this in a way that is backward compatible for Tcl 8.3 namespace import ::tcltest::test ::tcltest::cleanupTests } -package require Expect +load [lindex [glob libexpect*.so] 0] log_user 0 --- expect-5.45.orig/tests/spawn.test +++ expect-5.45/tests/spawn.test @@ -9,7 +9,7 @@ # do this in a way that is backward compatible for Tcl 8.3 namespace import ::tcltest::test ::tcltest::cleanupTests } -package require Expect +load [lindex [glob libexpect*.so] 0] log_user 0 --- expect-5.45.orig/tests/stty.test +++ expect-5.45/tests/stty.test @@ -9,7 +9,7 @@ # do this in a way that is backward compatible for Tcl 8.3 namespace import ::tcltest::test ::tcltest::cleanupTests } -package require Expect +load [lindex [glob libexpect*.so] 0] #exp_internal -f /dev/ttyp5 0 debian/patches/09-unsafe-traps.patch0000644000000000000000000000077311623000135014472 0ustar Author: n/a Description: Fixes some unsafe traps. --- expect-5.45.orig/exp_trap.c +++ expect-5.45/exp_trap.c @@ -264,6 +264,18 @@ #if defined(SIGSTOP) traps[SIGSTOP].reserved = TRUE; #endif +#if defined(SIGSEGV) + traps[SIGSEGV].reserved = TRUE; +#endif +#if defined(SIGBUS) + traps[SIGBUS].reserved = TRUE; +#endif +#if defined(SIGILL) + traps[SIGILL].reserved = TRUE; +#endif +#if defined(SIGFPE) + traps[SIGFPE].reserved = TRUE; +#endif async_handler = Tcl_AsyncCreate(tophalf,(ClientData)0); debian/patches/series0000644000000000000000000000044312235621360012033 0ustar 01-example-shebang.patch 02-example-cryptdir.patch 05-makefile-soname.patch 06-pkgindex.patch 07-file-handle.patch 09-unsafe-traps.patch 10-manpage.patch 11-ttyname.patch 12-fdout.patch 13-implicit-defs.patch 16-logfile.patch 18-non-linux.patch 22-segfault-with-stubs.patch 23-memmove.patch debian/patches/23-memmove.patch0000644000000000000000000000111612235621360013524 0ustar Author: Per Cederqvist Description: Fix for copying overlapping memory area. Last-Modified: Mon, 04 Nov 2013 08:23:51 +0400 Bug-Debian: http://bugs.debian.org/728663 Bug: https://sourceforge.net/p/expect/patches/16/ --- a/expect.c +++ b/expect.c @@ -1094,7 +1094,7 @@ /* shift remaining elements down */ /* but only if there are any left */ if (i+1 != ecmd->ecd.count) { - memcpy(&ecmd->ecd.cases[i], + memmove(&ecmd->ecd.cases[i], &ecmd->ecd.cases[i+1], ((ecmd->ecd.count - i) - 1) * sizeof(struct exp_cmd_descriptor *)); debian/patches/10-manpage.patch0000644000000000000000000002741211623000135013461 0ustar Author: n/a Description: Fixes sample expect shebang and excapes dashes. --- expect-5.45.orig/expect.man +++ expect-5.45/expect.man @@ -108,11 +108,11 @@ may also be invoked implicitly on systems which support the #! notation by marking the script executable, and making the first line in your script: - #!/usr/local/bin/expect \-f + #!/usr/bin/expect \-f Of course, the path must accurately describe where .B Expect -lives. /usr/local/bin is just an example. +lives. /usr/bin is just an example. The .B \-c @@ -173,7 +173,8 @@ .B \-b flag. (When using Expectk, this option is specified as -.BR \-buffer .) Note that stdio-buffering may still take place however this shouldn't cause problems when reading from a fifo or stdin. +.BR \-buffer .) Note that stdio-buffering may still take place however this +shouldn't cause problems when reading from a fifo or stdin. .PP If the string "\-" is supplied as a filename, standard input is read instead. (Use "./\-" to read from a file actually named "\-".) @@ -207,7 +208,7 @@ original arguments (including the script name) in the variable .IR argv . - #!/usr/local/bin/expect \-\- + #!/usr/bin/expect \-\- Note that the usual getopt(3) and execve(2) conventions must be observed when adding arguments to the #! line. @@ -291,7 +292,7 @@ program.) .I .TP 6 -.BI close " [-slave] [\-onexec 0|1] [\-i spawn_id]" +.BI close " [\-slave] [\-onexec 0|1] [\-i spawn_id]" closes the connection to the current process. Most interactive programs will detect EOF on their stdin and exit; thus @@ -320,7 +321,7 @@ The .B \-slave -flag closes the slave associated with the spawn id. (See "spawn -pty".) +flag closes the slave associated with the spawn id. (See "spawn \-pty".) When the connection is closed, the slave is automatically closed as well if still open. @@ -337,7 +338,7 @@ .B wait below for more info. .TP -.BI debug " [[-now] 0|1]" +.BI debug " [[\-now] 0|1]" controls a Tcl debugger allowing you to step through statements, set breakpoints, etc. @@ -355,7 +356,7 @@ The .B debug command does not change any traps. Compare this to starting Expect with the -.B -D +.B \-D flag (see above). See the README file or SEE ALSO (below) @@ -385,7 +386,7 @@ .nf send_user "password?\\ " - expect_user -re "(.*)\\n" + expect_user \-re "(.*)\\n" for {} 1 {} { if {[fork]!=0} {sleep 3600;continue} disconnect @@ -452,7 +453,7 @@ .B exit is implicitly executed if the end of the script is reached. .TP -\fBexp_continue\fR [-continue_timer] +\fBexp_continue\fR [\-continue_timer] The command .B exp_continue allows @@ -462,7 +463,7 @@ default .B exp_continue resets the timeout timer. The -.I -continue_timer +.I \-continue_timer flag prevents timer from being restarted. (See .B expect for more information.) @@ -625,8 +626,8 @@ be used to protect patterns that might otherwise match .B expect flags from doing so. -Any pattern beginning with a "-" should be protected this way. (All strings -starting with "-" are reserved for future options.) +Any pattern beginning with a "\-" should be protected this way. (All strings +starting with "\-" are reserved for future options.) .IP For example, the following fragment looks for a successful login. @@ -733,7 +734,7 @@ through .IR expect_out(9,string) . If the -.B -indices +.B \-indices flag is used before a pattern, the starting and ending indices (in a form suitable for .BR lrange ) @@ -780,7 +781,7 @@ set expect_out(buffer) abbbcabkkkk .fi -and "a\\n" is left in the output buffer. The pattern "*" (and -re ".*") will +and "a\\n" is left in the output buffer. The pattern "*" (and \-re ".*") will flush the output buffer without reading any more output from the process. .IP @@ -788,7 +789,7 @@ This may be prevented by prefixing a pattern with the .B \-notransfer flag. This flag is especially useful in experimenting (and can be -abbreviated to "-not" for convenience while experimenting). +abbreviated to "\-not" for convenience while experimenting). The spawn id associated with the matching output (or eof or full_buffer) is stored in @@ -872,9 +873,9 @@ expect { Password: { - stty -echo + stty \-echo send_user "password (for $user) on $host: " - expect_user -re "(.*)\\n" + expect_user \-re "(.*)\\n" send_user "\\n" send "$expect_out(1,string)\\r" stty echo @@ -889,7 +890,7 @@ send_user \\ "connection to host failed: $expect_out(buffer)" exit - } -re $prompt + } \-re $prompt } .fi @@ -1021,14 +1022,14 @@ By default, it reports on the current spawn id. An optional spawn id specification may be given for information on that spawn id. For example .nf - expect_before -info -i $proc + expect_before \-info \-i $proc .fi At most one spawn id specification may be given. The flag \-indirect suppresses direct spawn ids that come only from indirect specifications. -Instead of a spawn id specification, the flag "-all" will cause -"-info" to report on all spawn ids. +Instead of a spawn id specification, the flag "\-all" will cause +"\-info" to report on all spawn ids. The output of the \-info flag can be reused as the argument to expect_before. .TP @@ -1121,7 +1122,7 @@ .ta \w' interact 'u +\w'$CTRLZ 'u +\w'{'u set CTRLZ \\032 interact { - -reset $CTRLZ {exec kill \-STOP [pid]} + \-reset $CTRLZ {exec kill \-STOP [pid]} \\001 {send_user "you typed a control\-A\\n"; send "\\001" } @@ -1150,8 +1151,8 @@ flag may be used to protect patterns that might otherwise match .B interact flags from doing so. -Any pattern beginning with a "-" should be protected this way. (All strings -starting with "-" are reserved for future options.) +Any pattern beginning with a "\-" should be protected this way. (All strings +starting with "\-" are reserved for future options.) The .B \-re @@ -1197,7 +1198,7 @@ messages: .nf - interact -input $user_spawn_id timeout 3600 return -output \\ + interact \-input $user_spawn_id timeout 3600 return \-output \\ $spawn_id .fi @@ -1296,9 +1297,9 @@ .nf interact { - -echo ~g {getcurdirectory 1} - -echo ~l {getcurdirectory 0} - -echo ~p {putcurdirectory} + \-echo ~g {getcurdirectory 1} + \-echo ~l {getcurdirectory 0} + \-echo ~p {putcurdirectory} } .fi @@ -1314,11 +1315,11 @@ .nf proc lognumber {} { - interact -nobuffer -re "(.*)\\r" return + interact \-nobuffer \-re "(.*)\\r" return puts $log "[clock format [clock seconds]]: dialed $interact_out(1,string)" } - interact -nobuffer "atd" lognumber + interact \-nobuffer "atd" lognumber .fi .IP @@ -1389,7 +1390,7 @@ command, except that any_spawn_id is not meaningful in .BR interact .) All following flags and -strings (or patterns) apply to this input until another -input flag appears. +strings (or patterns) apply to this input until another \-input flag appears. If no .B \-input appears, @@ -1427,7 +1428,7 @@ It is possible to change the processes that are being interacted with by using indirect spawn ids. (Indirect spawn ids are described in the section on the expect command.) Indirect spawn ids may be specified -with the -i, -u, -input, or -output flags. +with the \-i, \-u, \-input, or \-output flags. .TP .B interpreter " [args]" causes the user to be interactively prompted for @@ -1513,18 +1514,18 @@ flag. The -.B -info +.B \-info flag causes log_file to return a description of the most recent non-info arguments given. .TP -.BI log_user " -info|0|1" +.BI log_user " \-info|0|1" By default, the send/expect dialogue is logged to stdout (and a logfile if open). The logging to stdout is disabled by the command "log_user 0" and reenabled by "log_user 1". Logging to the logfile is unchanged. The -.B -info +.B \-info flag causes log_user to return a description of the most recent non-info arguments given. .TP @@ -1645,7 +1646,7 @@ Any string can be preceded by "\-\-" whether or not it actually looks like a flag. This provides a reliable mechanism to specify variable strings without being tripped up by those that accidentally look like flags. -(All strings starting with "-" are reserved for future options.) +(All strings starting with "\-" are reserved for future options.) The .B \-i @@ -1669,7 +1670,7 @@ The .B \-break flag generates a break condition. This only makes sense if the spawn -id refers to a tty device opened via "spawn -open". If you have +id refers to a tty device opened via "spawn \-open". If you have spawned a process such as tip, you should use tip's convention for generating a break. @@ -1772,7 +1773,7 @@ except that the output is sent to stderr rather than the current process. .TP -.BI send_log " [\--] string" +.BI send_log " [\-\-] string" is like .BR send , except that the string is only sent to the log file (see @@ -1949,7 +1950,7 @@ The variable .I spawn_out(slave,fd) is set to a file identifier corresponding to the pty slave. -It can be closed using "close -slave". +It can be closed using "close \-slave". The .B \-ignore @@ -1976,7 +1977,7 @@ .fi The -.B -info +.B \-info flag causes strace to return a description of the most recent non-info arguments given. .TP @@ -2016,7 +2017,7 @@ stty \-echo send_user "Password: " - expect_user -re "(.*)\\n" + expect_user \-re "(.*)\\n" set password $expect_out(1,string) stty echo @@ -2151,7 +2152,7 @@ trap exit {SIGINT SIGTERM} .fi -If you use the -D flag to start the debugger, SIGINT is redefined +If you use the \-D flag to start the debugger, SIGINT is redefined to start the interactive debugger. This is due to the following trap: .nf @@ -2192,9 +2193,9 @@ normally returns a list of four integers. The first integer is the pid of the process that was waited upon. The second integer is the corresponding spawn id. -The third integer is -1 if an operating system error occurred, or 0 otherwise. +The third integer is \-1 if an operating system error occurred, or 0 otherwise. If the third integer was 0, the fourth integer is the status returned by -the spawned process. If the third integer was -1, the fourth integer is +the spawned process. If the third integer was \-1, the fourth integer is the value of errno set by the operating system. The global variable errorCode is also set. @@ -2210,7 +2211,7 @@ flag declares the process to wait corresponding to the named spawn_id (NOT the process id). Inside a SIGCHLD handler, -it is possible to wait for any spawned process by using the spawn id -1. +it is possible to wait for any spawned process by using the spawn id \-1. The .B \-nowait @@ -2221,7 +2222,7 @@ The .B wait command may also be used wait for a forked process using the arguments -"-i -1". Unlike its use with spawned processes, this command can be +"\-i \-1". Unlike its use with spawned processes, this command can be executed at any time. There is no control over which process is reaped. However, the return value can be checked for the process id. @@ -2372,7 +2373,7 @@ .nf set env(SHELL) /bin/sh - set env(HOME) /usr/local/bin + set env(HOME) /usr/bin .fi @@ -2425,7 +2426,7 @@ to set a flag in the trap code. Then check the flag immediately after the command (i.e., sleep). -The expect_background command ignores -timeout arguments and has no +The expect_background command ignores \-timeout arguments and has no concept of timeouts in general. .SH "EXPECT HINTS" @@ -2447,7 +2448,7 @@ set prompt "(%|#|\\\\$) $" ;# default prompt catch {set prompt $env(EXPECT_PROMPT)} - expect -re $prompt + expect \-re $prompt .fi I encourage you to write debian/patches/18-non-linux.patch0000644000000000000000000000046611623000135014010 0ustar Author: Sergei Golovan Description: Fixes build for non-linux Debian architectures. --- expect-5.45.orig/tclconfig/tcl.m4 +++ expect-5.45/tclconfig/tcl.m4 @@ -1521,7 +1521,7 @@ ]) ]) ;; - Linux*) + Linux*|GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" debian/patches/22-segfault-with-stubs.patch0000644000000000000000000000327011654721760016013 0ustar Author: Sergei Golovan Description: This dirty hack fixes segfaults if Tcl is built with stubs and Expect is used directly from C program. Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588817 Example: #include #include int main() { FILE *pipe; char *some_command = "uname"; char datum; pipe = exp_popen(some_command); if (pipe == NULL) return 1; while ((datum = getc (pipe)) != EOF) printf("%c",datum); } Example: #include #include "expect.h" main() { int fd = 0; fd = exp_spawnl("echo", "echo", "Hello User: Whats up?", (char*) 0); switch (exp_expectl(fd, exp_regexp, "ser:", 1, exp_end)) { case 1: { printf("GOT ser:\n"); break; } default: { printf("DEFAULT\n"); return 1; } } printf("Normal Exit\n"); return 0; } --- expect-5.45.orig/exp_clib.c +++ expect-5.45/exp_clib.c @@ -117,7 +117,11 @@ #include /* for malloc */ #endif -#include +#define ckalloc(x) Tcl_Alloc(x) +#define ckfree(x) Tcl_Free(x) +extern char *Tcl_ErrnoMsg(int err); +extern char *Tcl_Alloc(unsigned int size); +extern void Tcl_Free(char *ptr); #include "expect.h" #define TclRegError exp_TclRegError @@ -389,7 +389,7 @@ FAIL("regexp too big"); /* Allocate space. */ - r = (regexp *)ckalloc(sizeof(regexp) + (unsigned)rcstate->regsize); + r = (regexp *)malloc(sizeof(regexp) + (unsigned)rcstate->regsize); if (r == NULL) FAIL("out of space"); @@ -399,7 +399,7 @@ rcstate->regcode = r->program; regc(MAGIC, rcstate); if (reg(0, &flags, rcstate) == NULL) { - ckfree ((char*) r); + free ((char*) r); return(NULL); } debian/patches/11-ttyname.patch0000644000000000000000000000167111623000135013532 0ustar Author: Ian Jackson Description: Check before call ttyname, so don't coredump in chroots without /proc (Closes: #440804). --- expect-5.45.orig/pty_termios.c +++ expect-5.45/pty_termios.c @@ -369,6 +369,17 @@ #define W_OK 02 #endif +static int ttyname_checked(int fd) { + const char *result; + result= ttyname(fd); + if (!result) { + perror("expect: pty_termios: system configuration problem:" + " ttyname() failed"); + exit(-1); + } + return result; +} + int exp_getptymaster() { @@ -454,7 +465,7 @@ master = open("/dev/ptc",O_RDWR); if (master >= 0) { /* never fails */ - slave_name = ttyname(master); + slave_name = ttyname_checked(master); } exp_pty_slave_name = slave_name; return(master); @@ -475,7 +486,7 @@ close(slave); return -1; } - strcpy(slave_name, ttyname(slave)); + strcpy(slave_name, ttyname_checked(slave)); exp_pty_slave_name = slave_name; close(slave); return master; debian/control0000644000000000000000000000351012261307433010571 0ustar Source: expect Section: interpreters Priority: optional Maintainer: Sergei Golovan Build-Depends: debhelper (>= 8.0.0), dpkg-dev (>= 1.16.1~), autotools-dev, autoconf, tcl8.6-dev Build-Conflicts: autoconf2.13 Standards-Version: 3.9.4 Homepage: http://sourceforge.net/projects/expect/ Package: expect Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends} Conflicts: expectk (<< 5.45) Description: Automates interactive applications Expect is a tool for automating interactive applications according to a script. Following the script, Expect knows what can be expected from a program and what the correct response should be. Expect is also useful for testing these same applications. And by adding Tk, you can also wrap interactive applications in X11 GUIs. An interpreted language provides branching and high-level control structures to direct the dialogue. In addition, the user can take control and interact directly when desired, afterward returning control to the script. Package: expect-dev Section: devel Architecture: any Depends: ${misc:Depends}, expect (= ${binary:Version}), tcl8.6-dev Replaces: expect (<< 5.44.1.14) Recommends: tk8.6-dev Description: Automates interactive applications (development) Expect is a tool for automating interactive applications according to a script. Following the script, Expect knows what can be expected from a program and what the correct response should be. Expect is also useful for testing these same applications. And by adding Tk, you can also wrap interactive applications in X11 GUIs. An interpreted language provides branching and high-level control structures to direct the dialogue. In addition, the user can take control and interact directly when desired, afterward returning control to the script. . This package contains the development files and examples. debian/expect-dev.links0000644000000000000000000000341311623000135012264 0ustar /usr/bin/expect_autoexpect /usr/bin/autoexpect /usr/bin/expect_autopasswd /usr/bin/autopasswd /usr/bin/expect_cryptdir /usr/bin/cryptdir /usr/bin/expect_decryptdir /usr/bin/decryptdir /usr/bin/expect_dislocate /usr/bin/dislocate /usr/bin/expect_ftp-rfc /usr/bin/ftp-rfc /usr/bin/expect_kibitz /usr/bin/kibitz /usr/bin/expect_lpunlock /usr/bin/lpunlock #/usr/bin/expect_mkpasswd /usr/bin/mkpasswd /usr/bin/expect_multixterm /usr/bin/multixterm /usr/bin/expect_passmass /usr/bin/passmass #/usr/bin/expect_rftp /usr/bin/rftp /usr/bin/expect_rlogin-cwd /usr/bin/rlogin-cwd /usr/bin/expect_timed-read /usr/bin/timed-read /usr/bin/expect_timed-run /usr/bin/timed-run /usr/bin/expect_tknewsbiff /usr/bin/tknewsbiff /usr/bin/expect_tkpasswd /usr/bin/tkpasswd /usr/bin/expect_unbuffer /usr/bin/unbuffer #/usr/bin/expect_weather /usr/bin/weather /usr/bin/expect_xkibitz /usr/bin/xkibitz /usr/bin/expect_xpstat /usr/bin/xpstat /usr/lib/libexpect.so.5.45 /usr/lib/libexpect.so /usr/share/man/man1/expect_autoexpect.1.gz /usr/share/man/man1/autoexpect.1.gz /usr/share/man/man1/expect_cryptdir.1.gz /usr/share/man/man1/cryptdir.1.gz /usr/share/man/man1/expect_decryptdir.1.gz /usr/share/man/man1/decryptdir.1.gz /usr/share/man/man1/expect_dislocate.1.gz /usr/share/man/man1/dislocate.1.gz /usr/share/man/man1/expect_kibitz.1.gz /usr/share/man/man1/kibitz.1.gz #/usr/share/man/man1/expect_mkpasswd.1.gz /usr/share/man/man1/mkpasswd.1.gz /usr/share/man/man1/expect_multixterm.1.gz /usr/share/man/man1/multixterm.1.gz /usr/share/man/man1/expect_passmass.1.gz /usr/share/man/man1/passmass.1.gz /usr/share/man/man1/expect_tknewsbiff.1.gz /usr/share/man/man1/tknewsbiff.1.gz /usr/share/man/man1/expect_unbuffer.1.gz /usr/share/man/man1/unbuffer.1.gz /usr/share/man/man1/expect_xkibitz.1.gz /usr/share/man/man1/xkibitz.1.gz debian/rules0000755000000000000000000000440612261307567010263 0ustar #!/usr/bin/make -f v = 5.45 tclv = 8.6 DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk %: dh ${@} CFLAGS = -Wall -g -D_BSD_SOURCE -ansi -D_SVID_SOURCE -D_POSIX_SOURCE override_dh_auto_clean: dh_auto_clean rm -f *.a *.o rm -rf shared rm -f expect_cf.h tcldbgcf.h [ ! -f tclconfig/config.guess~ ] || mv -f tclconfig/config.guess~ tclconfig/config.guess [ ! -f tclconfig/config.sub~ ] || mv -f tclconfig/config.sub~ tclconfig/config.sub [ ! -f configure~ ] || mv -f configure~ configure [ ! -f testsuite/Makefile ] || $(MAKE) -C testsuite distclean override_dh_auto_configure: cp -f configure configure~ cp -fb /usr/share/misc/config.guess tclconfig/config.guess cp -fb /usr/share/misc/config.sub tclconfig/config.sub autoconf dh_auto_configure -- --includedir=/usr/include/tcl$(tclv) \ --with-tcl=/usr/lib/tcl$(tclv) \ --with-tk=/usr/lib/tk$(tclv) \ --with-tclinclude=/usr/include/tcl$(tclv) \ --with-tkinclude=/usr/include/tcl$(tclv) \ --enable-shared \ --enable-threads \ --disable-rpath \ CFLAGS="$(CFLAGS)" override_dh_auto_build: $(MAKE) SONAME=libexpect.so.$(v) override_dh_auto_install: $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install # Renaming expect scripts for SCRIPT in debian/tmp/usr/bin/*; do \ if [ "`basename $$SCRIPT`" != "expect" ] ; then \ sed -e 's/^exec tclsh /exec tclsh$(tclv) /' $$SCRIPT >`dirname $$SCRIPT`/expect_`basename $$SCRIPT`; \ rm $$SCRIPT ; \ fi; \ done for MANPAGE in debian/tmp/usr/share/man/man1/*; do \ if [ "`basename $$MANPAGE`" != "expect.1" ] ; then \ mv $$MANPAGE `dirname $$MANPAGE`/expect_`basename $$MANPAGE`; \ fi; \ done # Fixing library name mv debian/tmp/usr/lib/expect$(v)/libexpect$(v).so debian/tmp/usr/lib/libexpect.so.$(v) mkdir -p -m 755 debian/tmp/usr/lib/tcltk mv debian/tmp/usr/lib/expect$(v) debian/tmp/usr/lib/tcltk # Fixing permissions chmod 0644 debian/tmp/usr/lib/tcltk/expect$(v)/pkgIndex.tcl override_dh_install: dh_install --fail-missing get-orig-source: wget -O expect_$(v).orig.tar.gz \ http://prdownloads.sourceforge.net/expect/expect$(v).tar.gz .PHONY: override_dh_auto_clean override_dh_auto_configure override_dh_auto_build \ override_dh_auto_install override_dh_install get-orig-source debian/source/0000755000000000000000000000000012235621525010471 5ustar debian/source/format0000644000000000000000000000001412141673052011675 0ustar 3.0 (quilt) debian/expect.lintian-overrides0000644000000000000000000000005211266146442014041 0ustar expect: package-name-doesnt-match-sonames