Operating System - HP-UX
1755013 Members
3151 Online
108828 Solutions
New Discussion юеВ

Create a SD patch who erase a directory completly

 
koff
Frequent Advisor

Create a SD patch who erase a directory completly

Hi, I created a patch who replace somes file, for example

file /tmp/vrfy.ksh /my_tmp/vrfy.ksh

the /tmp/vrfy.ksh patch the /my_tmp/vrfy.ksh and the original /my_tmp/vrfy.ksh file will be save in the /var/adm/sw/save directory (for a future rollback).

But i want to erase a directory completly
for example:
in /my_tmp directory I have 2 file vrfy.ksh and vrfy2.ksh
I want to erase this directory with my directory /tmp who contain only one file
vrfy_new.ksh

When I wrote this
directory /tmp=/my_tmp
file *

After the installation of the patch, the vrfy.ksh and vrfy2.ksh always exists...
I want to remove them, but keep it in the /var/adm/sw/save directory for having the possibility to restore them after a rollback.

Anyone have a solution ?please...

Delphine.
2 REPLIES 2
John Payne_2
Honored Contributor

Re: Create a SD patch who erase a directory completly

Delphine,

Are you using Software package builder to build your patch? Whether you are or not, you can have SD run a script (pre-install, pre-configure, post-install, post-configure) that removes the file.

Hope it helps

John
Spoon!!!!
koff
Frequent Advisor

Re: Create a SD patch who erase a directory completly

I use the swpackage to build my SD patch.
I know that I can use postinstall.sd script to erase this file, but, when I rollback my patch, I want to restore all files even the erased files.
I try this solution but I don't know if it's correct:

In my PSF file:
directory /tmp=/my_tmp
file vrfy.ksh
# even if this file will be removed, I add it to force the saving of this file in SD directory
file vrf2.ksh

In my postinstall.sd script :
rm -f /tmp/vrf2.ksh

So after the SD patch installation, I have only one file (my patched file): vrfy.ksh

And When I rollback my patch, originals vrfy.ksh and vrfy├Г┬й.ksh were restored

This solution is correct ?
Because I add in my PSF a file which does not need to be patched (vrfy2.ksh) only to save it...

If anyone have another solution...

Thanks a lot

Delphin