[ 
http://jira.codehaus.org/browse/MOJO-931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_125284
 ] 

John Erik Halse commented on MOJO-931:
--------------------------------------

The last comment hit the road a little to early. Here is the whole story:


I have the same problem. It is especially annoying when you want to add a 
configuration file in /etc and you want your rpm to only handle this single 
file.

It seems like nothing has happened after jh submitted the patch. In case you 
want another proposal for how to deal with this, I have made a patch as well 
[^rpm-filelist.patch] .

The main difference from jh's patch is that mine doesn't alter the 
configuration format. It checks if the sources for a mapping contains only 
references to files. If so, it generates one line in the spec for each file. 
Otherwise it uses the old behavior.

Example:
{code:xml}
<mapping>
<directory>/etc/init.d</directory>
<configuration>true</configuration>
<username>root</username>
<groupname>root</groupname>
<sources>
 <source>
  <location>src/etc/somefile</location>
 </source>
 <source>
  <location>src/etc/anotherfile</location>
 </source>
</sources>
</mapping>
{code}

generates:

{code}
%config %dir %attr(-,root,root) /etc/init.d/somefile
%config %dir %attr(-,root,root) /etc/init.d/anotherfile
{code}

With a directory in the sources:
{code:xml}
<mapping>
<directory>/etc/init.d</directory>
<configuration>true</configuration>
<username>root</username>
<groupname>root</groupname>
<sources>
 <source>
  <location>src/etc/somefile</location>
 </source>
 <source>
  <location>src/etc/somedirectory</location>
 </source>
</sources>
</mapping>
{code}

generates:

{code}
%config %dir %attr(-,root,root) /etc/init.d
{code}

> Specifying <directory> of a pre-exising system directory results in an RPM 
> which can't be installed due to conflicts
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: MOJO-931
>                 URL: http://jira.codehaus.org/browse/MOJO-931
>             Project: Mojo
>          Issue Type: Bug
>          Components: rpm
>         Environment: CentOS release 5 (Final)
>            Reporter: Shmulik Fishman
>            Assignee: Bob Allison
>            Priority: Minor
>         Attachments: rpm-filelist.patch, rpm-single-sourcefile-v2.patch, 
> rpm-single-sourcefile.patch
>
>
> <mapping> currently specifies the destination directory for the files. This 
> directory is always listed as part of the installed files.
> This presents a problem when trying to install a startup script for the 
> application:
> <mapping>
>     <directory>/etc/init.d</directory>
> [...]
> </mapping>
> Trying to install the RPM results in the following error:
> # rpm -Uvh dummy-1.0-1.i386.rpm
> file /etc/init.d from install of dummy-1.0-1 conflicts with file from package 
> chkconfig-1.3.30.1-1
> $ rpm -qlvp dummy-1.0-1.i386.rpm 
> [..]
> drwxr-xr-x    2 root    root                0 Oct 17 10:50 /etc/init.d
> -rwxr-xr-x    1 root    root            15060 Oct 17 10:50 /etc/init.d/dummy
> [..]
> Current workarounds:
> - Use the postinstall script to create the file in /etc/init.d, removing this 
> <mapping> altogether.
> or
> - Use --force during the installation

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to