title: Unexpected RPM conflict on %config(noreplace) files
body: <p>I'm creating my own <strong>RPM</strong> using <code>rpmbuild</code>.<br>
  My RPM <strong>contains config files</strong> which should <strong>never get overridden</strong>, even if the RPM contains a new version of these config files.<br></p>
  
  <p>To archive this, I tagged these with </p>
  
  <pre><code>%config(noreplace) /opt/mypackage/etc/*
  </code></pre>
  
  <p>in the spec file.</p>
  
  <p>According to the documentation and <a href="http://www-uxsup.csx.cam.ac.uk/~jw35/docs/rpm_config.html" rel="nofollow">this site</a>, a locally modified file will never get overridden in this case which is exactly what I want.<br></p>
  
  <p>However, when doing the following operations:</p>
  
  <ol>
  <li>Install version 1 of the RPM</li>
  <li>Change configuration file <code>etc/myconfig</code></li>
  <li>Update package with version 2 of the RPM</li>
  </ol>
  
  <p><strong>I'm getting a conflict:</strong></p>
  
  <pre><code>$ rpm --prefix ~/rpmroot/ -ih dist/mypackage-1.0.1-1.x86_64.rpm
  ########################################### [100%]
  file /home/user/rpmroot/mypackage/etc/myconfig from install of mypackage-1.0.2-1.x86_64 conflicts with file from package mypackage-1.0.1-1.x86_64
  </code></pre>
  
  <p><strong>Questions:<br></strong></p>
  
  <ul>
  <li>How can this conflict be explained? (I'd expect that the new version of the config file would be stored as <code>myconfig.rpmnew</code> and the existing remains untouched)</li>
  <li>What I am doing wrong?</li>
  </ul>
  
  <p><br>
  <strong>UPDATE (additional information)</strong></p>
  
  <p>The output of <code>rpm -qcp dist/mypackage-1.0.1-1.x86_64.rpm</code> is:</p>
  
  <pre><code>/opt/mypackage/etc/config1.xml
  /opt/mypackage/etc/config2.xml
  /opt/mypackage/etc/run.sh
  /opt/mypackage/etc/config3.xml
  </code></pre>
  
  <p>The complete <code>%files</code> section:</p>
  
  <pre><code>%files
  %defattr(0444,root,root)
  /opt/mypackage/java/*
  
  #dba
  %defattr(0444,root,root)
  /opt/mypackage/dba/sql/*
  %defattr(0555,root,root)
  /opt/mypackage/dba/script/*
  
  #srv
  %defattr(0555,root,root)
  /opt/mypackage/srv/bin/*
  /opt/mypackage/srv/lib/*
  
  #etc
  %defattr(0664,root,root)
  %config(noreplace) /opt/mypackage/etc/*
  </code></pre>