What is significance of RPM Warning: File listed twice

2.7k views Asked by At

Currently I am using the RPM Maven plugin to generate RPMs as needed. My situation requires that I apply different directory permissions to the files contained within that directory.
Unfortunately I cannot use the default directory permissions as not all permissions are the same across all directories.
So I configure the plugin in a manner that results in the following spec file snippet:

%files
%config %dir %attr(0755,team_prod,prodgroup) /basedir/product/tool/config
%config %dir %attr(0755,team_prod,prodgroup) /basedir/product/tool/config/examples
%config %attr(0644,team_prod,prodgroup) /basedir/product/tool/config/examples/test.conf
%config %attr(0644,team_prod,prodgroup) /basedir/product/tool/config/examples/dest.conf

From the site http://www.rpm.org/max-rpm-snapshot/s1-rpm-specref-files-list-directives.html I understood the following that as I am using the %dir macro, the %dir directive is used to direct RPM to package only the directory itself, regardless of what files may reside in the directory at the time the package is created. Hence it wont by default list everything under that directory. This means using the %dir directive, and then listing the files explicitly below (with different permissions shouldn't result in 'File listed twice' warning messages:

[WARNING] warning: File listed twice: /basedir/product/tool/config/examples/dest.conf
[WARNING] warning: File listed twice: /basedir/product/tool/config/examples/test.conf

My question is irrespective of using the maven RPM plugin, should the above spec snippet not be sufficient to eliminate the Warning messages?
Also, as the spec file has no logic to find files or list them in anyway, is it safe to ignore these messages?
The RPM installs and uninstalls fine and all other RPM commands work perfectly but these warning messages still appear?
Currently I am ignoring them.

Note that the warning messages do not appear if the permissions are the same for the directory and files (I think).

thanks in advance for any responses.

Maven Specific Settings:

<mappings>
<mapping>                            
    <configuration>true</configuration>                       
    <directory>/basedir/product/tool/config</directory>
    <filemode>0755</filemode>
    <username>team_prod</username>
    <groupname>prodgroup</groupname>
</mapping>

 <mapping>                           
    <configuration>true</configuration>                       
    <directory>/basedir/product/tool/config/examples</directory>
    <filemode>0755</filemode>
    <username>team_prod</username>
    <groupname>prodgroup</groupname>
</mapping>

<mapping>
  <configuration>true</configuration>                       
  <directory>/basedir/product/tool/config/examples</directory>
  <directoryIncluded>false</directoryIncluded>
  <filemode>0644</filemode>
  <username>team_prod</username>
  <groupname>prodgroup</groupname>
  <sources>
    <source>                                  
       <location>src/main/config/examples</location>
    </source>
  </sources>
</mapping>

There are many entries similar to the above. I have the following defined too true but nothing else. I know that there are recursive maven props for this plugin too, but I need fine grained control over the permissions applied. e.g. for the bin directory, all files have 755 etc. As mentioned, the %dir directive is produced, but doesn't seem to adhere to RPM rules.

0

There are 0 answers