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

file "copyrigh" is created and produces lintian error #27

Open
nerdoc opened this issue Mar 12, 2019 · 6 comments
Open

file "copyrigh" is created and produces lintian error #27

nerdoc opened this issue Mar 12, 2019 · 6 comments
Assignees
Labels

Comments

@nerdoc
Copy link

nerdoc commented Mar 12, 2019

I created a package, and used the "Generate Simple Template" button. Changed the name/email and saved my project. After creating the .deb, lintian told me that:

[...]
E: eurolyser: md5sums-lists-nonexistent-file usr/share/doc/eurolyser/copyrigh
W: eurolyser: file-missing-in-md5sums usr/share/doc/eurolyser/copyright

There is the "t" missing at the end of "copyrigh" - I think there is the problem why lintian is not finding the file.
Could it be that debreate snips away the last letter? There is nothing to configure about the copyright notice file - I suppose the bug is in the code somewhere.

How can I help?
Here is my eurolyser.dbp.txt file (extension changed to .txt for uploading at Github - please remove the .txt)

@AntumDeluge
Copy link
Member

You are probably right. It is most likely in the code. I will try to have a look at it tonight.

@AntumDeluge AntumDeluge self-assigned this Mar 13, 2019
@AntumDeluge
Copy link
Member

AntumDeluge commented Mar 13, 2019

The problem is that Lintian is not reading the last character of md5sums file. It appears that it expects the last character of the file to be an empty newline. Debreate's function WriteFile by default strips all trailing newlines when it writes to a file. The solution is simple: Just disable stripping newline characters for writing the md5sums file.

Thank you for the report. I will get this fixed & try to get a new release out soon.

AntumDeluge added a commit that referenced this issue Mar 13, 2019
@AntumDeluge
Copy link
Member

@nerdoc
Copy link
Author

nerdoc commented Mar 13, 2019

A CR (or CR/LF in Windows) is a line terminator, not a line delimiter. So the last line should be terminated by a CR.
OTOH, lintian has a bad habit here "stripping" the last character...?

@AntumDeluge
Copy link
Member

AntumDeluge commented Mar 13, 2019

It appears that Lintian simply excludes the final character of a file when read. It assumes that the final character of the file will be a newline character (simply LF for Unix line endings, which is what Debreate uses when it writes out to a file). So, when Debreate was stripping newline characters from the end of the file, Lintian would read it but still ignore the final character (which in your case was "t"). So it would read in the md5sums file that usr/share/doc/eurolyser/copyrigh should exist because it ignored that final character.

I assume that if the file was using Windows line endings (CR/LF) it would still read the file fine, as long as the file ended in a new line. It would just ignore the LF character & probably read the CR character.

The fix that I made simply ensure that when the md5sums file is written, it is terminated with the LF character. And Lintian will read everything before that. It's a flaw in Lintian in my opinion. But, not a big deal.

@AntumDeluge
Copy link
Member

Should be fixed with commit 3e3a955

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

No branches or pull requests

2 participants