[Kimchi-devel] [PATCH v2] Create empty files on rpm build

Ramon Medeiros ramonn at linux.vnet.ibm.com
Tue Apr 14 19:04:35 UTC 2015


On 04/13/2015 07:13 PM, Kevin Zander wrote:
> On Mon, 2015-04-13 at 17:19 -0300, Aline Manera wrote:
>>
>> On 13/04/2015 17:00, Crístian Viana wrote:
>>
>>> I tested this patch on Fedora 21 and, after removing Kimchi, some
>>> files were still left on the system.
>>>
>>>
>>> I installed the RPM, started the Kimchi server, stopped the server
>>> and then I removed the RPM. Here's the final output of my tests:
>> Yeap! I talked to Ramon about that.
>> Those 2 cert files are created automatically according to the user
>> configuration, ie, if the user provides them Kimchi will not generate
>> those files.
>> So they may exist or not on package removal.
>>
>>>
>>> [kimchi at localhost ~]$ ls /etc/kimchi/
>>> distros.d  kimchi-cert.pem  kimchi.conf  kimchi-key.pem
>>>   nginx.conf.in  nginx_kimchi.conf
>>> [kimchi at localhost ~]$ sudo yum remove kimchi
>>> [...]
>>> [kimchi at localhost ~]$ ls /etc/kimchi/
>>>
>>> kimchi-cert.pem  kimchi-key.pem
>>> [kimchi at localhost ~]$
> Why not use a %preun/%postun script in the spec file? Test for the
> existence of files that Kimchi can generate and remove accordingly.
>
>
RPM does not remove files (without force) if the file was not created by 
the rpm. Use a rm -rf on the postscripts can fix this, but it's not the 
best way. I guess this way now it's safer.

-- 
Ramon Nunes Medeiros
Kimchi Developer
Software Engineer - Linux Technology Center Brazil
IBM Systems & Technology Group
Phone : +55 19 2132 7878
ramonn at br.ibm.com




More information about the Kimchi-devel mailing list