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]

# 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 )