Skip to content

Commit 409144f

Browse files
committed
xtask: create target dir before make srpm
Fix: ``` $ git archive --format=tar --prefix=bootupd-0.2.27.49.g78dc8d3/ -o target/bootupd-0.2.27.49.g78dc8d3.tar HEAD fatal: could not open 'target/bootupd-0.2.27.49.g78dc8d3.tar' for writing: No such file or directory error: Packaging: command exited with non-zero code `git archive --format=tar --prefix=bootupd-0.2.27.49.g78dc8d3/ -o target/bootupd-0.2.27.49.g78dc8d3.tar HEAD`: 128 make: *** [/mnt/workdir-x9znfd3k/bootupd/.copr/Makefile:6: srpm] Error 1 ```
1 parent 78dc8d3 commit 409144f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

xtask/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::fs::File;
22
use std::io::{BufRead, BufReader, BufWriter, Write};
3-
use std::process::{Command, Stdio};
3+
use std::process::Command;
44

55
use anyhow::{Context, Result};
66
use camino::{Utf8Path, Utf8PathBuf};
@@ -76,6 +76,7 @@ fn gitrev(sh: &Shell) -> Result<String> {
7676

7777
/// Return a string formatted version of the git commit timestamp, up to the minute
7878
/// but not second because, well, we're not going to build more than once a second.
79+
#[allow(dead_code)]
7980
#[context("Finding git timestamp")]
8081
fn git_timestamp(sh: &Shell) -> Result<String> {
8182
let ts = cmd!(sh, "git show -s --format=%ct").read()?;
@@ -236,6 +237,7 @@ fn impl_srpm(sh: &Shell) -> Result<Utf8PathBuf> {
236237
}
237238

238239
fn package_srpm(sh: &Shell) -> Result<()> {
240+
let _targetdir = get_target_dir()?;
239241
let srpm = impl_srpm(sh)?;
240242
println!("Generated: {srpm}");
241243
Ok(())

0 commit comments

Comments
 (0)