/// A convenience method that compiles a package's install hook
/// and any configuration templates in its config_install folder
A convenience method that compiles a package's install hook
and any configuration templates in its config_install folder
A convenience method that compiles a package ' s install hook and any configuration templates in its config_install folder
pub fn compile_for_package_install(package: &PackageInstall) -> Result<()> {
    let pkg = package::Pkg::from_install(package)?;
    fs::SvcDir::new(&pkg.name, &pkg.svc_user, &pkg.svc_group).create()?;
    let cfg = config::Cfg::new(&pkg, None)?;
    let ctx = RenderContext::new(&pkg, &cfg);
    let cfg_renderer = config::CfgRenderer::new(pkg.path.join("config_install"))?;
    cfg_renderer.compile(&pkg.name, &pkg, &pkg.svc_config_install_path, &ctx)?;
    if let Some(ref hook) = InstallHook::load(&pkg.name,
                                              &fs::svc_hooks_path(&pkg.name),
                                              &package.installed_path.join("hooks"))
    {
        hook.compile(&pkg.name, &ctx)?;
    };
    Ok(())
}
pub fn compile_for_package_install ( package : & PackageInstall ) -> Result < ( ) > { let pkg = package :: Pkg :: from_install ( package ) ? ; fs :: SvcDir :: new ( & pkg . name , & pkg . svc_user , & pkg . svc_group ) . create ( ) ? ; let cfg = config :: Cfg :: new ( & pkg , None ) ? ; let ctx = RenderContext :: new ( & pkg , & cfg ) ; let cfg_renderer = config :: CfgRenderer :: new ( pkg . path . join ( " " ) ) ? ; cfg_renderer . compile ( & pkg . name , & pkg , & pkg . svc_config_install_path , & ctx ) ? ; if let Some ( ref hook ) = InstallHook :: load ( & pkg . name , & fs :: svc_hooks_path ( & pkg . name ) , & package . installed_path . join ( " " ) ) { hook . compile ( & pkg . name , & ctx ) ? ; } ; Ok ( ( ) ) }
A convenience method that compiles a package's install hook
and any configuration templates in its config_install folder
A convenience method that compiles a package ' s install hook and any configuration templates in its config_install folder
package
&PackageInstall