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

debian:package-bin throws a FileNotFoundException for missing postrm #117

Merged
merged 2 commits into from
Jan 2, 2014

Conversation

aparkinson
Copy link
Contributor

If no src/debian/DEBIAN/postrm file exists and daemonUser is not the root user then a FileNotFoundException is thrown for sbt debian:package-bin. The error is caused by the script for removing the daemonUser user account from the installation being prepended to the postrm file that does not exist

@@ -186,7 +193,7 @@ trait DebianPlugin extends Plugin with linux.LinuxPlugin {
prependAndFixPerms(postinst, userGroupAdd, LinuxFileMetaData())

val purgeAdd = Seq(TemplateWriter.generateScript(DebianPlugin.postrmPurgeTemplateSource, replacements))
prependAndFixPerms(postrm, purgeAdd, LinuxFileMetaData())
appendAndFixPerms(postrm, purgeAdd, LinuxFileMetaData())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While looking into the issue I noticed the code for removing the user account created during installation was being removed before the developers own postrm script code is executed, the developer could possibly be still using the user account at this point.

By appending the user account removal script to the postrm file, the file would be created if not provided by the user and avoid the exception.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix! Thanks.

@jsuereth
Copy link
Member

jsuereth commented Jan 2, 2014

Sweet! Thanks for the fixes.

jsuereth added a commit that referenced this pull request Jan 2, 2014
debian:package-bin throws a FileNotFoundException for missing postrm
@jsuereth jsuereth merged commit d9b49e7 into sbt:master Jan 2, 2014
@aparkinson aparkinson deleted the postrm-exception branch January 3, 2014 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants