« Born a duck? | Main | Special Kiss »

September 22, 2005

Combining Solaris Patch Directories

Sometimes you might want to combined two patch directories. Imagine that you have a patch directory for say 9_Recommended and another directory for 9_SunAlert. You don't want to painfully sit through two patch runs, so why not combine them?

NOTE: I assume that you still have the original zipped downloads because I am going to trash one or both directories.

I start by renaming one directory so that I don't confuse it with a later download:
# mv 9_Recommended 9_Combined

Now I start fiddling in the 9_SunAlert directory:
# cd 9_SunAlert*
# for i in 1*
> do
>   j=`echo $i | cut -c1-6`
>   k=`echo $i | cut -c8-9`
>   [ -d ../9_Combined/$j-* ] && l=`ls -d ../9_Combined/$j-* | cut -c22-23` && [ $l -ge $k ] && rm -rf ./$i && echo "Removed $i ($l)"
> done

Now you will only have left the patches that are in this build and not the other build. They can be relocated and you will need to merge the patch_order files - an exercise left for the student :-)

Posted by Ozguru at September 22, 2005 06:00 AM


As a one liner:
for i in 1*; do j=`echo $i | cut -c1-6`; k=`echo $i | cut -c8-9`; [ -d ../9_Combined/$j-* ] && l=`ls -d ../9_Combined/$j-* | cut -c22-23` && [ $l -ge $k ] && rm -rf ./$i && echo "Removed $i ($l)"; done

Posted by: Rofl at September 22, 2005 11:49 AM

Didn't you also have some hack for making a patch install run faster on a new installation?

Posted by: Rofl [TypeKey Profile Page] at September 22, 2005 11:51 AM