diff -Nru rust-test-dir-0.2.0/debian/changelog rust-test-dir-0.2.0/debian/changelog --- rust-test-dir-0.2.0/debian/changelog 2023-02-11 07:03:14.000000000 +0000 +++ rust-test-dir-0.2.0/debian/changelog 2023-02-11 08:05:41.000000000 +0000 @@ -1,3 +1,13 @@ +rust-test-dir (0.2.0-4) unstable; urgency=medium + + * Team upload. + * Package test_dir 0.2.0 from crates.io using debcargo 2.6.0 + * Use CARGO_TARGET_DIR instead of /tmp, it's safer. + + unfortunately we can't use CARGO_TARGET_TMPDIR because it's not available + to unit tests. + + -- Peter Michael Green Sat, 11 Feb 2023 08:05:41 +0000 + rust-test-dir (0.2.0-3) unstable; urgency=medium * Team upload. diff -Nru rust-test-dir-0.2.0/debian/patches/series rust-test-dir-0.2.0/debian/patches/series --- rust-test-dir-0.2.0/debian/patches/series 2023-02-11 07:03:14.000000000 +0000 +++ rust-test-dir-0.2.0/debian/patches/series 2023-02-11 08:05:41.000000000 +0000 @@ -1 +1 @@ -write-test-files-in-tmp.patch +write-test-files-in-cargo-target-dir.patch diff -Nru rust-test-dir-0.2.0/debian/patches/write-test-files-in-cargo-target-dir.patch rust-test-dir-0.2.0/debian/patches/write-test-files-in-cargo-target-dir.patch --- rust-test-dir-0.2.0/debian/patches/write-test-files-in-cargo-target-dir.patch 1970-01-01 00:00:00.000000000 +0000 +++ rust-test-dir-0.2.0/debian/patches/write-test-files-in-cargo-target-dir.patch 2023-02-11 08:05:41.000000000 +0000 @@ -0,0 +1,24 @@ +Index: test-dir/src/lib.rs +=================================================================== +--- test-dir.orig/src/lib.rs ++++ test-dir/src/lib.rs +@@ -313,6 +313,9 @@ mod tests { + fn test_testdir_current_rnd_dir() { + let path; + { ++ if let Some(cargo_target_dir) = option_env!("CARGO_TARGET_DIR") { ++ std::env::set_current_dir(cargo_target_dir).unwrap(); ++ } + let dir = TestDir::current_rnd(); + + // Dir created +@@ -332,6 +335,9 @@ mod tests { + fn test_testdir_current_dir() { + let path; + { ++ if let Some(cargo_target_dir) = option_env!("CARGO_TARGET_DIR") { ++ std::env::set_current_dir(cargo_target_dir).unwrap(); ++ } + let dir = TestDir::current("a/b/c"); + + // Dir created diff -Nru rust-test-dir-0.2.0/debian/patches/write-test-files-in-tmp.patch rust-test-dir-0.2.0/debian/patches/write-test-files-in-tmp.patch --- rust-test-dir-0.2.0/debian/patches/write-test-files-in-tmp.patch 2023-02-11 07:03:14.000000000 +0000 +++ rust-test-dir-0.2.0/debian/patches/write-test-files-in-tmp.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ ---- a/src/lib.rs -+++ b/src/lib.rs -@@ -313,6 +313,7 @@ - fn test_testdir_current_rnd_dir() { - let path; - { -+ std::env::set_current_dir("/tmp").unwrap(); - let dir = TestDir::current_rnd(); - - // Dir created -@@ -332,6 +333,7 @@ - fn test_testdir_current_dir() { - let path; - { -+ std::env::set_current_dir("/tmp").unwrap(); - let dir = TestDir::current("a/b/c"); - - // Dir created