<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, May 8, 2014 at 6:43 AM, Gianluca Cecchi <span dir="ltr">&lt;<a href="mailto:gianluca.cecchi@gmail.com" target="_blank">gianluca.cecchi@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hello,<div><div>sorry if this question is more for rpm devs...<br>
<div>I know that in a spec file the definition</div><div><br></div><div>%confg ......./file_name1</div></div></div><div>will cause update of an edited file_name1, saving the on disk one into .rpmsave before overwriting</div>

<div><br></div><div>while</div><div><div>%confg(noreplace) ......./file_name2</div><div>will retain the edited file_name2 on disk and save the provided new config file into .rpmnew</div></div><div><br></div><div>The question is:</div>

<div>can I see if a config file was defined in its spec with or without (noreplace) if I have not the spec file and the .src.rpm file, but I have only the final binary rpm?</div></div></blockquote><div><br></div><div>I think this is what you&#39;re looking for:</div>
<div><br></div><div>$ rpm -q --scripts httpd</div><div>preinstall scriptlet (using /bin/sh):</div><div># Add the &quot;apache&quot; user</div><div>/usr/sbin/useradd -c &quot;Apache&quot; -u 48 \</div><div><span class="" style="white-space:pre">        </span>-s /sbin/nologin -r -d /usr/share/httpd apache 2&gt; /dev/null || :</div>
<div>postinstall scriptlet (using /bin/sh):</div><div><br></div><div>if [ $1 -eq 1 ] ; then </div><div>        # Initial installation </div><div>        /usr/bin/systemctl preset httpd.service htcacheclean.service &gt;/dev/null 2&gt;&amp;1 || : </div>
<div>fi</div><div>preuninstall scriptlet (using /bin/sh):</div><div><br></div><div>if [ $1 -eq 0 ] ; then </div><div>        # Package removal, not upgrade </div><div>        /usr/bin/systemctl --no-reload disable httpd.service htcacheclean.service &gt; /dev/null 2&gt;&amp;1 || : </div>
<div>        /usr/bin/systemctl stop httpd.service htcacheclean.service &gt; /dev/null 2&gt;&amp;1 || : </div><div>fi</div><div>postuninstall scriptlet (using /bin/sh):</div><div><br></div><div>/usr/bin/systemctl daemon-reload &gt;/dev/null 2&gt;&amp;1 || : </div>
<div><br></div><div><br></div><div># Trigger for conversion from SysV, per guidelines at:</div><div># <a href="https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd">https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd</a></div>
<div>posttrans scriptlet (using /bin/sh):</div><div>test -f /etc/sysconfig/httpd-disable-posttrans || \</div><div>  /bin/systemctl try-restart httpd.service htcacheclean.service &gt;/dev/null 2&gt;&amp;1 || :</div><div>---end---</div>
<div><br></div><div>Add a pipe to grep for config and you should get what you need.</div><div><br></div><div>Richard</div></div></div></div>