Skip to content

Commit

Permalink
Don't add newline to conffiles
Browse files Browse the repository at this point in the history
Fixes #110
  • Loading branch information
kornelski committed Sep 10, 2023
1 parent 97e228a commit cd377b2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl<'l, W: Write> ControlArchiveBuilder<'l, W> {
pub fn generate_archive(&mut self, options: &Config) -> CDResult<()> {
self.generate_control(options)?;
if let Some(ref files) = options.conf_files {
self.generate_conf_files(files)?;
self.add_conf_files(files)?;
}
self.generate_scripts(options)?;
if let Some(ref file) = options.triggers_file {
Expand Down Expand Up @@ -242,12 +242,8 @@ impl<'l, W: Write> ControlArchiveBuilder<'l, W> {
}

/// If configuration files are required, the conffiles file will be created.
fn generate_conf_files(&mut self, files: &str) -> CDResult<()> {
let mut data = Vec::new();
data.write_all(files.as_bytes())?;
data.push(b'\n');
self.archive.file("./conffiles", &data, 0o644)?;
Ok(())
fn add_conf_files(&mut self, files: &str) -> CDResult<()> {
self.archive.file("./conffiles", files.as_bytes(), 0o644)
}

fn generate_triggers_file(&mut self, path: &Path) -> CDResult<()> {
Expand Down

0 comments on commit cd377b2

Please sign in to comment.