Skip to content

Commit

Permalink
fix: set lastmtime for .conda
Browse files Browse the repository at this point in the history
  • Loading branch information
nichmor committed May 10, 2024
1 parent 2e6346f commit 5521cb6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
11 changes: 0 additions & 11 deletions crates/rattler_package_streaming/src/write.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
//! Functionality for writing conda packages
use core::arch;
use std::fs::{self, File};
use std::io::{self, Read, Seek, Write};
use std::os::macos::fs::MetadataExt;
use std::path::{Path, PathBuf};
use std::time::SystemTime;

use chrono::{Datelike, Timelike};
use rattler_conda_types::package::PackageMetadata;
Expand Down Expand Up @@ -188,7 +185,6 @@ pub fn write_tar_bz2_package<W: Write>(
writer,
compression_level.to_bzip2_level()?,
));
archive.mode(tar::HeaderMode::Deterministic);
archive.follow_symlinks(false);

let total_size = total_size(base_path, paths);
Expand Down Expand Up @@ -243,13 +239,6 @@ fn write_zst_archive<W: Write>(

// Compress it as tar.zst
let tar_file = File::open(&tar_path)?;

// SystemTime::from(value)

// tar_file.set_modified(time)
// let mut metadata = tar_file.metadata().unwrap();
// metadata.modified()

let compression_level = compression_level.to_zstd_level()?;
let mut zst_encoder = zstd::Encoder::new(writer, compression_level)?;
zst_encoder.multithread(num_threads.unwrap_or_else(|| num_cpus::get() as u32))?;
Expand Down
4 changes: 1 addition & 3 deletions crates/rattler_package_streaming/tests/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ use rattler_package_streaming::write::{
write_conda_package, write_tar_bz2_package, CompressionLevel,
};
use std::collections::HashMap;
use std::fs::{self, File};
use std::fs::File;
use std::io::Read;
use std::path::{Path, PathBuf};
use std::time::SystemTime;
use walkdir::WalkDir;

fn find_all_archives() -> impl Iterator<Item = PathBuf> {
Expand Down Expand Up @@ -123,7 +122,6 @@ fn compare_two_conda_archives(p1: &Path, p2: &Path) {
println!("Comparing {p1:?} and {p2:?}");
let mut archive1 = File::open(p1).unwrap();
let mut archive2 = File::open(p2).unwrap();

// open outer zip file
let mut zip1 = zip::ZipArchive::new(&mut archive1).unwrap();
let mut zip2 = zip::ZipArchive::new(&mut archive2).unwrap();
Expand Down

0 comments on commit 5521cb6

Please sign in to comment.