disable_sandbox
option for global configuration
This commit is contained in:
parent
4fb2ac7ef8
commit
9e4537fded
3 changed files with 11 additions and 1 deletions
3
pacwrap-core/dist/pacwrap.yml
vendored
3
pacwrap-core/dist/pacwrap.yml
vendored
|
@ -17,4 +17,5 @@ alpm:
|
|||
sig_level_local: Optional
|
||||
#parallel_downloads: 5
|
||||
#check_space: true
|
||||
#download_timeout: true"
|
||||
#download_timeout: true
|
||||
#disable_sandbox: false
|
||||
|
|
|
@ -103,6 +103,8 @@ pub struct AlpmConfiguration {
|
|||
check_space: bool,
|
||||
#[serde(default = "default_true")]
|
||||
download_timeout: bool,
|
||||
#[serde(default)]
|
||||
disable_sandbox: bool,
|
||||
}
|
||||
|
||||
impl Configuration {
|
||||
|
@ -146,6 +148,7 @@ impl AlpmConfiguration {
|
|||
parallel_downloads: parallel_downloads(),
|
||||
check_space: true,
|
||||
download_timeout: true,
|
||||
disable_sandbox: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,6 +168,10 @@ impl AlpmConfiguration {
|
|||
self.check_space
|
||||
}
|
||||
|
||||
pub fn disable_sandbox(&self) -> bool {
|
||||
self.disable_sandbox
|
||||
}
|
||||
|
||||
pub fn held(&self) -> Vec<&str> {
|
||||
self.hold_pkg.iter().map(|a| a.as_ref()).collect()
|
||||
}
|
||||
|
|
|
@ -196,6 +196,7 @@ pub fn instantiate_alpm_agent(config: &Global, remotes: &AlpmConfigData) -> Alpm
|
|||
let mut handle = Alpm::new("/mnt/fs", "/mnt/fs/var/lib/pacman/").unwrap();
|
||||
let hook_dirs = vec!["/mnt/fs/usr/share/libalpm/hooks/", "/mnt/fs/etc/pacman.d/hooks/"];
|
||||
|
||||
handle.set_disable_sandbox(config.alpm().disable_sandbox());
|
||||
handle.set_logfile("/mnt/share/pacwrap.log").unwrap();
|
||||
handle.set_hookdirs(hook_dirs.iter()).unwrap();
|
||||
handle.set_cachedirs(vec!["/mnt/share/cache"].iter()).unwrap();
|
||||
|
@ -215,6 +216,7 @@ pub fn instantiate_alpm(inshandle: &ContainerHandle) -> Alpm {
|
|||
fn alpm_handle(insvars: &ContainerVariables, db_path: String, remotes: &AlpmConfigData) -> Alpm {
|
||||
let mut handle = Alpm::new(insvars.root(), &db_path).unwrap();
|
||||
|
||||
handle.set_disable_sandbox(CONFIG.alpm().disable_sandbox());
|
||||
handle.set_cachedirs(vec![format!("{}/pkg", *CACHE_DIR)].iter()).unwrap();
|
||||
handle.set_gpgdir(format!("{}/pacman/gnupg", *DATA_DIR)).unwrap();
|
||||
handle.set_logfile(format!("{}/pacwrap.log", *DATA_DIR)).unwrap();
|
||||
|
|
Loading…
Reference in a new issue