Skip to content

Commit cdc86ca

Browse files
authored
Merge pull request #50 from cgwalters/task-cwd-not-root
task: s/root/cwd/
2 parents 6075da3 + 8abcfdb commit cdc86ca

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/src/install.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,13 @@ async fn initialize_ostree_root_from_self(
316316
for (k, v) in [("sysroot.bootloader", "none"), ("sysroot.readonly", "true")] {
317317
Task::new("Configuring ostree repo", "ostree")
318318
.args(["config", "--repo", "ostree/repo", "set", k, v])
319-
.root(rootfs_dir)?
319+
.cwd(rootfs_dir)?
320320
.quiet()
321321
.run()?;
322322
}
323323
Task::new("Initializing sysroot", "ostree")
324324
.args(["admin", "os-init", stateroot, "--sysroot", "."])
325-
.root(rootfs_dir)?
325+
.cwd(rootfs_dir)?
326326
.run()?;
327327

328328
// Ensure everything in the ostree repo is labeled
@@ -804,7 +804,7 @@ pub(crate) async fn install(opts: InstallOpts) -> Result<()> {
804804
// ostree likes to have the immutable bit on the physical sysroot to ensure
805805
// that it doesn't accumulate junk; all system state should be in deployments.
806806
Task::new("Setting root immutable bit", "chattr")
807-
.root(&rootfs.rootfs_fd)?
807+
.cwd(&rootfs.rootfs_fd)?
808808
.args(["+i", "."])
809809
.run()?;
810810

lib/src/task.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ impl Task {
2121
Self::new_cmd(description, Command::new(exe.as_ref()))
2222
}
2323

24-
pub(crate) fn root(mut self, dir: &Dir) -> Result<Self> {
24+
/// Set the working directory for this task.
25+
pub(crate) fn cwd(mut self, dir: &Dir) -> Result<Self> {
2526
self.cmd.cwd_dir(dir.try_clone()?);
2627
Ok(self)
2728
}

0 commit comments

Comments
 (0)