Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Removed package leaves the package folder - why ?

    Reply
    Schturman | # 1 | 2014-02-17, 19:53 | Report

    I don't know why, but uninstallation of all my packages deletes all files but leaves a folders of the packages. I can't understand why... In debian packages it was easy - deleted all what was installed.
    Here is a example of my .spec file. It's a simple package with only 3 files: .desktop, .png and aliendalvik-restart that located in /usr/share/jolla-adrestart folder. Only this folder leaves after uninstallation.
    (I know, I know the "jolla-" prefix is for jolla apps, it's just example of my first package)
    Code:
    Name:          adalvikrefresh
    Version:       0.3
    Release:       3
    Summary:       Alien Dalvik Refresh
    Group:         System/Tools
    Vendor:        Schturman
    Distribution:  SailfisfOS
    Packager: Schturman <schturman@hotmail.com>
    URL:           www.dhrider.co.cc
    
    License:       GPL
    
    %description
    Refresh buttom of Alien Dalvik service.
    
    %files
    /usr/share/applications/adalvikrefresh.desktop
    /usr/share/icons/hicolor/86x86/apps/aliendalvikrestart.png
    
    %defattr(4755,root,root)
    /usr/share/jolla-adrestart/aliendalvik-restart
    
    %changelog
    * Wed Jan 25 2014 Builder <builder@...> 0.1
    - First build.
    Can our experts tell me what wrong here please ?

    We tried with Coderus to find the reason, but without success

    I found one interesting explanation about postuninstall script (%postun): http://wiki.mandriva.com/en/Development/Howto/RPM
    Code:
    This will allow the programmer to distinguish different attitudes of his scripts depending on the operation: install or upgrade. 
     
    • For install scripts ( %post, %pre ) check if $1 is equal to "1" then it is a first time install, not an update.
    • For uninstall scripts ( %postun, %preun ) check if $1 is equal to "0", if yes then it is a full removal; if not it is either an upgrade or an install --force of the same package.
    Code:
    To test this argument, the following 'if' statement is used: 
     %postun
    if [ $1 = 0 ]; then
         // Do stuff specific to uninstalls
    fi
    if [ $1 = 1 ]; then
         // Do stuff specific to upgrades
    fi
    In this way I can add rm -rf /usr/share/jolla-adrestart to this %postun section and it will work perfectly. But I still don't know if this correct way to do for removing packages...
    Please any advice ?

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by Schturman; 2014-02-17 at 22:26.

     
vBulletin® Version 3.8.8
Normal Logout