How do I export list of patches defined in a patch baseline.

I need to correlate a list of required patches with a list of patches in a patch baseline. Problem is, I cannot sort or copy/paste the list of patches in the detail view in the console. Is there a way from the CLI I can export a list of component patches in a patch baseline?Or maybe a config file that defines the member patches of a baseline?

Thanks.

[366 byte] By [jtej5439a] at [2007-11-27 8:12:49]
# 1

Hi

Have you attempted a simple

# smpatch analyze

on a fresh system - this should output the list and required patches for a "start state" provided the 'smpatch get' output shows you have selected the desired baseline during the configuration?

Additionally if you have a look in /var/sadm/patch directory there should be a list of applied patches which you could use from a system you know is at the baseline you chose.

Mod.

ForumModeratora at 2007-7-12 19:57:15 > top of Java-index,Administration Tools,Sun Update Connection-Enterprise Forum...
# 2
What does smpatch have to do with UCE? This is the forum for UCE isn't it?
jtej5439a at 2007-7-12 19:57:15 > top of Java-index,Administration Tools,Sun Update Connection-Enterprise Forum...
# 3

Hi

We are looking through the documentation at the present tim but have not at the moment found away for this to be done. However You may wish to try the following link:

http://www.sun.com/bigadmin/features/hub_articles/cgi_baseline.jsp

You could try to use the script and try to down load the baseline as the script will list the patches in the baseline before the download. then copy then to a file and compare the two that we.

We will however continue to look for away this can be done via the command line.

ForumModeratora at 2007-7-12 19:57:15 > top of Java-index,Administration Tools,Sun Update Connection-Enterprise Forum...
# 4

Yes, if you look at the above article for instructions on how to install the baseline_precache.cgi script, you can download the cgi and modify it slightly to just list the patches in a baseline instead of actually downloading each of them as well.

I don't see a way to post the modified version of that script to this forum, but all I did was copy the file to another one called baseline_list.cgi and comment out a large section of the script that does the actual downloading of that patches so all it does is print them out to the screen. Starting at line 536...

# diff baseline_list.cgi baseline_precache.cgi

536,605c536,605

< #if ret = self.PUBLIC_BLOBS:

< self.writeLog( "%s %s" %(patch, self.MSG_ALREADY_CACHED) )

< msg = self.MSG_ALREADY_CACHED

< #elif ret == self.PRIVATE_BLOBS:

<#self.writeLog( "%s %s" %(patch, self.MSG_ALREADY_UPLOADED) )

<#msg = self.MSG_ALREADY_UPLOADED

< #else:

<#self.writeLog("downloading %s" %patch)

<#msg = self.MSG_DOWNLOADING_STATUS

<#result = []

<#flag = 3

<#if flag == 1: #fork

< #self.run_in_fork(self.DOWNLOAD_CGI, str(patch), '')

<#elif flag == 2: #_work / popen

< #cmd = "%s %s ''" %(self.DOWNLOAD_CGI, patch)

< #result = self._work(tuple(cmd.split()))

<#elif flag == 3: #batch

< #write_to_script = False

< #chmod_status = False

< #precache_script = "%s.%s.%s" %(self.PRECACHE_SCRIPT, os.getpid(), patch)

< #precache_out = "%s.%s.%s" %(self.SCRIPT_OUT, os.getpid(), patch)

< #try:

< #f = open(precache_script, 'w')

< #write_to_script = True

< #except Exception, e:

< #self.writeError( "error in opening file %s : %s" %(precache_script, e) )

< #if write_to_script:

< #f.write("#! /bin/sh \n cd %s \n %s %s '' 2>&1 > %s" %(self.CGI_BIN_DIR,

<#self.DOWNLOAD_CGI, patch, precache_out))

< #f.close()

< #try:

<#os.chmod(precache_script, 0777)

<#chmod_status = True

< #except Exception, e:

<#self.writeError( "error in chmod file %s : %s" %(precache_script, e) )

< #if chmod_status:

< #self.run_in_fork(precache_script)

< #try:

< #f = open(precache_out)

< #result = f.readlines()

< #f.close()

< #except Exception, e:

< #self.writeError( "error in opening file %s : %s" %(precache_script, e) )

< #result = []

< #self.putResultIntoLog(patch, result)

< #ret = self.whereIsTheFile(channel, patch)

< #if ret == self.PUBLIC_BLOBS:

< #msg = self.MSG_DOWNLOAD_SUCCESS #or already cached

< #elif ret == self.PRIVATE_BLOBS:

< #msg = self.MSG_ALREADY_UPLOADED

< #else:

< #msg = self.MSG_DOWNLOAD_FAILED

< #self.writeLog( "failed to download %s" %patch)

< #p = str(patch)

< #if self.download_errors.has_key(p):

<#err_code = str(self.download_errors[p])

<#if self.error_messages.has_key(err_code):

< #details = self.error_messages[err_code]

<#else:

< #self.writeLog( "error_messages doesn't have the key for %s" %err_code)

< #else:

<#self.writeLog( "download_errors doesn't have the key for _%s_" %p )

< #try:

< #os.remove(precache_script)

< #except Exception, e:

< #self.writeLog( "cannot remove _%s_" %precache_script )

< #try:

< #os.remove(precache_out)

< #except Exception, e:

< #self.writeLog( "cannot remove _%s_" %precache_out )

dougsca at 2007-7-12 19:57:15 > top of Java-index,Administration Tools,Sun Update Connection-Enterprise Forum...
# 5
Thanks for posting that Doug. I ended up doing it a little differently but that is a good option. I just piped the output while the patches downloaded and stripped out the patch ID's. Your method would definitely save the download time.
jtej5439a at 2007-7-12 19:57:15 > top of Java-index,Administration Tools,Sun Update Connection-Enterprise Forum...