Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The deb task doesn't preserve the filesystem permissions #55

Open
i30817 opened this issue Jul 15, 2012 · 15 comments
Open

The deb task doesn't preserve the filesystem permissions #55

i30817 opened this issue Jul 15, 2012 · 15 comments
Milestone

Comments

@i30817
Copy link

i30817 commented Jul 15, 2012

I whenever i tried to build, even with this:
http://pastebin.com/raw.php?i=FmMaXiux

When i used lintian

BUILD SUCCESSFUL
Total time: 27 seconds
E: bookjar: control-file-has-bad-permissions conffiles 0755 != 0644
W: bookjar: extended-description-line-too-long
E: bookjar: non-standard-file-permissions-for-etc-init.d-script etc/init.d/bookjar 0644 != 0755
W: bookjar: script-not-executable etc/init.d/bookjar

(notice it reports etc/init.d/bookjar is not executable even though i was set explicitly before the deb task)
Whatever i do, whatever the permissions before the files go into the deb task it doesn't seem to change this, so i can only guess the task is modifying the files but not setting a appropriate permission back again.

@ebourg
Copy link
Collaborator

ebourg commented Jul 15, 2012

Could you try again by replacing the data element with a fileset? It should preserve the permissions.

    <deb destfile="${name}.deb" compression="gzip"  control="debian/pkg/DEBIAN">
        <fileset dir="debian/pkg/data" />
    </deb>

@ebourg
Copy link
Collaborator

ebourg commented Jul 15, 2012

Actually the right solution is to use a tarfileset. Until jdeb uses the Java 7 nio2 API it's not possible to preserve the permissions from the filesystem.

@i30817
Copy link
Author

i30817 commented Jul 16, 2012

Even a tar fileset won't work, because different things on the data dir (or indeed the control dir, where i didn't see the option to use a tar) need different permissions and tarfileset sets them to all the files.

If i gave a (exec-ed) tar file would it work? BTW, i don't mind using java 7. In fact, the best option might be a fork. Where in the code do you copy files?

@i30817
Copy link
Author

i30817 commented Jul 16, 2012

It looks pretty gnarly. You only use inputstreams. I wonder if there is a wrapper output stream that saves file permissions and reapplies them on the end

@ebourg
Copy link
Collaborator

ebourg commented Jul 16, 2012

You can use several tarfilesets, one per type of permission, or you can use a permission mapper. There are some examples in the documentation : https://github.com/tcurdt/jdeb/blob/master/docs/ant.md

@i30817
Copy link
Author

i30817 commented Jul 16, 2012

What about the control directory?

@i30817
Copy link
Author

i30817 commented Jul 16, 2012

Now i'm confused too:
http://developer.ubuntu.com/packaging/html/debian-dir-overview.html

there are a number of files in that article (changelog, .desktop) that i was putting in their final directories in the data instead of the control directory. Will jdeb do the right thing on this or is it too distribution specific?

@ebourg
Copy link
Collaborator

ebourg commented Jul 16, 2012

The .desktop file has to be put in the right directory (typically into /usr/share/applications), jdeb will not move it automatically.

@i30817
Copy link
Author

i30817 commented Jul 16, 2012

Bummer i was hoping that the distro installer did (and that jdeb exposed the mapping variable mechanism so i could use the [[]] syntax in all control/** files)

@tcurdt tcurdt added this to the 2.0 milestone Feb 26, 2014
@prapicault
Copy link

What is the best way to address the permission issue in a Maven build?

@tcurdt
Copy link
Owner

tcurdt commented Jun 24, 2014

@prapicault
Copy link

I'm interested in providing a fix for this issue. Would you be interested by such a contribution?

@tcurdt
Copy link
Owner

tcurdt commented Dec 6, 2014

@prapicault what kind of fix do you have in mind?

@prapicault
Copy link

I wanted to create a new mapper that would obtain the permission from the file system using java 7 API (https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/package-summary.html).
Of course this would only work on linux or macs, but for people who already have the application to be packged ready with all the proper permissions, it would avoid the duplication of information.
For example, in my case, I'm trying to automate the creation of debian packages for eclipse archives. In this case the archive already has all the right permissions and having to duplicate this in the deb plugin is annoying.

@tcurdt
Copy link
Owner

tcurdt commented Dec 15, 2014

@prapicault we already had such a contribution. maybe check the old issues. The main problem is that 1.x should stay on java6.

For 2.x I am more than open for such functionality!
I just haven't gotten around to layout the new 2.x API design yet.

The current config file discussion happens here.

https://gist.github.com/tcurdt/9275523

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants