|
[
Permalink
| « Hide
]
Sönke Nommensen added a comment - 17/Oct/07 06:30 AM
This is because /etc/init.d/ is a link to /etc/rc.d/init.d/, thus a mapping to the latter should work.
This does fix the specific conflict on /etc/init.d. Thanks.
However, it does not address the real problem: This directory is always listed as part of the installed files, which means we reset its permissions during installation. So the question remains: How do I install files only, without the containing directory? I went ahead checked out the code and added the possibility to create mappings based on one file. This makes it possible to quickly add one-file mappings and will result in file based lines in the rpm spec.
<mapping> generates: %config %dir %attr(-,root,root) /etc/init.d/mystartupscript I bypassed the sources property because this seemed an easier way. Another option was to add something like a handlePerFile property to generate one line per file in the spec, but this means duplicating the DirectoryArchiver functionality. Please advise if this patch/solution is not to your liking. Your patch has a lot of "changes" where the change updates a blank line. This makes it difficult to locate the real changes.
Can you create a new patch file with the -b option to ignore these changes? Another solution to this bug.
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: <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> generates: %config %dir %attr(-,root,root) /etc/init.d/somefile %config %dir %attr(-,root,root) /etc/init.d/anotherfile With a directory in the sources: <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> generates: %config %dir %attr(-,root,root) /etc/init.d What I would really like is a way to include or exclude the top directory. It could be something explicit like an <includeDir/> tag, or something implicit like <location>foo/bar</location> means to include the directory in the rpm file list and <location>foo/bar/</location> would mean to include the contents of foo/bar, but not the directory itself. This is similar to the way rsync distinguishes the two cases for it's source directory and it is quite convenient.
I have a solution based on Michael Hirsch's comment (using includeDir) - http://jira.codehaus.org/browse/MOJO-1125
Under the <mapping> element you can add an optional element: <includeDir>boolean</includeDir>. By default it's true. If false, the directory specified in the mapping is not included. It seems it has to be <includeDirectory> rather than just <includeDir>
Yes, that's correct includeDirectory, not includeDir. Sorry about the mistake.
Fixed in 2.0-beta-2-SNAPSHOT. Thanks
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||