-
Notifications
You must be signed in to change notification settings - Fork 443
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
FIX #324 adding empty dirs to deb package #325
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import NativePackagerKeys._ | ||
|
||
packagerSettings | ||
|
||
mapGenericFilesToLinux | ||
|
||
name := "debian-test" | ||
|
||
version := "0.1.0" | ||
|
||
maintainer := "Josh Suereth <joshua.suereth@typesafe.com>" | ||
|
||
packageSummary := "Test debian package" | ||
|
||
packageDescription := """A fun package description of our software, | ||
with multiple lines.""" | ||
|
||
debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)") | ||
|
||
debianPackageRecommends in Debian += "git" | ||
|
||
linuxPackageMappings in Debian += packageDirectoryAndContentsMapping( | ||
(baseDirectory.value / "src" / "resources" / "conf") -> "/usr/share/conf") | ||
|
||
linuxPackageMappings in Debian += packageDirectoryAndContentsMapping( | ||
(baseDirectory.value / "src" / "resources" / "empty") -> "/var/empty") | ||
|
||
packageBin in Debian <<= debianJDebPackaging in Debian | ||
|
||
TaskKey[Unit]("check-dir-mappings") <<= (target, streams) map { (target, out) => | ||
// val tmpDir = java.nio.file.Files.createTempDirectory("jdeb") | ||
val extracted = file("/tmp/jdeb" + System.currentTimeMillis().toString) | ||
Seq("dpkg-deb", "-R", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! | ||
assert((extracted / "usr/share/conf/application.conf").exists(), "File application.conf not exists") | ||
assert((extracted / "usr/share/conf/log4j.properties").exists(), "File log4j.properties not exists") | ||
assert((extracted / "var/empty").exists(), "Empty dir not exists") | ||
extracted.delete() | ||
out.log.success("Successfully tested control script") | ||
() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Run the debian packaging. | ||
$ mkdir src/resources/empty | ||
> debian:package-bin | ||
$ exists target/debian-test_0.1.0_all.deb | ||
> check-dir-mappings |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look wrong, but doesn't look correct either :/ So we have
This means that if you add a directory producer with an empty directory and exclude all it's contents (the way before), the empty directory doesn't get created? Sounds for me more like a bug in jdeb. @tcurdt @ebourg may know more about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've dug into jdeb sources before I could get it works)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought so :( Well, as this is a bit mysterious after all, we should really add tests for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's already done)