SUMMARY: Automate patchkit baselining?

From: Iain Barker (ibarker@aastra.com)
Date: Wed Jun 18 2003 - 09:45:45 EDT


Thanks to Michael Butow for the offer of his scripts to use as a basis, and
the recommendation to use cygnus precompiled expect binaries for Tru64.

I was already well into burning the midnight oil on this and managed to hack
up a script - I won't claim it is elegant or very robust against errors, but
it serves the needs for me to upgrade our systems in a one stop automated
script, so it is 'good enough' for us.

The only really trick part is the syntax for regex matching, which took a
few iterations to get right. Anyway, for future reference by anyone who is
interested, the script is below.

Note also I am running Tru64 4.0f and located an old binary version of the
expect package on an early copy of the HP open source software collection.
The script is simple enough not to need a later version.

thanks.

- Iain

# Enough for 60 mins of patching activity
set timeout 3600
match_max 100000

spawn /var/tmp/patch_kit/dupatch

expect "Enter path to the top of the patch distribution"
send -- "/var/tmp/patch_kit\r"

expect "5) Patch Baseline Analysis/Adjustment"
expect "Enter your choice:"
send -- "5\r"

expect {
        "Press RETURN to get back to the Main Menu"
                                { send -- "\r" }
        "Press ENTER" { send -- "\r" ; exp_continue }
        "Press <ENTER>" { send -- "\r" ; exp_continue }
        "Press <RETURN>" { send -- "\r" ; exp_continue }
        "Press RETURN" { send -- "\r" ; exp_continue }
        "Do you want to" { send -- "y\r" ; exp_continue }
        "Is this correct" { send -- "y\r" ; exp_continue }
        -re "(.*)\n (.*)\\) ALL of the above(.*)"
                                { send $expect_out(2,string) ; send -- "\r"
; exp_continue }
        timeout { exit 1 }
        eof { exit 1 }
        }

expect "q) Quit"
expect "Enter your choice:"
send -- "q\r"
wait

exit 0

-----Original Message-----
From: Iain Barker
Sent: Tuesday, 17 June, 2003 18:33
To: tru64-unix-managers@ornl.gov
Subject: Automate patchkit baselining?

Does anyone know a method to automate patchkit baselining using dupatch?

I want to be able to remove all current patches, baseline the system using
dupatch, then apply a new patch set automatically via a script.

I can do the dupatch remove via a script in single user mode. And I can
apply the new patches using the command line options of dupatch. But it
appears that baselining is a manual process, chosing 'All of the above' for
the menu.

Anybody tried something like this using expect?

thanks.

Iain Barker



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:49:23 EDT