redline
redline copied to clipboard
recursive directory adding
I'm not sure if recursively adding a directory is supported by redline.
When calling addFile() if you pass it a directory you get:
java.io.FileNotFoundException: script/rpm/layout/etc (Is a directory)
at java.io.FileInputStream.open (FileInputStream.java:-2)
java.io.FileInputStream.<init> (FileInputStream.java:138)
org.redline_rpm.payload.Contents.getMD5s (Contents.java:582)
org.redline_rpm.Builder.build (Builder.java:1142)
Putting a directory in the %files section appears to be straight forward from the .spec file standpoint. See: http://www.rpm.org/max-rpm/s1-rpm-inside-files-list.html
Is there another way redline supports that I'm not noticing or do I have to do the recursion in my code?
I was able to add a directory by doing a recursive function however I have found that adding a directory via the addDirectory method usually ends in a cpio error when installing the RPM. Maybe you will have better luck with addDirectory than I am.
I handle recursive directories by assuming the same perms/attributes all the way down.
See: :recurse https://github.com/pausebreak/lein-redline-rpm
I'm not calling addDirectory. I call addFile for each file found.