pub struct Package {
pub spec: PackageSpec,
pub target_profile_dir: PathBuf,
}
Expand description
A package, which is built from a specification written in a cargo manifest and a set of artifacts pulled from the target profile directory
Fields§
§spec: PackageSpec
The specification, which is written in [package.metadata.simics] in the crate manifest of the crate to package
target_profile_dir: PathBuf
The target profile directory from which to pull artifacts and output the built package
Implementations§
Source§impl Package
impl Package
Sourcepub const INNER_PACKAGE_FILENAME: &'static str = "package.tar.gz"
pub const INNER_PACKAGE_FILENAME: &'static str = "package.tar.gz"
The name of the inner package file which decompresses to the package directory
Sourcepub const METADATA_FILENAME: &'static str = "ispm-metadata"
pub const METADATA_FILENAME: &'static str = "ispm-metadata"
The name of the file containing metadata for ISPM to use when installing the package
Sourcepub const ADDON_TYPE: &'static str = "addon"
pub const ADDON_TYPE: &'static str = "addon"
The name of an addon package type
Sourcepub const COMPRESSION_LEVEL: u32 = 6u32
pub const COMPRESSION_LEVEL: u32 = 6u32
Default level used by simics
Sourcepub fn from_subcommand(subcommand: &Subcommand) -> Result<Self>
pub fn from_subcommand(subcommand: &Subcommand) -> Result<Self>
Instantiate a package from a cargo subcommand input, which is parsed from command line arguments
Sourcepub fn package_dirname(&self) -> Result<String>
pub fn package_dirname(&self) -> Result<String>
Construct the directory name of the package after expansion. It is an error to build a Rust crate package into any type other than an addon package (simics base is not a Rust package)
Sourcepub fn full_package_name(&self) -> String
pub fn full_package_name(&self) -> String
Construct the full package name, which includes the host directory name
Sourcepub fn package_name(&self) -> String
pub fn package_name(&self) -> String
Construct the package name, which is the package number and version, without an extension
Sourcepub fn package_name_with_host(&self) -> String
pub fn package_name_with_host(&self) -> String
Construct the package name with the host directory name
Sourcepub fn package_filename(&self) -> String
pub fn package_filename(&self) -> String
Construct the filename for the output of this ISPM package
Sourcepub fn set_header_common(header: &mut Header) -> Result<()>
pub fn set_header_common(header: &mut Header) -> Result<()>
Set common options on a tar header. On Unix, the modified time is set to the current time and the uid/gid are set to the current user.
Sourcepub fn create_inner_tarball(&self) -> Result<(Vec<u8>, usize)>
pub fn create_inner_tarball(&self) -> Result<(Vec<u8>, usize)>
Create the inner package.tar.gz tarball which expands to the simics package.
Sourcepub fn create_tarball(&self) -> Result<Vec<u8>>
pub fn create_tarball(&self) -> Result<Vec<u8>>
Create the outer tarball (actually an ISPM package) containing the inner package and a metadata file used by ISPM