Create symlinks before installing packages

This allows redirecting the location packages are installed using
symlinks. This makes it much easier to change the filesystem hierarchy
by not having to change every recipe in the cookbook.
This commit is contained in:
bjorn3
2023-12-29 15:16:56 +01:00
parent 38f6aa70bd
commit b4f2f01d73
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ pub struct FileConfig {
// TODO: Rewrite impls
impl FileConfig {
pub(crate) fn create<P: AsRef<Path>>(self, prefix: P) -> Result<()> {
pub(crate) fn create<P: AsRef<Path>>(&self, prefix: P) -> Result<()> {
let path = self.path.trim_start_matches('/');
let target_file = prefix.as_ref()
.join(path);
+3 -3
View File
@@ -172,12 +172,12 @@ pub fn install_dir<P: AsRef<Path>, S: AsRef<str>>(config: Config, output_dir: P,
let output_dir = output_dir.to_owned();
install_packages(&config, output_dir.to_str().unwrap(), cookbook);
for file in config.files {
for file in &config.files {
file.create(&output_dir)?;
}
install_packages(&config, output_dir.to_str().unwrap(), cookbook);
let mut passwd = String::new();
let mut shadow = String::new();
let mut next_uid = 1000;