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

Support for changelog and .changes file generation #268

Merged
merged 7 commits into from
Jun 6, 2014

Conversation

jaunis
Copy link

@jaunis jaunis commented Jun 4, 2014

Hello,
This pull request aims at creating a .changes file associated to the debian package, which is necessary to upload the package on a mirror. So I added a changelog key and a genChanges task.
It was necessary to make minor modifications to the packageBin task to conform to debian standards (especially the name of the package).
Unfortunately I could not figure out how to run the tests, so I hope I did not introduce any regression.

@kardapoltsev
Copy link
Member

You could run tests with

sbt 'scripted debian/*'

case x => sys.error("Failure packaging debian file. Exit code: " + x)
}
val files = pkgdir / Names.Debian / Names.Files
IO.writeLines(files, List(s"$archive $section $priority"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently we still support scala 2.9.x , so the string interpolation must be replaced with string concatenation :(

Copy link
Member

Choose a reason for hiding this comment

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

It may be time to drop that..... WDYT - our 1.0 on sbt 0.13.x + 1.0?

@muuki88
Copy link
Contributor

muuki88 commented Jun 4, 2014

This is a cool addition. +1 for adjusting the docs. So, if I understand correctly this addition must be used like this

sbt debian:genChanges debian:packageBin

so it generates the changes file and then the package?

@jaunis
Copy link
Author

jaunis commented Jun 4, 2014

No, it is only necessary to run debian:genChanges: it will generate both the .deb and the .changes. Actually, the changes file contains a checksum of the .deb so we are obliged to build the package first.

@@ -252,6 +261,23 @@ trait DebianPlugin extends Plugin with linux.LinuxPlugin {
},
lintian <<= packageBin map { file =>
Process(Seq("lintian", "-c", "-v", file.getName), Some(file.getParentFile)).!
},
genChanges <<= (packageBin, target, debianChangelog, name, version, packageArchitecture) map { (_, tdir, changelog, name, version, arch) =>
Copy link
Member

Choose a reason for hiding this comment

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

This task should be added to the packagedArtifacts so when you publish using ivy, the changelog comes too.

@jaunis
Copy link
Author

jaunis commented Jun 4, 2014

So I fixed the failing tests, removed all string interpolations and added the genChanges target to the packagedArtifacts.
There was also a missing field in the .changes file, which caused some issues once the package is uploaded on the mirror, so I had to rewrite a part of my modifications.

@muuki88
Copy link
Contributor

muuki88 commented Jun 5, 2014

LGTM. +1 for the extra test. I'm a bit confused where the _all suffix comes from?
This is actually good if you want to release it in Nexus or other repositories, which
gets confused with identical names and only different file extensions.

@jaunis
Copy link
Author

jaunis commented Jun 5, 2014

The _all suffix is the package architecture. I am myself a bit confused about that : when I build a debian package purely with the debian tools, the .deb and the .changes do not have the same suffix. It seems the .deb is suffixed with the package architecture and the .changes with the architecture of the machine on which it is build. So what I did is perhaps not perfectly debian-compliant on this point but I think it is a pretty good approximation.

@muuki88
Copy link
Contributor

muuki88 commented Jun 6, 2014

Tests are running on my machine as well. Nice work.

muuki88 added a commit that referenced this pull request Jun 6, 2014
Support for changelog and .changes file generation
@muuki88 muuki88 merged commit 342704d into sbt:master Jun 6, 2014
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.

4 participants