Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 73b3ae0

Browse files
committed
Remove the source archive functionality of ArchiveWriter
We now build archives through strictly additive means rather than taking an existing archive and potentially substracting parts.
1 parent abb9b60 commit 73b3ae0

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

src/archive.rs

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,16 @@ pub(crate) struct ArArchiveBuilder<'a> {
3030
}
3131

3232
impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
33-
fn new(sess: &'a Session, output: &Path, input: Option<&Path>) -> Self {
34-
let (src_archives, entries) = if let Some(input) = input {
35-
let read_cache = ReadCache::new(File::open(input).unwrap());
36-
let archive = ArchiveFile::parse(&read_cache).unwrap();
37-
let mut entries = Vec::new();
38-
39-
for entry in archive.members() {
40-
let entry = entry.unwrap();
41-
entries.push((
42-
entry.name().to_vec(),
43-
ArchiveEntry::FromArchive { archive_index: 0, file_range: entry.file_range() },
44-
));
45-
}
46-
47-
(vec![read_cache.into_inner()], entries)
48-
} else {
49-
(vec![], Vec::new())
50-
};
51-
33+
fn new(sess: &'a Session, output: &Path) -> Self {
5234
ArArchiveBuilder {
5335
sess,
5436
dst: output.to_path_buf(),
5537
use_gnu_style_archive: sess.target.archive_format == "gnu",
5638
// FIXME fix builtin ranlib on macOS
5739
no_builtin_ranlib: sess.target.is_like_osx,
5840

59-
src_archives,
60-
entries,
41+
src_archives: vec![],
42+
entries: vec![],
6143
}
6244
}
6345

0 commit comments

Comments
 (0)