aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@cardoe.com>2016-11-25 23:16:34 -0600
committerDoug Goldstein <cardoe@cardoe.com>2016-11-25 23:16:34 -0600
commit890754c66fa7addfba0b6fad37bc3b602c2e8a40 (patch)
tree8c645a908bfa1979735a3b33a44e88eab188063e
parentuse an iterator and not a for loop (diff)
downloadcargo-ebuild-890754c66fa7addfba0b6fad37bc3b602c2e8a40.tar.gz
cargo-ebuild-890754c66fa7addfba0b6fad37bc3b602c2e8a40.tar.bz2
cargo-ebuild-890754c66fa7addfba0b6fad37bc3b602c2e8a40.zip
add license info
Extract the license info from the package, which is not in a proper Gentoo format so include a note for people to update it manually.
-rw-r--r--src/ebuild.template2
-rw-r--r--src/main.rs6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/ebuild.template b/src/ebuild.template
index 9611332..bbaf69e 100644
--- a/src/ebuild.template
+++ b/src/ebuild.template
@@ -11,7 +11,7 @@ DESCRIPTION="{description}"
HOMEPAGE="{homepage}"
SRC_URI="$(cargo_crate_uris ${{CRATES}})"
RESTRICT="mirror"
-LICENSE=""
+LICENSE="{license}" # Update to proper Gentoo format
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
diff --git a/src/main.rs b/src/main.rs
index 5dc8bc8..297aea7 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -68,6 +68,11 @@ fn real_main(options: Options, config: &Config) -> CliResult<Option<()>> {
.cloned()
.unwrap_or_else(|| String::from("")));
+ let license = metadata.license
+ .as_ref()
+ .cloned()
+ .unwrap_or_else(|| String::from("unknown license"));
+
// build up the ebuild path
let ebuild_path = PathBuf::from(format!("{}-{}.ebuild", package.name(), package.version()));
@@ -86,6 +91,7 @@ fn real_main(options: Options, config: &Config) -> CliResult<Option<()>> {
include_str!("ebuild.template"),
description = desc.trim(),
homepage = homepage.trim(),
+ license = license.trim(),
crates = crates.join(""),
cargo_ebuild_ver = env!("CARGO_PKG_VERSION"),
)