commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
b8b5ea7dcc6678c6d4e495f2a6ab9194fd9c8956
Alex Crichton
2024-09-25T00:45:06
Bump to 0.4.42
diff --git a/Cargo.toml b/Cargo.toml index eac8207..979cb77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.41" +version = "0.4.42" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
7a1215048a4f6219abbc018f168e5bdbd4130f86
xzfc
2024-09-20T18:15:08
feat: Support adding sparse files to archives (#375) * refactor: introduce BuilderOptions * feat: Support adding sparse files to archives
diff --git a/src/builder.rs b/src/builder.rs index 0f4ef8f..3c94359 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -4,7 +4,9 @@ use std::io::prelude::*; use std::path::Path; use std::str; +use crate::header::GNU_SPARSE_HEADERS_COUNT; use crate::header::{path2bytes, HeaderMode}; +use crate::GnuExtSparseHeader;...
3
644
63
6586ac058dc5ecb57dc2071fc277b240a227299f
xzfc
2024-09-20T18:10:56
feat: Add Builder::append_writer (#376)
diff --git a/src/builder.rs b/src/builder.rs index 9b79932..0f4ef8f 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -165,6 +165,47 @@ impl<W: Write> Builder<W> { self.append(&header, data) } + /// Adds a new entry to this archive and returns an [`EntryWriter`] for + /// adding its contents. + ...
3
167
1
97d5033eb80bf90c746a8b76dd31ca8a39326991
xzfc
2024-08-23T00:10:56
fix: Don't forget to zero-terminate in octal_into (#374) Usually, numeric fields like `size` are set only once, implicitly assuming that the previous data is zero-initialized. However, it's not always the case, particularly when overriding large values written in the extended form.
diff --git a/src/header.rs b/src/header.rs index 7683251..36fb52a 100644 --- a/src/header.rs +++ b/src/header.rs @@ -8,7 +8,7 @@ use std::fmt; use std::fs; use std::io; use std::iter; -use std::iter::repeat; +use std::iter::{once, repeat}; use std::mem; use std::path::{Component, Path, PathBuf}; use std::str; @@ ...
2
5
3
6adcb40e37f82039d5175148ff5e40709829f4a6
Richard Schneeman
2024-08-22T15:39:05
Update append_dir_all doc test (#364) ## Call `finish` The text of `append_dir_all` suggests that `finish` must always be called. This commit updates the example to call `finish`. ## Link to `into_inner` Further, the docs for `finish` suggest that `into_inner` is an alternate (and possibly preferred), so I ad...
diff --git a/src/builder.rs b/src/builder.rs index ed32871..9b79932 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -363,7 +363,8 @@ impl<W: Write> Builder<W> { /// operation then this may corrupt the archive. /// /// Also note that after all files have been written to an archive the - /// `finish...
1
5
3
def682d302f3a40afb05f794d2752916c333ff8b
Richard Schneeman
2024-08-22T15:38:30
Add append_dir_all doc test without renaming (#365) This adds a doc test that shows how to add the contents of a directory to an archive without renaming them. ## Context It might seem silly, but I was unsure of the correct way to write all contents of a directory to an archive without renaming. I initially look...
diff --git a/src/builder.rs b/src/builder.rs index b786c5a..ed32871 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -377,6 +377,35 @@ impl<W: Write> Builder<W> { /// // with a different name. /// ar.append_dir_all("bardir", ".").unwrap(); /// ``` + /// + /// Use `append_dir_all` with an empty s...
1
29
0
9f9ce52d882e2fca3c8175c6b66975aa35563b54
stswidwinski
2024-08-22T15:35:13
Ensure directory permissions are correctly applied. (#372) * Add link ownership rules. * Reorder directories when creating.
diff --git a/src/archive.rs b/src/archive.rs index 760b2cb..924e54a 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -238,6 +238,15 @@ impl Archive<dyn Read + '_> { file.unpack_in(dst)?; } } + + // Apply the directories. + // + // Note: the order of applica...
2
46
0
f9521899ed2e492925b719a4b7cdc700ba7e0043
stswidwinski
2024-08-15T21:16:10
Add link ownership rules. (#371)
diff --git a/src/entry.rs b/src/entry.rs index c5cef6b..cd26e6b 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -576,6 +576,12 @@ impl<'a> EntryFields<'a> { ), ) })?; + // While permissions on symlinks are meaningless on most syst...
2
30
4
cdf5b6f6c8687fcf3b5c28caaa75cc179706b727
Richard Schneeman
2024-07-08T13:55:38
Add doc hint that default is different than `tar` (#366) The default of `tar` is to include a symlink in the archive. The default of `tar::Builder` is to resolve symlinks and replace them with the resulting file. This commit helps to clarify that difference by highlighting that `follow_symlinks(true)` provides the ...
diff --git a/src/builder.rs b/src/builder.rs index a26eb31..b786c5a 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -40,6 +40,9 @@ impl<W: Write> Builder<W> { /// Follow symlinks, archiving the contents of the file they point to rather /// than adding a symlink to the archive. Defaults to true. + ///...
1
3
0
2cb0c7b53f5748d84f83d0bc74abe8669f2d2187
Colin Walters
2024-06-04T21:35:03
Release 0.4.41 (#361) There's only one notable change here, which is that `Header::Deterministic` on Windows now uses the same timestamp as is used on Unix. If this breaks your use case, please let us know in https://github.com/alexcrichton/tar-rs/pull/346 Besides that, there's a few testing, documentation, and...
diff --git a/Cargo.toml b/Cargo.toml index 0f454fe..eac8207 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.40" +version = "0.4.41" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
618c6ab693525a137dc51ea13c4c59acfd9a9735
Colin Walters
2024-06-04T21:34:51
Update to 2021 edition (#362) No functional changes; this is just part of maintenance. Signed-off-by: Colin Walters <walters@verbum.org>
diff --git a/Cargo.toml b/Cargo.toml index e07b5a5..0f454fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ documentation = "https://docs.rs/tar" license = "MIT OR Apache-2.0" keywords = ["tar", "tarfile", "encoding"] readme = "README.md" -edition = "2018" +edition = "2021" exclude = ["tests/archives/*"] ...
2
1
2
a4297c72b71334122e3f8ca6091af8ad307173a9
Paolo Barbolini
2024-06-04T17:10:29
Make license metadata SPDX compliant (#357)
diff --git a/Cargo.toml b/Cargo.toml index 58d161b..e07b5a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.com/alexcrichton/tar-rs" documentation = "https://docs.rs/tar" -lic...
1
1
1
2224f6e05ebd6c5643b6da3155b89bef6e8c3cbd
Colin Walters
2024-06-04T15:12:49
entry: Use `strip_prefix` (#329) Minor drive by code cleanup; `strip_prefix` is just more readable and more bug-resistant than manually doing it with `starts_with` combined with slicing.
diff --git a/src/entry.rs b/src/entry.rs index c81554f..8a45307 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -865,11 +865,7 @@ impl<'a> EntryFields<'a> { .filter_map(|e| { let key = e.key_bytes(); let prefix = b"SCHILY.xattr."; - if key.st...
1
1
5
a37c9b63226d514cb9ffdbb33889840b106b6014
Colin Walters
2024-06-04T15:09:40
tests: Don't assume /dev/loop0 exists (#328) It doesn't by default on e.g. current Fedora and RHEL systems. I suspect most people so far have been running this on Ubuntu which uses snaps which use loopback devices, but we can't rely on that. For test coverage here, ultimately there's not really a good block devi...
diff --git a/tests/all.rs b/tests/all.rs index a7954e1..1e7b264 100644 --- a/tests/all.rs +++ b/tests/all.rs @@ -1386,10 +1386,7 @@ fn tar_directory_containing_special_files() { // append_path has a different logic for processing files, so we need to test it as well t!(ar.append_path("fifo")); t!(ar.appe...
1
0
3
ac38b1e51cf338e43b42577ba08eea8263054eb6
Colin Walters
2024-06-04T15:09:12
entry_type: Fix doc comments for PAX bits (#359) Someone copy-pasted the GNU link comments. While we're here, link to the PAX site. Signed-off-by: Colin Walters <walters@verbum.org>
diff --git a/src/entry_type.rs b/src/entry_type.rs index 951388d..7f2494a 100644 --- a/src/entry_type.rs +++ b/src/entry_type.rs @@ -181,12 +181,18 @@ impl EntryType { self == &EntryType::GNULongLink } - /// Returns whether this type represents a GNU long name header. + /// Returns whether this ty...
1
8
2
c74d62a4922ddca278dc02a2a5e8e90821cc0573
Rain
2024-06-04T15:08:54
update xattr to 1.1.3 (#348) xattr 1.0.0 through 1.1.2 have a bug (https://github.com/Stebalien/xattr/pull/48). Bump the requirement so that downstream dependents get the latest version.
diff --git a/Cargo.toml b/Cargo.toml index 3fd35be..58d161b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ filetime = "0.2.8" tempfile = "3" [target."cfg(unix)".dependencies] -xattr = { version = "1.0", optional = true } +xattr = { version = "1.1.3", optional = true } libc = "0.2" [features]
1
1
1
dd9123cd6e0d670fa5ad0d307d8f237072371ff4
Marek Kaput
2024-06-04T15:07:44
Unify `mtime` constant used on Unix and Windows (#346) * Unify `mtime` constant used on Unix and Windows fix #341 * Extract `DETERMINISTIC_TIMESTAMP`
diff --git a/src/header.rs b/src/header.rs index 7e507fc..65f665e 100644 --- a/src/header.rs +++ b/src/header.rs @@ -16,6 +16,14 @@ use std::str; use crate::other; use crate::EntryType; +/// A deterministic, arbitrary, non-zero timestamp that use used as `mtime` +/// of headers when [`HeaderMode::Deterministic`] is...
2
15
11
34744459084c1fffb03d6c742f5a5af9a6403bc4
Alex Crichton
2023-08-07T18:50:59
Bump to 0.4.40
diff --git a/Cargo.toml b/Cargo.toml index 165d5dc..3fd35be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.39" +version = "0.4.40" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
826907c6421b7d5ea2a219b538e5f97fdee52ea9
Eric Seppanen
2023-08-07T18:46:34
Update xattr requirement from 0.2 to 1.0 (#334) Updates the requirements on [xattr](https://github.com/Stebalien/xattr) to permit the latest version. - [Release notes](https://github.com/Stebalien/xattr/releases) - [Commits](https://github.com/Stebalien/xattr/compare/v0.2.0...v1.0.0) --- updated-dependencies: -...
diff --git a/Cargo.toml b/Cargo.toml index 7d73e1a..165d5dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ filetime = "0.2.8" tempfile = "3" [target."cfg(unix)".dependencies] -xattr = { version = "0.2", optional = true } +xattr = { version = "1.0", optional = true } libc = "0.2" [features]
1
1
1
c77f47cb1b4b47fc4404a170d9d91cb42cc762ea
Alex Crichton
2023-07-13T13:57:16
Bump to 0.4.39
diff --git a/Cargo.toml b/Cargo.toml index bcafdbd..7d73e1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.38" +version = "0.4.39" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
1fd8b4ef309087d138c55aab7b38ad7e15993c96
Weihang Lo
2023-07-05T22:53:45
feat: setting permission mask in `Entry` and `Archive` (#330) This is convenience when you want to disable some permission bits during unpacking. Currently only support Unix.
diff --git a/src/archive.rs b/src/archive.rs index e875124..c7a9d98 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -22,6 +22,7 @@ pub struct Archive<R: ?Sized + Read> { pub struct ArchiveInner<R: ?Sized> { pos: Cell<u64>, + mask: u32, unpack_xattrs: bool, preserve_permissions: bool, prese...
4
108
2
702598615e16d63167ea22d9c5077cc29b96f016
Weihang Lo
2023-07-05T15:03:35
test: temporary fix for UNC path parsing issue (#331) Prepend `c:` so that it won't be treated as UNC path. See rust-lang/rust#100833 for more.
diff --git a/tests/all.rs b/tests/all.rs index fa38ef6..90b6084 100644 --- a/tests/all.rs +++ b/tests/all.rs @@ -579,10 +579,21 @@ fn extracting_malicious_tarball() { t!(a.append(&header, io::repeat(1).take(1))); }; append("/tmp/abs_evil.txt"); - append("//tmp/abs_evil2.txt"); + ...
1
13
2
f4f439ca0cd3a984d2a66fb8e42f6e2307876afd
John Watson
2022-04-04T14:05:17
Preserve symlink mtimes (#289)
diff --git a/src/entry.rs b/src/entry.rs index 3093856..cce39d4 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -464,6 +464,19 @@ impl<'a> EntryFields<'a> { Ok(()) } + fn get_mtime(header: &Header) -> Option<FileTime> { + header.mtime().ok().map(|mtime| { + // Fo...
2
26
10
dc78ebe6d153e54316ca4c8ed74b74bf4723f3a9
Alex Crichton
2021-12-14T18:33:26
Bump to 0.4.38
diff --git a/Cargo.toml b/Cargo.toml index 3037e91..bcafdbd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.37" +version = "0.4.38" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
de72a30dfbfd26e4c21530c108b21f6b70e9e023
Colin Walters
2021-12-14T18:33:14
Add a method to write a link name without canonicalization (#274) In https://github.com/ostreedev/ostree we generate a cryptographic checksum over files and symlinks, and directories. ostree does not currently perform any canonicalization on symlinks; we'll respect and honor whatever bytes we're provided as input...
diff --git a/src/header.rs b/src/header.rs index b8b590b..7e507fc 100644 --- a/src/header.rs +++ b/src/header.rs @@ -435,6 +435,18 @@ impl Header { }) } + /// Sets the link name for this header without any transformation. + /// + /// This function is like [`Self::set_link_name`] but accepts an ...
2
34
0
ec5edf1c5e782e39bb3cc2e5243c700aad85d66d
Colin Walters
2021-11-19T14:51:01
Add an `append_link()` method to handle long link targets (#273) We should support appending long symlink targets, because this occurs in real world filesystems. In my case, RPM set up `.build-id` symlinks which can get long. Add an `append_link()` method following the precendent of `append_path()` - we're just...
diff --git a/src/builder.rs b/src/builder.rs index 0c90447..a26eb31 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -162,6 +162,54 @@ impl<W: Write> Builder<W> { self.append(&header, data) } + /// Adds a new link (symbolic or hard) entry to this archive with the specified path and target. + //...
3
71
0
5a1c8ea4c65de5b811cab09d9edf1cde583f2bec
anrdnet
2021-11-10T21:34:13
Add public constructor for PaxExtensions (#271)
diff --git a/src/entry.rs b/src/entry.rs index 743d4c4..8f0b62a 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -13,7 +13,6 @@ use crate::archive::ArchiveInner; use crate::error::TarError; use crate::header::bytes2path; use crate::other; -use crate::pax::pax_extensions; use crate::{Archive, Header, PaxExtensions}; ...
2
18
14
8333ef6be942153fee5f6b85455e6df4181ffbe7
Vinícius Miguel
2021-10-28T14:12:00
Avoid reallocating Strings when creating `TarError` (#269)
diff --git a/src/archive.rs b/src/archive.rs index 3e98ddc..1bed512 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -189,7 +189,7 @@ impl Archive<dyn Read + '_> { fn _unpack(&mut self, dst: &Path) -> io::Result<()> { if dst.symlink_metadata().is_err() { fs::create_dir_all(&dst) - ...
3
13
12
18905551141c5729af824d0c9b14759bc6868ae5
Alex Crichton
2021-10-06T14:31:00
Consolidate some methods and tweak some lifetimes Just a few stylistic changes.
diff --git a/src/archive.rs b/src/archive.rs index 59d5b67..3e98ddc 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -2,8 +2,8 @@ use std::cell::{Cell, RefCell}; use std::cmp; use std::convert::TryFrom; use std::fs; -use std::io; use std::io::prelude::*; +use std::io::{self, SeekFrom}; use std::marker; use std...
1
28
27
64b8e1bb6facae61391c3313487438b60487846f
Christian Ocker
2021-10-06T14:22:23
Add support for readers that implement Seek (#218) (#266) `Archive::entries_with_seek` can be used to get an iterator over entries for a reader that implements `Seek`.
diff --git a/src/archive.rs b/src/archive.rs index f9dae69..59d5b67 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -1,5 +1,6 @@ use std::cell::{Cell, RefCell}; use std::cmp; +use std::convert::TryFrom; use std::fs; use std::io; use std::io::prelude::*; @@ -35,8 +36,12 @@ pub struct Entries<'a, R: 'a + Read> {...
2
109
12
a2a82e652d7fc86310f4bf552ee339a14c5ee789
Alex Crichton
2021-10-04T15:22:13
Fix the second overflow with `self.next`
diff --git a/src/archive.rs b/src/archive.rs index 4a8f337..f9dae69 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -301,7 +301,10 @@ impl<'a> EntriesFields<'a> { let size = size .checked_add(511) .ok_or_else(|| other("size overflow"))?; - self.next += size & !(512 - 1); + ...
2
33
3
de08ca186b5006c246f88691a7d7756ebaf075ad
Alex Crichton
2021-10-04T15:14:01
Fix an overflow when rounding up the size of a file Closes #265
diff --git a/src/archive.rs b/src/archive.rs index 8c33332..4a8f337 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -298,8 +298,10 @@ impl<'a> EntriesFields<'a> { // Store where the next entry is, rounding up by 512 bytes (the size of // a header); - let size = (size + 511) & !(512 - 1); ...
2
17
2
60c6bd81d73fd0e340cfb0e147aae13ce23e18c6
James McCoy
2021-08-23T15:25:50
Use rust birthday for HeaderMode::Deterministic timestamp (#262) As described in rust-lang/crates.io#3859, the current arbitrary timestamp of 123456789 leads to Debian packages being auto-rejected due to the old timestamp. This happens for any timestamps before 1975. Instead of 123456789, use another, more recen...
diff --git a/src/header.rs b/src/header.rs index 3cfeca4..a76f78a 100644 --- a/src/header.rs +++ b/src/header.rs @@ -741,8 +741,9 @@ impl Header { // // We just need things to be deterministic here so just pick // something that isn't zero. This time, chosen after care...
1
3
2
a746675cd2f2b40231cc251c5bf3b3f4d606bc48
Alex Crichton
2021-08-12T20:50:40
Bump to 0.4.37
diff --git a/Cargo.toml b/Cargo.toml index 1ecd78c..3037e91 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.36" +version = "0.4.37" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
8eecbf538ae4e49ca9b7c005ea7377f5fec05f40
Tyera Eulberg
2021-08-12T20:50:17
Restore create_dir_all method (#260)
diff --git a/src/entry.rs b/src/entry.rs index d97c95e..9e4516e 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -773,7 +773,7 @@ impl<'a> EntryFields<'a> { if let Some(parent) = ancestor.parent() { self.validate_inside_dst(dst, parent)?; } - fs::create_dir(ancestor)...
1
1
1
2587ead5ce8bf9378b010f9e7e305dd9aa602360
Alex Crichton
2021-08-10T14:42:06
Bump to 0.4.36
diff --git a/Cargo.toml b/Cargo.toml index b568187..1ecd78c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.35" +version = "0.4.36" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
d90a02f582c03dfa0fd11c78d608d0974625ae5d
Nikhil Benesch
2021-08-10T14:41:27
Don't create directories before we've verified they're inside the tar destination (#259) Fixes #238 Co-authored-by: Robert O'Callahan <robert@ocallahan.org>
diff --git a/src/entry.rs b/src/entry.rs index b5e3512..d97c95e 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -413,11 +413,8 @@ impl<'a> EntryFields<'a> { None => return Ok(false), }; - if parent.symlink_metadata().is_err() { - fs::create_dir_all(&parent).map_err(|e| { - ...
3
57
6
860858be1ef65b3640c27ed752ea080995f86a64
danieleades
2021-07-23T14:16:20
tidy 'header' implementation (#254) * align 'header' with async-tar implementation * remove explicit return * remove explicit return
diff --git a/src/header.rs b/src/header.rs index 5fe7723..3cfeca4 100644 --- a/src/header.rs +++ b/src/header.rs @@ -26,6 +26,7 @@ pub struct Header { /// Declares the information that should be included when filling a Header /// from filesystem metadata. #[derive(Clone, Copy, PartialEq, Eq, Debug)] +#[non_exhaustiv...
1
14
16
b9cffc8735c9617eb69bf942c748ace0091ded35
liushuyu
2021-07-22T14:32:21
builder: add support for archiving special files on Unix (#246) * builder: add support for archiving special files on Unix Added support for archiving character, block and fifo files on Unix, this is useful when you want to take a whole system backup or re-archiving an extracted system image * tests: display s...
diff --git a/src/builder.rs b/src/builder.rs index a38fe81..0c90447 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -410,10 +410,61 @@ fn append_path_with_name( Some(&link_name), ) } else { - Err(other(&format!("{} has unknown file type", path.display()))) + #[cfg(unix)] + ...
2
93
1
065368bd70e6f3328a280879a30915affe19d406
Alex Crichton
2021-05-27T21:16:30
Bump to 0.4.35
diff --git a/Cargo.toml b/Cargo.toml index 154744d..b568187 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.34" +version = "0.4.35" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
2d08ac793029c74c4b1589cc0238e36670bed42d
Alex Crichton
2021-05-27T21:16:11
Don't set 0 mtime on Windows
diff --git a/src/header.rs b/src/header.rs index ec04bba..5fe7723 100644 --- a/src/header.rs +++ b/src/header.rs @@ -811,7 +811,7 @@ impl Header { HeaderMode::Deterministic => { self.set_uid(0); self.set_gid(0); - self.set_mtime(0); + self.set...
1
1
1
a37e9fd45150c05a471abe11db037dc29402f8df
Alex Crichton
2021-05-27T19:47:42
Bump to 0.4.34
diff --git a/Cargo.toml b/Cargo.toml index 43f6cb7..154744d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.33" +version = "0.4.34" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
e81f172113c44742c9e096c296f3055abd2dfa0b
Alex Crichton
2021-05-27T19:47:30
Avoid zero-mtime files (#250) With rust-lang/cargo#9512 discovered this is, uh, odd fallout of the "deterministic" header mode in this crate. This is an unintended consequence of the deterministic header mode which should ideally be fixable. This commit changes the `tar` crate to use a different constant than 0 wh...
diff --git a/src/entry.rs b/src/entry.rs index e02ecbe..f99c897 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -610,6 +610,13 @@ impl<'a> EntryFields<'a> { if self.preserve_mtime { if let Ok(mtime) = self.header.mtime() { + // For some more information on this see the comments in...
3
39
2
7f2a355ac56a5ec5cf260058850b1daed20cf761
afranchuk
2021-05-21T14:24:16
Extract directory entries after all others when using Archive::unpack. (#249) If they are extracted in order, they may fail if a directory's permissions prevent descendant files from being written. So extracting them after all other entries ensures that any files that need to be created can be without being subject...
diff --git a/src/archive.rs b/src/archive.rs index 8c0b089..8c33332 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -172,10 +172,22 @@ impl<'a> Archive<dyn Read + 'a> { // NotFound exception. let dst = &dst.canonicalize().unwrap_or(dst.to_path_buf()); + // Delay any directory entries unti...
2
39
1
f07b3c15e398a76a627e77b49952d44c5d5880d8
Alex Crichton
2021-02-19T20:06:39
Bump to 0.4.33
diff --git a/Cargo.toml b/Cargo.toml index 1fd099a..43f6cb7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.32" +version = "0.4.33" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
6fa079849506b5044206ab65640fb0f940b69884
Alex Crichton
2021-01-25T16:38:13
Bump to 0.4.32
diff --git a/Cargo.toml b/Cargo.toml index 447bc55..1fd099a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.31" +version = "0.4.32" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
46e741463fe5c60d1a2da727cb80f1bc776fefa9
Alex Crichton
2021-01-25T16:37:50
Fix long-link paths with multibyte characters on Windows (#241) Fixes an issue where when a truncated path was inserted into a header after the long-link entry was already emitted the truncation happened on a multibyte character boundary. The fix here is to always use `str`-encoding for the header's path entry sinc...
diff --git a/src/builder.rs b/src/builder.rs index 9d6ecc6..a38fe81 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -1,10 +1,10 @@ -use std::borrow::Cow; use std::fs; use std::io; use std::io::prelude::*; use std::path::Path; +use std::str; -use crate::header::{bytes2path, path2bytes, HeaderMode}; +use crate:...
2
28
8
a37bdb8b56b7ee4e0ce03160b363420644f004ed
Alex Crichton
2021-01-25T15:14:20
Bump to 0.4.31
diff --git a/Cargo.toml b/Cargo.toml index e730399..447bc55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.30" +version = "0.4.31" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
daf3dc88e1480951f64019708d5298ce8c7de3dd
Nikhil Benesch
2021-01-25T15:13:36
Remove dead dependency on redox-syscall (#240) * Remove dead dependency on redox-syscall Usage of the redox-syscall crate was removed in #225, but its entry in Cargo.toml got left behind. * Remove redundant trailing semicolon To appease a warning in the latest nightly.
diff --git a/Cargo.toml b/Cargo.toml index bdeebfe..e730399 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,8 +28,5 @@ tempfile = "3" xattr = { version = "0.2", optional = true } libc = "0.2" -[target.'cfg(target_os = "redox")'.dependencies] -redox_syscall = "0.1" - [features] default = ["xattr"] diff --git a/src...
2
1
4
462ebb1a591f2ebb57abe1bcd9db5e42fe1738d8
Alex Crichton
2020-08-31T20:16:54
Bump to 0.4.30
diff --git a/Cargo.toml b/Cargo.toml index 565fc46..bdeebfe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.29" +version = "0.4.30" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
ac0d20b5144180d80a54440f2d2f299ee8308afa
Martin Pool
2020-07-09T13:58:44
Note that set_path doesn't directly support long paths (#236)
diff --git a/src/header.rs b/src/header.rs index d48f139..beb5836 100644 --- a/src/header.rs +++ b/src/header.rs @@ -364,6 +364,11 @@ impl Header { /// in the appropriate format. May fail if the path is too long or if the /// path specified is not Unicode and this is a Windows platform. Will /// strip ou...
1
5
0
57c5aae3dc736375520e60b11d7c689a072ac473
Moe
2020-06-17T21:35:16
Implement consistent, configurable overwriting behaviour for files and symlinks (#229) * implement consistent overwrite behaviour for files and symlinks * added tests for overwriting behaviour (file & symlink) * removed unnecessary line break
diff --git a/src/archive.rs b/src/archive.rs index 9ce0378..3dac792 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -23,6 +23,7 @@ pub struct ArchiveInner<R: ?Sized> { unpack_xattrs: bool, preserve_permissions: bool, preserve_mtime: bool, + overwrite: bool, ignore_zeros: bool, obj: RefCe...
3
102
12
0b18e421f3846e887111e4a8e964f7291367ada6
Alex Crichton
2020-06-16T13:58:14
Bump to 0.4.29
diff --git a/Cargo.toml b/Cargo.toml index ce54307..565fc46 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.28" +version = "0.4.29" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
ac02c379411b3bd016c33b2002da6dd5948e3441
Matt Wrock
2020-06-16T13:57:44
cannonicalize unpack destination to safely handle long paths on windows (#230) * cannonicalize unpack destination to safely handle long paths Signed-off-by: mwrock <matt@mattwrock.com> * add test for unpacking path larger than MAX_PATH Signed-off-by: mwrock <matt@mattwrock.com>
diff --git a/src/archive.rs b/src/archive.rs index c9d3ca5..9ce0378 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -1,5 +1,6 @@ use std::cell::{Cell, RefCell}; use std::cmp; +use std::fs; use std::io; use std::io::prelude::*; use std::marker; @@ -151,6 +152,18 @@ impl<'a> Archive<dyn Read + 'a> { } ...
2
26
0
87bc5169c63acccb3650e5fb5dbeb8039e529686
Arka
2020-06-15T16:21:51
Add documentation on path being directory (#233)
diff --git a/src/builder.rs b/src/builder.rs index 34e33e1..9d6ecc6 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -203,6 +203,9 @@ impl<W: Write> Builder<W> { /// so if the archive is in the middle of a read or some other similar /// operation then this may corrupt the archive. /// + /// Note if...
1
6
0
73b5186993b9d7968080b49ef3d42a52893cfb72
Jeremy Soller
2020-05-22T16:29:14
Bump to 0.4.28 (#226)
diff --git a/Cargo.toml b/Cargo.toml index e0b9059..ce54307 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.27" +version = "0.4.28" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
2a0a7cb86113d499dfbf2392198f0ac80beeb9e2
Jeremy Soller
2020-05-21T20:07:57
Remove special casing for Redox (#225)
diff --git a/src/entry.rs b/src/entry.rs index 2f083ef..154cb98 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -509,7 +509,7 @@ impl<'a> EntryFields<'a> { ::std::os::windows::fs::symlink_file(src, dst) } - #[cfg(any(unix, target_os = "redox"))] + #[cfg(unix)] ...
2
8
25
859f4decb1d58dca6b0edb5754a655b0f9ac5ad0
Alex Crichton
2020-05-20T19:21:27
Bump to 0.4.27
diff --git a/Cargo.toml b/Cargo.toml index 0b97b52..e0b9059 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.26" +version = "0.4.27" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
4a47d3199dce9d6119d1ddb91df201dd34b2ba66
Matt Schulte
2020-01-14T15:34:20
Add documentation to stripping of tar path (#220) tar-rs will strip any current directory out of the paths users are passing into the API. This documents that behavior and adds a test to ensure the documented behavior.
diff --git a/src/header.rs b/src/header.rs index 4214e67..bcce180 100644 --- a/src/header.rs +++ b/src/header.rs @@ -362,7 +362,8 @@ impl Header { /// /// This function will set the pathname listed in this header, encoding it /// in the appropriate format. May fail if the path is too long or if the - ...
2
10
2
8b141d0d7119a412373a558d0b884c519b6d44a8
Ben Boeckel
2019-11-11T14:53:10
filetime: require 0.2.8 (#214) This version works with `-Z minimal-versions`.
diff --git a/Cargo.toml b/Cargo.toml index cf97179..0b97b52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ contents are never required to be entirely resident in memory all at once. """ [dependencies] -filetime = "0.2.6" +filetime = "0.2.8" [dev-dependencies] tempfile = "3"
1
1
1
9ac10b5d4d43a763b394c25bf457627f27137ecd
silwol
2019-11-08T17:27:04
Migrate tempdir dependency to tempfile (#215) * Migrate tempdir dependency to tempfile The tempdir crate is deprecated and tempfile is recommended as a successor by its developers. * Run `cargo fmt` * Remove usage of `try` macro
diff --git a/Cargo.toml b/Cargo.toml index df91d5d..cf97179 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ contents are never required to be entirely resident in memory all at once. filetime = "0.2.6" [dev-dependencies] -tempdir = "0.3" +tempfile = "3" [target."cfg(unix)".dependencies] xattr = { ver...
5
47
48
09d47a413b4ae9c27205e39bb79fea7140cfcd5a
Ben Boeckel
2019-10-28T14:32:49
Fix typos (#210) * typos: fix minor typos in documentation and error strings * typos: use proper names for Unicode, Windows, and utf-8 * builder: remove mention that `path` must be relative It is `name` that ends up in the archive, so it needs to be relative.
diff --git a/src/archive.rs b/src/archive.rs index 32af52e..5299b7f 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -176,7 +176,7 @@ impl<'a, R: Read> Entries<'a, R> { /// Indicates whether this iterator will return raw entries or not. /// /// If the raw list of entries are returned, then no preproce...
4
16
17
b7a12d9e5c696d5c3536b8bcdb5088308a4e23d4
Alex Crichton
2019-09-19T00:42:18
Ignore a symlink test on Windows Not too important to run there anyway
diff --git a/tests/entry.rs b/tests/entry.rs index 5d3c8ca..52180ad 100644 --- a/tests/entry.rs +++ b/tests/entry.rs @@ -181,6 +181,7 @@ fn directory_maintains_permissions() { } #[test] +#[cfg(not(windows))] // dangling symlinks have weird permissions fn modify_link_just_created() { let mut ar = tar::Builder:...
1
1
0
dcd28594e10aac5646518f8b1253d20d3cc83a1e
Alex Crichton
2019-09-19T00:34:18
Run `cargo fmt`
diff --git a/src/builder.rs b/src/builder.rs index 5429298..44aa18e 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -419,7 +419,12 @@ fn append_file( append_fs(dst, path, &stat, file, mode, None) } -fn append_dir(dst: &mut dyn Write, path: &Path, src_path: &Path, mode: HeaderMode) -> io::Result<()> { +fn ap...
1
11
2
aa9b4532f4cf7ea8270c75510654ade6e4d3fc83
Alex Crichton
2019-09-19T00:33:55
Use `dyn` for trait objects
diff --git a/src/archive.rs b/src/archive.rs index 433c6de..32af52e 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -33,7 +33,7 @@ pub struct Entries<'a, R: 'a + Read> { } struct EntriesFields<'a> { - archive: &'a Archive<Read + 'a>, + archive: &'a Archive<dyn Read + 'a>, next: u64, done: bool, ...
4
15
15
e9ac1f6ad3afac7b96302b52c489885fa74e39e0
Alex Crichton
2019-05-17T20:21:54
Bump to 0.4.26
diff --git a/Cargo.toml b/Cargo.toml index fbca237..df91d5d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.25" +version = "0.4.26" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
027ce6cd118d03456b1221570d16d3f4001c49e7
Robert Collins
2019-05-17T19:39:15
Avoid unneeded readonly syscalls on Windows
diff --git a/src/entry.rs b/src/entry.rs index 2f16d7c..1af8fa5 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -620,15 +620,18 @@ impl<'a> EntryFields<'a> { mode: u32, _preserve: bool, ) -> io::Result<()> { + if mode & 0o200 == 0o200 { + return Ok(()); + ...
1
5
2
5bd5d569dc56e89ea622790b1ee2dd20901c2a25
Robert Collins
2019-05-12T09:13:24
Return the File instance from Entry::unpack This permits optimisation of unpacking on Windows - which is perhaps overly special cased to include in tar itself? Doing this for rustup which already doesn't use the Archive wrapper :/. With this patch, I reduced rustup's rust-docs install from 21/22s to 11s on my bench m...
diff --git a/src/entry.rs b/src/entry.rs index 2f16d7c..78c4fab 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -47,6 +47,18 @@ pub enum EntryIo<'a> { Data(io::Take<&'a ArchiveInner<Read + 'a>>), } +/// When unpacking items the unpacked thing is returned to allow custom +/// additional handling by users. Today ...
2
48
21
f3c7a253789c355aa640d4b0b6173be0f13dd12d
Robert Collins
2019-05-16T03:47:02
Bug #198: Set mtime and atime on file handles For unix systems this should be marginally more efficient; for Windows systems a whole open/close pair is avoided, which can make significant savings when dealing with many files.
diff --git a/Cargo.toml b/Cargo.toml index 4a76422..fbca237 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ contents are never required to be entirely resident in memory all at once. """ [dependencies] -filetime = "0.2" +filetime = "0.2.6" [dev-dependencies] tempdir = "0.3" diff --git a/src/entry.rs ...
2
2
2
7fba62abafd750cd67b97814c3ed233aa7425c8a
Robert Collins
2019-05-11T23:39:13
Perform file mode setting on the open file Testing with rustup on Windows this reduces extraction of rust-docs in my testbed from 26/27s to 22/23s, for similar reasons that using the set_preserve_mtime(false) call there took it from 31/32s to 26/27s, file system syscall efficiency matters a great deal on Windows.
diff --git a/src/entry.rs b/src/entry.rs index fa745df..fa9d35e 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -420,7 +420,7 @@ impl<'a> EntryFields<'a> { return self .unpack_dir(dst) .and_then(|_| self.header.mode()) - .and_then(|mode| set_perms(dst, mode,...
1
39
12
3c3c771dd8103f38f4c0b968d44558c060337acd
Robert Collins
2019-05-10T04:20:03
Issue #198: Safely overwrite files on extraction Unlinking files before extraction is vulnerable to a TOCTOU race condition, instead O_EXCL must be used when creating the file, and then if that errors due to a conflicting file, it can be unlinked and the operation retried. This has less syscalls in the common case, an...
diff --git a/src/entry.rs b/src/entry.rs index 168e0c1..fa745df 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -1,6 +1,7 @@ use std::borrow::Cow; use std::cmp; use std::fs; +use std::fs::OpenOptions; use std::io::prelude::*; use std::io::{self, Error, ErrorKind, SeekFrom}; use std::marker; @@ -522,16 +523,23 @@ ...
1
17
9
b002ce7143118f424c7605e30ce84790892c8b29
Robert Collins
2019-05-10T03:19:44
Issue #198: Only stat dirs when mkdir fails This eliminates a stat when unpacking directories in the common case of unpacking to an empty target and adds one mkdir for the uncommon case of unpacking to an existing directory structure.
diff --git a/src/entry.rs b/src/entry.rs index e30a827..168e0c1 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -397,15 +397,17 @@ impl<'a> EntryFields<'a> { /// Unpack as destination directory `dst`. fn unpack_dir(&mut self, dst: &Path) -> io::Result<()> { // If the directory already exists just let...
1
9
7
c13d6961f1a89837e1695bdba8d8c3241a718adf
Taylor Cramer
2019-05-09T21:05:42
Remove test tar files from published cargo package
diff --git a/Cargo.toml b/Cargo.toml index 1687d4b..4a76422 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.24" +version = "0.4.25" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
2
1
db59a256856e8894a9106e6448d99f2644666f6c
Alex Crichton
2019-04-29T15:55:43
Bump to 0.4.24
diff --git a/Cargo.toml b/Cargo.toml index 65da41f..1687d4b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.23" +version = "0.4.24" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
46fe37d75e363f7879b0673ff8b19ab112a9430e
Alex Crichton
2019-04-29T15:55:16
Update to implement `Error::source`
diff --git a/src/error.rs b/src/error.rs index 0e9cff9..bfe6af9 100644 --- a/src/error.rs +++ b/src/error.rs @@ -22,7 +22,7 @@ impl error::Error for TarError { &self.desc } - fn cause(&self) -> Option<&error::Error> { + fn source(&self) -> Option<&(error::Error + 'static)> { Some(&self.io...
1
1
1
26f67c087e4ca65d8b382b228bbfe32c9843bb09
Alex Crichton
2019-04-23T16:48:40
Bump to 0.4.23
diff --git a/Cargo.toml b/Cargo.toml index ff60a8b..65da41f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.22" +version = "0.4.23" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
a994a78f999afc5aa2e9c5625d3b1154029d8ada
Matthieu Pizenberg
2019-04-22T20:40:53
Return an Err instead of panicking when it makes sense
diff --git a/src/entry.rs b/src/entry.rs index 20193e7..e30a827 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -484,7 +484,7 @@ impl<'a> EntryFields<'a> { #[cfg(target_arch = "wasm32")] #[allow(unused_variables)] fn symlink(src: &Path, dst: &Path) -> io::Result<()> { - ...
1
2
2
079988b96046e878cc134bc73bf5d6918964791b
Matthieu Pizenberg
2019-04-21T09:06:11
Partial wasm implementation (not crashing at build anymore)
diff --git a/src/entry.rs b/src/entry.rs index f10c7c9..20193e7 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -481,6 +481,12 @@ impl<'a> EntryFields<'a> { }) }; + #[cfg(target_arch = "wasm32")] + #[allow(unused_variables)] + fn symlink(src: &Path, dst: ...
2
47
2
7473c27372a8adaf946e61836eeabf36ed2e25dc
Alex Crichton
2019-04-04T14:14:56
Run rustfmt
diff --git a/src/archive.rs b/src/archive.rs index 8dd6633..433c6de 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -233,7 +233,8 @@ impl<'a> EntriesFields<'a> { let sum = header.as_bytes()[..148] .iter() .chain(&header.as_bytes()[156..]) - .fold(0, |a, b| a + (*b as u3...
5
73
70
d43c8b7e26e1e256cf996769d412cd2b1887ae96
Alex Crichton
2019-04-04T14:14:30
Remove `extern crate` annotations`
diff --git a/src/lib.rs b/src/lib.rs index f257ed8..10adcb5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,14 +21,6 @@ #![deny(missing_docs)] #![cfg_attr(test, deny(warnings))] -extern crate filetime; -#[cfg(unix)] -extern crate libc; -#[cfg(target_os = "redox")] -extern crate syscall; -#[cfg(all(unix, feature = "...
1
0
8
5a52101460b0aa4fd8e95d12aa1413081c51b5ba
Alex Crichton
2019-04-04T14:14:09
Migrate to the 2018 edition
diff --git a/Cargo.toml b/Cargo.toml index bf73077..ff60a8b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ documentation = "https://docs.rs/tar" license = "MIT/Apache-2.0" keywords = ["tar", "tarfile", "encoding"] readme = "README.md" +edition = "2018" description = """ A Rust implementation of a TAR f...
7
28
27
f06c2d01717906019de466fbcd04b2361a574a2e
Alex Crichton
2019-04-04T14:13:18
Remove now-unused imports
diff --git a/src/entry.rs b/src/entry.rs index d07c987..b1e254d 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -599,7 +599,6 @@ impl<'a> EntryFields<'a> { fn set_xattrs(me: &mut EntryFields, dst: &Path) -> io::Result<()> { use std::ffi::OsStr; use std::os::unix::prelude::*; - ...
2
0
2
9eae9dc8c6db2f3387e384a95e3d4ace6be72e9e
Alex Crichton
2019-03-14T18:44:21
Bump to 0.4.22
diff --git a/Cargo.toml b/Cargo.toml index 2c160e9..bf73077 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.21" +version = "0.4.22" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
7e563392f76f8ecae4d0d52a25234193df6c2084
boasting-squirrel
2019-03-13T19:29:00
Refactored predicate to highlight precedence + added explanation
diff --git a/src/builder.rs b/src/builder.rs index 2446284..f5f4a3b 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -489,7 +489,8 @@ fn append_dir_all( let mut stack = vec![(src_path.to_path_buf(), true, false)]; while let Some((src, is_dir, is_symlink)) = stack.pop() { let dest = path.join(src.s...
1
2
1
2ae08314a2487b756818cc5d232f2f20c7380c42
boasting-squirrel
2019-03-13T07:02:46
Switched to buffer instead of actual tar file
diff --git a/tests/all.rs b/tests/all.rs index edca18d..893b98c 100644 --- a/tests/all.rs +++ b/tests/all.rs @@ -1020,15 +1020,13 @@ fn tar_directory_containing_symlink_to_directory() { use std::os::unix::fs::symlink; let td = t!(TempDir::new("tar-rs")); - let td2 = t!(TempDir::new("symlinks")); let...
1
3
5
4c7c6e8828b5b364f5fd340c82b6ea8f764c764c
boasting-squirrel
2019-03-12T22:43:39
Added cfg unix
diff --git a/tests/all.rs b/tests/all.rs index c3bdd8a..edca18d 100644 --- a/tests/all.rs +++ b/tests/all.rs @@ -1015,6 +1015,7 @@ fn insert_local_file_different_name() { } #[test] +#[cfg(unix)] fn tar_directory_containing_symlink_to_directory() { use std::os::unix::fs::symlink;
1
1
0
877e9e9bd59177fe269e92d0e7e622f16510efb1
boasting-squirrel
2019-03-12T22:32:06
Added assertions
diff --git a/tests/all.rs b/tests/all.rs index 7eb1098..c3bdd8a 100644 --- a/tests/all.rs +++ b/tests/all.rs @@ -1026,6 +1026,8 @@ fn tar_directory_containing_symlink_to_directory() { let mut ar = Builder::new(tar_file); t!(symlink(dummy_src.path().display().to_string(), &dummy_dst)); + assert!(dummy_dst...
1
3
1
f4632330e5363c5b025a5d7ed3dde7b3423d281d
boasting-squirrel
2019-03-12T22:28:01
Added test for symlinks pointing to dir
diff --git a/tests/all.rs b/tests/all.rs index 1361228..7eb1098 100644 --- a/tests/all.rs +++ b/tests/all.rs @@ -1013,3 +1013,19 @@ fn insert_local_file_different_name() { assert_eq!(t!(entry.path()), Path::new("archive/dir/f")); assert!(entries.next().is_none()); } + +#[test] +fn tar_directory_containing_sy...
1
16
0
3f2a103912dc5e35c395b8a2bf714f49ac0cce0f
boasting-squirrel
2019-03-12T20:55:53
Refactored append_dir_all to avoid code duplication
diff --git a/src/builder.rs b/src/builder.rs index 72ca221..2446284 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use std::fs; use std::io; use std::io::prelude::*; -use std::path::{Path, PathBuf}; +use std::path::Path; use header::{bytes2path, path2bytes, HeaderMode}; us...
1
11
27
2658cb6f2fe7b1bedef1cf205030166603b9d569
boasting-squirrel
2019-03-09T15:09:51
Handles symlinks pointing to directories
diff --git a/src/builder.rs b/src/builder.rs index d216873..72ca221 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use std::fs; use std::io; use std::io::prelude::*; -use std::path::Path; +use std::path::{Path, PathBuf}; use header::{bytes2path, path2bytes, HeaderMode}; us...
1
26
10
8029eadd07a0d3bd02ae7f977d1871eeae527bc9
Louis
2019-03-04T17:51:38
Bump to 0.4.21
diff --git a/Cargo.toml b/Cargo.toml index 4ca0f3a..2c160e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.20" +version = "0.4.21" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
181147ac738a4015d7e9dd436f60d44057d2ac48
Louis
2019-03-01T09:45:15
builder: append_path_with_name()
diff --git a/src/builder.rs b/src/builder.rs index 7d55639..d216873 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -189,7 +189,43 @@ impl<W: Write> Builder<W> { pub fn append_path<P: AsRef<Path>>(&mut self, path: P) -> io::Result<()> { let mode = self.mode.clone(); let follow = self.follow; ...
2
69
5
33a0b2ffda6e8fc299d03ce67e66132414938ca0
Louis
2019-02-26T14:02:42
builder: handle long link names As already implemented for long path names, handle packing long link with the GNU extension (entry type 'K') in append_fs function.
diff --git a/src/builder.rs b/src/builder.rs index 1e3a443..7d55639 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -157,7 +157,7 @@ impl<W: Write> Builder<W> { path: P, data: R, ) -> io::Result<()> { - prepare_header(self.get_mut(), header, path.as_ref())?; + prepare_header_pat...
3
71
20
4abc443876d61a584eb38e049d907c47db52c48f
Josh Leeb-du Toit
2019-02-16T00:22:56
Untar directory with archive perms as default This PR modifies the default behaviour for extracting a directory. Previously the extracted dir would have the system default perms. Now, the directory will have the same permissions as the tar file.
diff --git a/src/entry.rs b/src/entry.rs index fdddf6f..d07c987 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -401,12 +401,12 @@ impl<'a> EntryFields<'a> { if prev.map(|m| m.is_dir()).unwrap_or(false) { return Ok(()); } - return fs::create_dir(dst).map_err(|err| { + fs::cr...
2
35
8
191b74417373d1d420fa59c552477f5ceca42b7f
nickkuk
2018-11-29T17:35:40
Add two public methods to tar Builder: get_ref and get_mut.
diff --git a/src/builder.rs b/src/builder.rs index 5b5c615..1e3a443 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -31,10 +31,6 @@ impl<W: Write> Builder<W> { } } - fn inner(&mut self) -> &mut W { - self.obj.as_mut().unwrap() - } - /// Changes the HeaderMode that will be used when...
1
22
11
8417a7c3694b39fc32bf936533635c20e764166b
Alex Crichton
2018-11-14T15:43:14
Bump to 0.4.20
diff --git a/Cargo.toml b/Cargo.toml index 8d07083..4ca0f3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.19" +version = "0.4.20" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
06d34282e5b776d96d2d9848de34a708ddcfdd42
Alex Crichton
2018-11-14T15:41:44
Handle `@LongLink` in old BSD compat The file name may have a trailing `/`, but that doesn't mean that it's a directory if the entry's actual name was in a preceding `@LongLink` section. Closes #173
diff --git a/src/entry.rs b/src/entry.rs index 5cffbce..fdddf6f 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -499,7 +499,7 @@ impl<'a> EntryFields<'a> { // Names that have a trailing slash should be treated as a directory. // Only applies to old headers. if self.header.as_ustar().is_none()...
2
34
1
0f8e2360fe3e6dee74fb0a686c34c80aa5a5271f
Alex Crichton
2018-11-09T15:39:21
Bump to 0.4.19
diff --git a/Cargo.toml b/Cargo.toml index 11bcbe6..8d07083 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.4.18" +version = "0.4.19" authors = ["Alex Crichton <alex@alexcrichton.com>"] homepage = "https://github.com/alexcrichton/tar-rs" repository = "https://github.co...
1
1
1
01e895af975c28b5ef5e858f7d5f253addd58b64
John-John Tedro
2018-11-08T14:06:06
Support BSD-style tar directories
diff --git a/src/entry.rs b/src/entry.rs index c21d915..5cffbce 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -394,21 +394,27 @@ impl<'a> EntryFields<'a> { Ok(true) } + /// Unpack as destination directory `dst`. + fn unpack_dir(&mut self, dst: &Path) -> io::Result<()> { + // If the direct...
2
52
11
f1621cc605650db94b4758c4a3420bbdfd4850a1
John-John Tedro
2018-11-09T03:39:49
Removed test cases which are already covered
diff --git a/tests/all.rs b/tests/all.rs index 0510c0b..e7a5a46 100644 --- a/tests/all.rs +++ b/tests/all.rs @@ -31,18 +31,6 @@ macro_rules! tar { mod header; -#[test] -fn simple() { - let mut ar = Archive::new(Cursor::new(tar!("simple.tar"))); - for entry in t!(ar.entries()) { - t!(entry); - } - ...
1
0
24