Need to make rpm -e skip file deletes
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,421

    Need to make rpm -e skip file deletes

    I have an unusual rpm which in the post install scriptlet moves its files to /root/targetdir.
    The rpm doesn't just locate the files in /root/targetdir/ in the rpm itself because /root is owned by the "filesystem" package so I don't want to conflict with that.
    So the rpm spec %post and %postun basically does:

    Code:
    %post
    mkdir -p /root/target
    mv /file1 /root/target
    
    %postun
    rm -fr /root/target/

    The problem is when "rpm -e mypackage" is run, it sensibly complains that the file "/file1" is missing. So basically I want "rpm -e" on mypackage to only run the scriptlets but not try to remove the "/file1". The only work around (hack) I could see would be to just leave the original there by using 'cp ...' instead of 'mv ...'

    Code:
    %post
    mkdir -p /root/target
    cp -pf /file1 /root/target
    but I don't want that extraneous file there in /, another crude hack is to swap the file back in the %preun to make the rpm -e remove of the file happy:

    %preun
    mv /root/target/file1 /

    Since "%preun runs before rpm -e would try to remove the filebut I dislike that also. Is there some way to just tell rpm to skip the removing the file?

  2. #2
    Join Date
    Oct 2011
    Posts
    1,896

    Re: Need to make rpm -e skip file deletes

    I am not sure I understand you, why can't you install the file directly to /root directory, what makes you think you will run into conflicts?

  3. #3
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,421

    Re: Need to make rpm -e skip file deletes

    Quote Originally Posted by srakitnican
    I am not sure I understand you, why can't you install the file directly to /root directory, what makes you think you will run into conflicts?
    Figured it out and changed the rpm spec to use normal
    Namespacing using the %files tag. I assuming /root would be a conflict due it's nature.

Similar Threads

  1. 28 deletes and your cracked?
    By PatMcLJr in forum Security and Privacy
    Replies: 4
    Last Post: 20th December 2015, 01:40 PM
  2. How to make yum skip update
    By aaa33aaa in forum F-20 Development Forum
    Replies: 6
    Last Post: 20th October 2013, 05:08 PM
  3. Help !! Make deletes files
    By akernan in forum Using Fedora
    Replies: 3
    Last Post: 6th October 2008, 04:55 AM
  4. make file
    By munna_dude in forum Servers & Networking
    Replies: 1
    Last Post: 25th July 2007, 10:38 AM
  5. How to make RSYNC skip a directory
    By Archw in forum Using Fedora
    Replies: 4
    Last Post: 13th July 2006, 04:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •