Operating System - HP-UX
1832934 Members
2875 Online
110048 Solutions
New Discussion

How to copy/install a bunch of depot files

 
SOLVED
Go to solution
Alzhy
Honored Contributor

How to copy/install a bunch of depot files

I have a bunch (3-4 dozen) *.depot files in a directory. Is there an easy way to copy the to a software depot or install them?
Hakuna Matata.
4 REPLIES 4
Pete Randall
Outstanding Contributor
Solution

Re: How to copy/install a bunch of depot files

Like this:

mkdir /my_patch_depot
for i in PH*.depot
do
swcopy -s ${PWD}/$i /* @ /my_patch_depot
done

Then swinstall from /my_patch_depot.


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: How to copy/install a bunch of depot files

Hi Nelson:

Yes, use 'swcopy'.

To collect a series of patches into a depot the can be installed with a single reboot, simply download your patches into the /tmp directory; "un-shar" them and do:

# cd /tmp
# for X in PH*.htm
> do
> sh ${X}
> done

# PDIR=/tmp/patch_depot
# mkdir ${PDIR}
# for X in PH*.depot
> do
> swcopy -s ${PWD}/${X} \* @ ${PDIR}
> done

# swlist -s ${PDIR}

There is no need to register the depot with 'swreg'. This is done automatically by 'swcopy'. The 'swlist' allows you to preview the depot's contents. You can also run 'swinstall' in preview mode to perform a depot software analysis too.

The 'swcopy' syntax shown above can be modified to specify '-x enforce_dependencies=false'. This forces 'swcopy' to ignore dependency verification until the actual 'swinstall' analysis phase. This is very useful when you do not want to download dependency patches because you know that you already have on your server.

Regards!

...JRF...
Alzhy
Honored Contributor

Re: How to copy/install a bunch of depot files

Many thanks!

Using ITRC is much faster/fruitfull than reading the Docu's...
Hakuna Matata.
Kevin Wright
Honored Contributor

Re: How to copy/install a bunch of depot files

Here's a little script for you.

#!/bin/ksh
# this script will make a single depot to install
# several patches as once
# copy your patches into the directory "/tmp/patches"
# ****************************
export DEP_DIR=/tmp/patches_depot
export DIR=/tmp/patch
cd $DIR
for patch in `ls /tmp/patch`
do
sh $DIR/$patch
done

if [[ -d $DEP_DIR ]];then
echo "$DEP_DIR exists, will remove previous depots"
echo "Do you want the directory removed"\c
read answer
if [[ $answer = Y || $answer = y ]];then
rm -rf $DEP_DIR
else
echo "please remove the directory and restart this script"
exit
fi
fi
echo "making $DEP_DIR"
mkdir -p $DEP_DIR

echo "running swcopy"
for X in `ls $DIR |grep .depot`
do
echo "running swcopy -s $DIR/$X \* @ $DEP_DIR"
swcopy -s $DIR/$X \* @ $DEP_DIR
done

echo "here is a display of all the patches in the depot $DEP_DIR"
swlist -s $DEP_DIR