pub enum PackageOption {
AutoDeps(bool),
Debug(bool),
Docs(bool),
EmptyDirs(bool),
Libtool(bool),
Lto(bool),
Purge(bool),
StaticLibs(bool),
Strip(bool),
Zipman(bool),
}
Expand description
An option string used in packaging
The option string is identified by its name and whether it is on (not prefixed with “!”) or off (prefixed with “!”).
See the makepkg.conf manpage for more information.
§Examples
use alpm_types::PackageOption;
let option = PackageOption::new("debug")?;
assert_eq!(option.on(), true);
assert_eq!(option.name(), "debug");
let not_option = PackageOption::new("!lto")?;
assert_eq!(not_option.on(), false);
assert_eq!(not_option.name(), "lto");
Variants§
AutoDeps(bool)
Automatically add dependencies and provisions (see alpm-sonamev2).
Debug(bool)
Add debugging flags as specified in DEBUG_* variables
Docs(bool)
Save doc directories specified by DOC_DIRS
EmptyDirs(bool)
Leave empty directories in packages
Libtool(bool)
Leave libtool (.la) files in packages
Lto(bool)
Add compile flags for building with link time optimization
Purge(bool)
Remove files specified by PURGE_TARGETS
StaticLibs(bool)
Leave static library (.a) files in packages
Strip(bool)
Strip symbols from binaries/libraries
Zipman(bool)
Compress manual (man and info) pages in MAN_DIRS with gzip
Implementations§
Source§impl PackageOption
impl PackageOption
const VARIANTS: [&str; 11]
Sourcepub fn new(option: &str) -> Result<Self, Error>
pub fn new(option: &str) -> Result<Self, Error>
Creates a new PackageOption
from a string slice.
§Errors
An error is returned if the string slice does not match a valid package option.
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns the name of the PackageOption
as string slice.
Sourcepub fn on(&self) -> bool
pub fn on(&self) -> bool
Returns whether the PackageOption
is on or off.
Sourcepub fn parser(input: &mut &str) -> ModalResult<Self>
pub fn parser(input: &mut &str) -> ModalResult<Self>
Recognizes a PackageOption
in a string slice.
Consumes all of its input.
§Errors
Returns an error if input
is not the valid string representation of a PackageOption
.
Trait Implementations§
Source§impl Clone for PackageOption
impl Clone for PackageOption
Source§fn clone(&self) -> PackageOption
fn clone(&self) -> PackageOption
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PackageOption
impl Debug for PackageOption
Source§impl<'de> Deserialize<'de> for PackageOption
impl<'de> Deserialize<'de> for PackageOption
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for PackageOption
impl Display for PackageOption
Source§impl FromStr for PackageOption
impl FromStr for PackageOption
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Creates a PackageOption
from a string slice.
Delegates to PackageOption::parser
.
§Errors
Returns an error if PackageOption::parser
fails.