Also print Rust-side features/cfg in rpm-ostree --version
Let's make it obvious whether the `fedora-infrastructure` feature is compiled in.
This commit is contained in:
parent
29d051e895
commit
9f590fa155
@ -84,6 +84,7 @@ mod ffi {
|
||||
// utils.rs
|
||||
extern "Rust" {
|
||||
fn varsubstitute(s: &str, vars: &Vec<StringMapping>) -> Result<String>;
|
||||
fn get_features() -> Vec<String>;
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
|
@ -294,3 +294,10 @@ pub(crate) fn varsubstitute(s: &str, subs: &Vec<crate::ffi::StringMapping>) -> R
|
||||
let m = subs.iter().cloned().map(|i| (i.k, i.v)).collect();
|
||||
varsubst(s, &m)
|
||||
}
|
||||
|
||||
pub(crate) fn get_features() -> Vec<String> {
|
||||
let mut r = Vec::new();
|
||||
#[cfg(feature = "fedora-integration")]
|
||||
r.push("fedora-integration".to_string());
|
||||
r
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
#include "rpmostree-util.h"
|
||||
#include "rpmostree-builtins.h"
|
||||
#include "rpmostree-cxxrs.h"
|
||||
#include "rpmostree-polkit-agent.h"
|
||||
#include "rpmostreemain.h"
|
||||
|
||||
@ -248,6 +249,11 @@ rpmostree_option_context_parse (GOptionContext *context,
|
||||
g_print (" Features:\n");
|
||||
for (char **iter = features; iter && *iter; iter++)
|
||||
g_print (" - %s\n", *iter);
|
||||
auto featuresrs = rpmostreecxx::get_features();
|
||||
for (auto s : featuresrs)
|
||||
{
|
||||
g_print (" - %s\n", s.c_str());
|
||||
}
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user