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
archive entry has inconsistent/wrong leading slashes #217
Comments
I am a little confused - there is no second parameter to |
Yes only the TarArchiveEntry constructor takes a preserveLeadingSlashes parameter unfortunately. We should probably put back the re-creation of the TarArchiveEntry. |
Hm - but the producer creates the I think we need a testcase for this. |
bq. but the producer creates the TarArchiveEntry and the default is to create it with preserveLeadingSlashes set to true The issue is not how the entry is created but how the name is set. The boolean is only used when setting the same in the constructor, it does not remember it. And setName behave as if you were calling the constructor with false basically. |
There used to be a test because I had to struggle with the same issue and the test was modified by the same commit that caused this issue... |
Well, that is counter intuitive. Should we maybe fix this in commons compress then? |
Having a boolean in the setName would be the best probably. |
Maybe a little too much magic here https://github.com/apache/commons-compress/blob/master/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java#L1072 but looking at official packages I am seeing |
Either way I have opened https://issues.apache.org/jira/browse/COMPRESS-328 |
I fixed the |
That said - I am quite sure the tar archive should be in fact all relative. We should check that. |
There was a new release of commons compress that helps fixing this. |
It's probably worth clarifying (and something I probably lost in #169 before), but there's actually a lot of subtlety in the start of the path in the different files, compare these two examples: md5sums: conffiles: So even if we can get the Tar sorted, we may need to manually tweak the output for different file usage anyway. |
From official packages... md5sums:
conffiles:
So I would call it inconsistent but correct :) |
Yes sorry, I think we're in agreement here. So does jdeb do it yet (and if so, do we need the latest Commons Compress too), given this issue is still open? It was more flagging up as I realised my previous comment wasn't too clear, I didn't want someone just swapping all the ./ for / and assuming it was fixed. |
The pom is still listing commons-compress 1.10 - but it was fixed in 1.11. |
At least the conffiles portion of this bug still exists in 1.5 |
@TomyLobo could you elaborate? |
I don't have that particular project here right now and it has been a while since I encountered the problem, but iirc, in 1.5, files listed in "conffiles" (in the control section of the .deb package) still had no leading slashes if the list was automatically generated.. The command "dpkg-deb -I mypackage.deb conffiles" should show you the contents of the conffiles file, but again, i have no way to test it right now :) |
@TomyLobo thanks for the quick reply. I guess we need to check master for that then. At least we should be able to influence this now with the updated commons compress. |
Any progress on this @tcurdt ? It looks like the md5sum ( https://github.com/tcurdt/jdeb/blame/master/src/main/java/org/vafer/jdeb/DataBuilder.java#L164 ) is using getName, but it's still running fixPath ( https://github.com/tcurdt/jdeb/blame/master/src/main/java/org/vafer/jdeb/DataBuilder.java#L135 ) against it, which effectively breaks the path for what md5sum requires. I'm using it via https://github.com/nebula-plugins/gradle-ospackage-plugin which seems to currently be on jdeb 1.4, but it doesn't look like the jdeb end is sorted yet, so not much point asking them to update yet. |
@peternewman if you are able provide a patch I am happy to apply it and make a well needed release. |
Is there a test case for the conffiles stuff, I couldn't immediately spot one? I've fixed the md5sum stuff in #259 . |
I will double check things when looking into making the release - but looking good so far. Thanks for the contribution. I don't think there is a conffiles testcase yet. Feel free to come up with one :) |
Okay, it's just @TomyLobo seemed to be suggesting conffiles weren't right. Although having looked at the last one we've generated which used jdeb, they seem to be okay to me. |
I can see mention of a conffile here, but don't know what it's generating/where it's tested: jdeb/src/test/resources/testbuild.xml Line 124 in f466c09
|
conffiles needs to have leading slashes. EDIT: |
Hi @TomyLobo , The PR I made only impacted on the .md5sums file entries, which shouldn't have a slash (based on ones directly from the Ubuntu repos). conffiles should have the full path though, which it seems to for files generated via https://github.com/nebula-plugins/gradle-ospackage-plugin and jdeb 1.4. I'm personally keen to get this all sorted, but from the small amount of testing I'd done, it seems like conffiles is currently (well with jdeb 1.4 was) correct, unless you feel otherwise. |
I can confirm that with bash from yakkety:
However, here's conffiles from the same package:
|
@TomyLobo which should be in line with what jdeb does (now). |
both? nice! |
In version 1.4
PermMapper
was changed and now instead of creating a newTarArchiveEntry
it uses the one provided to the map function. Before theTarArchiveEntry
constructor was called withpreserveLeadingSlashes
true.Now the
setName
method is called without the second parameter meaningpreserveLeadingSlashes
is false.So, in version 1.3 if I use a PermMapper with prefix "/etc/default" my conffile entry looks like:
/etc/default/file-name
but in 1.4 it's generated as
etc/default/file-name
can you pass true as the second parameter to
setName
and fix this?The text was updated successfully, but these errors were encountered: