Discussion:
[rancid] Ubuntu 8.04 LTS, rancid, and Expect 5.43.0-14
Chris Gauthier
2008-08-29 20:55:04 UTC
Permalink
Hi all,



In trying to track down what was ultimately a typing problem in front of
the keyboard, I've developed a set of steps to include the expect patch
in Ubuntu 8.04 LTS (Server Ed)'s expect package. I've also tried to
submit this to the maintainer of the package, so we shall see what
happens.



A handy page I referred to for compiling packages:

http://www.cyberciti.biz/faq/rebuilding-ubuntu-debian-linux-binary-packa
ge/



Here are the steps:



1) ***@test:~$ sudo apt-get install build-essential fakeroot
dpkg-dev

2) ***@test:~$ cd /usr/src/

3) ***@test:/usr/src$ sudo apt-get source expect

4) ***@test:/usr/src$ cd expect-5.43.0/

5) ***@test:/usr/src/expect-5.43.0$ sudo patch <
~/expect-rancid-ubuntu804lts.patch

a. Patch contents:

--- exp_chan.c.bak 2008-08-29 11:46:51.000000000 -0700

+++ exp_chan.c 2008-08-29 12:14:28.000000000 -0700

@@ -200,6 +200,11 @@

* nonblocking, the read will never block.

*/



+ /* Added next line as a patch to make rancid work. There is a
know bug

+ * with expect and rancid.

+ * See http://www.shrubbery.net/rancid/EXPECTBUG for details.

+ */

+ fcntl(esPtr->fdin, F_SETFL, O_NONBLOCK); /* patched line for
rancid */

bytesRead = read(esPtr->fdin, buf, (size_t) toRead);

/*printf("ExpInputProc: read(%d,,) =
%d\r\n",esPtr->fdin,bytesRead);*/

if (bytesRead > -1) {

6) ***@test:/usr/src/expect-5.43.0$ cd ..

7) ***@test:/usr/src$ sudo apt-get build-dep expect

a. Just say "yes" when it wants to install a ton of dependencies.
You need this for compiling.

8) ***@test$ sudo dpkg-buildpackage -rfakeroot -b

a. This step could take a while, depending on your processor speed
and memory for compiling.

b. Don't worry about the package signature errors at the end.
You're not the maintainer anyway. ;-)

9) ***@test:/usr/src$ sudo /usr/bin/dpkg -i
expect_5.43.0-14_amd64.deb

a. Your actual filename may differ, depending on architecture.
Adapt and move on.

(Reading database ... 46139 files and directories currently installed.)

Preparing to replace expect 5.43.0-14 (using expect_5.43.0-14_amd64.deb)
...

Unpacking replacement expect ...

Setting up expect (5.43.0-14) ...



Processing triggers for libc6 ...

ldconfig deferred processing now taking place

10) That's it! You're package is installed with a patched version of
Expect.



Chris Gauthier, CCNA

Network Administrator

Marion and Polks Schools Credit Union

Loading...