[Distutils] bdist_rpm: spec file: %config

Gerry Reno greno at verizon.net
Mon Feb 16 03:59:13 CET 2009


Tarek Ziadé wrote:
> On Sun, Feb 15, 2009 at 11:56 PM, Gerry Reno <greno at verizon.net> wrote:
>   
>> I've been looking at the spec file that 'bdist_rpm' generates and I do not
>> see a %config or %config(noreplace) section.  Is there a way to generate a
>> %config section and specify a list of files?  This is important so that
>> config files do not get overwritten when using 'rpm -U'.
>>     
>
> Looking at the code, I don't see such option,
>
> please fill a feature request in http://bugs.python.org/ selecting
> 'Distutils' as a component,
>
> (with a sample of such a spec file if possible)
>
> Thanks
>
>   
>> _______________________________________________
>> Distutils-SIG maillist  -  Distutils-SIG at python.org
>> http://mail.python.org/mailman/listinfo/distutils-sig
>>
>>     
>
>
>
>   
Ok, I found a way to use %config like this:

In setup.cfg define a line:
install_script=install.txt

In the file 'install.txt' I put this:

---------------------------------------------------
CONFIGFILES="\
%config(noreplace) /etc/myconfigfile.cfg"

echo "$CONFIGFILES" | cat INSTALLED_FILES - > INSTALLED_FILES.new
mv INSTALLED_FILES.new INSTALLED_FILES
---------------------------------------------------

Make sure your config file is added to the filelist fed to 'setup()' by 
setup.py
And this works.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20090215/45466ac4/attachment.htm>


More information about the Distutils-SIG mailing list