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 |
|---|---|---|---|---|---|---|---|
4d804104721c3e5c406c8d5a1cbc4df0e286560c | Paul Colomiets | 2016-04-27T21:31:26 | Add GNUSparse file type | diff --git a/src/entry_type.rs b/src/entry_type.rs
index 86df27c..f73b77d 100644
--- a/src/entry_type.rs
+++ b/src/entry_type.rs
@@ -27,6 +27,8 @@ pub enum EntryType {
GNULongName,
/// GNU extension - long link name (link target)
GNULongLink,
+ /// GNU extension - sparse file
+ GNUSparse,
/// ... | 1 | 4 | 0 |
eee866310da0999ead3085b17e3ab3d9a9af1ab1 | Paul Colomiets | 2016-04-27T21:29:25 | Add `list` example which list files in archive from stdin | diff --git a/examples/list.rs b/examples/list.rs
new file mode 100644
index 0000000..289b3fd
--- /dev/null
+++ b/examples/list.rs
@@ -0,0 +1,14 @@
+extern crate tar;
+
+use std::io::{stdin};
+
+use tar::Archive;
+
+
+fn main() {
+ let mut arch = Archive::new(stdin());
+ for file in arch.entries().unwrap() {
+ ... | 1 | 14 | 0 |
7f8696e33f33306216bb429ff2a2c14a8f4185ee | Alex Crichton | 2016-04-11T18:54:42 | Bump to 0.4.5 | diff --git a/Cargo.toml b/Cargo.toml
index 0f5e0a9..c5a06e3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.4"
+version = "0.4.5"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
d08897ae6d7a1d7a5bb381e24c5402a8d15eca46 | Alex Crichton | 2016-04-11T18:53:32 | Always peel at least one component off for ustar paths
Fixes an out of bounds index in UstarHeader::_set_path because our assumption
that at least one element was chopped off is now true.
Closes #61 | diff --git a/src/header.rs b/src/header.rs
index d508abb..19ed156 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -658,7 +658,7 @@ impl UstarHeader {
// components where it can fit in name/prefix. To do that we peel off
// enough until the path fits in `prefix`, then we try to put both
// h... | 2 | 14 | 5 |
baed5933ec3b886f50202fbedb5be4029c534689 | Alex Crichton | 2016-03-24T23:25:24 | Fix a typo | diff --git a/src/archive.rs b/src/archive.rs
index 3875a07..9cc5041 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -161,7 +161,7 @@ impl<'a> Archive<Read + 'a> {
}));
}
try!(file.unpack(&file_dst).map_err(|e| {
- TarError::new(&format!("failed to unpacked `... | 1 | 1 | 1 |
f269f7b7f7968a0f44a410bbd705ba55f3631ff2 | Tshepang Lekhonkhobe | 2016-03-17T06:37:16 | doc: small fixes to the intro | diff --git a/src/lib.rs b/src/lib.rs
index ed0fc62..f5cea41 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,8 +1,8 @@
//! A library for reading and writing TAR archives
//!
-//! This library provides utilities necessary to manage TAR archives [1]
+//! This library provides utilities necessary to manage [TAR archives][... | 1 | 2 | 2 |
a1cfab14ac67c72b31121040df9ab7fe3058b11d | Alex Crichton | 2016-02-22T21:12:57 | Bump to 0.4.4 | diff --git a/Cargo.toml b/Cargo.toml
index 7f8afb7..0f5e0a9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.3"
+version = "0.4.4"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
bbbe5b129099e214fb74aba4957d74fd97c6846c | Alex Crichton | 2016-02-22T20:57:46 | Add a trailing nul byte to long names in archives
Apparently GNU does this, so we should too! | diff --git a/src/builder.rs b/src/builder.rs
index 2e23f71..c0d5618 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -244,10 +244,10 @@ fn append_fs(dst: &mut Write,
}
let mut header2 = Header::new_gnu();
try!(header2.set_path("././@LongLink"));
- header2.set_size(data.len() as u64)... | 2 | 22 | 2 |
aced6f5e1b2565e47208cac22cc1410ccf78599e | Alex Crichton | 2016-02-22T20:52:40 | Chop off a trailing nul byte in long link/path names | diff --git a/src/entry.rs b/src/entry.rs
index 0cc9922..3516c16 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -177,7 +177,13 @@ impl<'a> EntryFields<'a> {
fn path_bytes(&self) -> Cow<[u8]> {
match self.long_pathname {
- Some(ref bytes) => Cow::Borrowed(bytes),
+ Some(ref bytes) =... | 2 | 65 | 3 |
1382ad45add193de43fee56add607c632f54dcbc | Alex Crichton | 2016-02-22T06:21:50 | Preserve `\` characters in path names
Historically this library mapped all `\` characters into `/` characters to
handle encoding Windows paths. This is incorrect behavior, however, on Unix
where `\` is a valid character in filenames.
This commit tweaks the treatment of `\` to ignore it everywhere essentially.
Directo... | diff --git a/src/builder.rs b/src/builder.rs
index 8e1d7e0..2e23f71 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -88,7 +88,7 @@ impl<W: Write> Builder<W> {
/// This function will open the file specified by `path` and insert the file
/// into the archive with the appropriate metadata set, returning any ... | 5 | 155 | 110 |
38558b20efd7206f310bb7db299871feecf2a65b | Alex Crichton | 2016-02-17T18:47:03 | Bump to 0.4.3 | diff --git a/Cargo.toml b/Cargo.toml
index dc7281e..7f8afb7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.2"
+version = "0.4.3"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
cd816006dd96cd1efa15fb33673103a90542c8c4 | Alex Crichton | 2016-02-17T18:46:53 | Fix compat on nightly | diff --git a/src/entry.rs b/src/entry.rs
index d39beaa..f8c4e5a 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -282,6 +282,7 @@ impl<'a> EntryFields<'a> {
return Ok(());
#[cfg(unix)]
+ #[allow(deprecated)] // raw deprecated in 1.8
fn set_perms(dst: &Path, mode: u32) -> io::Result<()... | 2 | 2 | 1 |
046e781e88cf4239a6d516a16ca416a01bd29378 | Alex Crichton | 2016-02-13T08:34:30 | Bump to 0.4.2 | diff --git a/Cargo.toml b/Cargo.toml
index 2456c62..dc7281e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.1"
+version = "0.4.2"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
5eaab0c2cc6437fee03613873848dfecc942b220 | Alex Crichton | 2016-02-13T08:34:16 | Fix a syntax error | diff --git a/src/header.rs b/src/header.rs
index 2407118..b409b78 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -594,7 +594,7 @@ impl Header {
#[cfg(windows)]
fn fill_from(&mut self, meta: &fs::Metadata) {
- const FILE_ATTRIBUTE_READONLY: u32 = 0x00000001
+ const FILE_ATTRIBUTE_READONLY: u... | 1 | 1 | 1 |
53b784d6226947c2792fc7a4f2b2f9b168aaf8b7 | Alex Crichton | 2016-02-13T08:30:19 | Bump to 0.4.1 | diff --git a/Cargo.toml b/Cargo.toml
index 65e57e7..2456c62 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.0"
+version = "0.4.1"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
043a78926faa3e9de40341c6c443998edcfb57d4 | Alex Crichton | 2016-02-13T08:29:54 | Just inline the one definition we need from winapi | diff --git a/Cargo.toml b/Cargo.toml
index d4f7274..65e57e7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,7 +20,6 @@ contents are never required to be entirely resident in memory all at once.
[dependencies]
libc = "0.2"
filetime = "0.1.5"
-winapi = "0.2"
[dev-dependencies]
tempdir = "0.3"
diff --git a/src/head... | 3 | 2 | 5 |
dfeb5d62065f9ce5662fb7b77a5cd1ee383ee99c | Alex Crichton | 2016-01-29T17:23:04 | Remove outdated TODO
GNU extensions are indeed implemented | diff --git a/src/archive.rs b/src/archive.rs
index 749d4e0..3875a07 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -106,8 +106,6 @@ impl<'a> Archive<Read + 'a> {
fn _unpack(&mut self, dst: &Path) -> io::Result<()> {
'outer: for entry in try!(self._entries()) {
- // TODO: although it may ... | 1 | 0 | 2 |
f18ed3d214cbb12dff29d4bcf4dd32b401062d6c | Aidan Hobson Sayers | 2016-01-27T12:11:54 | Correct `into` to `dst` in `unpack` documentation
Fixes #54 | diff --git a/src/archive.rs b/src/archive.rs
index a9a18f8..749d4e0 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -72,7 +72,7 @@ impl<R: Read> Archive<R> {
/// path name.
///
/// This operation is relatively sensitive in that it will not write files
- /// outside of the path specified by `into`.... | 1 | 1 | 1 |
d193ec712d3145b30dc2f0dfac762b0392c90456 | Alex Crichton | 2016-01-22T20:10:45 | Set the `done` flag on iteration error as well
Otherwise iteration may never terminate
Closes #53 | diff --git a/src/archive.rs b/src/archive.rs
index 2fce07f..a9a18f8 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -336,7 +336,10 @@ impl<'a> Iterator for EntriesFields<'a> {
self.done = true;
None
}
- Err(e) => Some(Err(e)),
+ ... | 1 | 4 | 1 |
fd9b2cda134bac962fb48b219a69601fccc64ea1 | Aidan Hobson Sayers | 2016-01-22T14:17:18 | Create and expose EntryType enum | diff --git a/src/entry_type.rs b/src/entry_type.rs
index 336a5c3..86df27c 100644
--- a/src/entry_type.rs
+++ b/src/entry_type.rs
@@ -3,9 +3,41 @@
///
/// Each `Header` has an `entry_type` method returning an instance of this type
/// which can be used to inspect what the header is describing.
+
+/// A non-exhaustive... | 1 | 89 | 28 |
4b095c863c04ef10b3a79beed8ecb481c469353b | Alex Crichton | 2016-01-21T17:51:25 | Bump tar to 0.4.0 | diff --git a/Cargo.toml b/Cargo.toml
index 6a3b56d..d4f7274 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.3.3"
+version = "0.4.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
58e869b6dfdd04e28d8c036ec7bf95f991e6014f | Alex Crichton | 2016-01-20T18:29:43 | Move set methods on Header to constructors | diff --git a/src/archive.rs b/src/archive.rs
index b3980ce..2fce07f 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -216,7 +216,7 @@ impl<'a> EntriesFields<'a> {
let delta = self.next - self.archive.inner.pos.get();
try!(self.archive.skip(delta));
- let mut header = Header::new();
+ ... | 5 | 57 | 60 |
7b77a1fbcd94de447f4f37b82a2a8b8fde1d9829 | Alex Crichton | 2016-01-20T05:26:50 | Ignore pax local and global extensions when unpacking | diff --git a/src/entry.rs b/src/entry.rs
index 46f51d6..bcfaf9e 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -194,12 +194,22 @@ impl<'a> EntryFields<'a> {
fn symlink(src: &Path, dst: &Path) -> io::Result<()> {
::std::os::unix::fs::symlink(src, dst)
}
- } else if !kin... | 2 | 24 | 4 |
2588cf96a68ce55ee155704055a0584124a9d1b5 | Alex Crichton | 2016-01-20T05:18:59 | Use Entry::{path, link_name} where possible | diff --git a/src/archive.rs b/src/archive.rs
index 85d158c..003b86b 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -127,7 +127,7 @@ impl<'a> Archive<Read + 'a> {
let mut file_dst = dst.to_path_buf();
{
- let path = try!(file.header().path().map_err(|e| {
+ ... | 2 | 2 | 2 |
f3afe16ffe37ea89cacfcfc105660f601f85d935 | Alex Crichton | 2016-01-20T02:05:42 | Add a raw iterator, start processing GNU extensions
Process extensions by default but add the ability to return a raw entry without
any processing having been done. | diff --git a/src/archive.rs b/src/archive.rs
index 3231cba..85d158c 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -11,13 +11,6 @@ use error::TarError;
use other;
use {Entry, Header};
-macro_rules! try_iter {
- ($me:expr, $e:expr) => (match $e {
- Ok(e) => e,
- Err(e) => { $me.done = true; ret... | 5 | 216 | 51 |
ab83429b330fd2ab068a76a3f1d257e21f1bde92 | Alex Crichton | 2016-01-20T01:23:38 | Remove custom GNU support temporarily | diff --git a/src/gnu.rs b/src/gnu.rs
deleted file mode 100644
index 268749b..0000000
--- a/src/gnu.rs
+++ /dev/null
@@ -1,109 +0,0 @@
-use std::borrow::Cow;
-use std::cmp;
-use std::io::prelude::*;
-use std::io::{self, SeekFrom};
-use std::path::Path;
-
-use header::bytes2path;
-use other;
-use {Entry, Header};
-
-macr... | 2 | 0 | 111 |
ee40e2155c7e9d1894dce483e91f7eb334754dd0 | Alex Crichton | 2016-01-19T01:10:31 | Split out a Builder from the Archive type
Using the same type for both building and reading is bound to lead to confusion
when the two are easily composable together, so add a separate and dedicated
type to just building archives. The `tar::Builder` type has the same API as
before, but now doesn't require calling the ... | diff --git a/src/archive.rs b/src/archive.rs
index 9a6946f..02afb6a 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -1,4 +1,3 @@
-use std::borrow::Cow;
use std::cell::{RefCell, Cell};
use std::cmp;
use std::fs;
@@ -6,14 +5,12 @@ use std::io::prelude::*;
use std::io::{self, SeekFrom};
use std::marker;
use std:... | 6 | 333 | 295 |
0422e84b5603a8f8cc4b01cd08c730da3b216dc8 | Alex Crichton | 2016-01-19T00:17:57 | Remove hidden old type aliases
Gonna make breaking changes anyway, let's clean these out. | diff --git a/src/archive.rs b/src/archive.rs
index 475278b..9a6946f 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -52,10 +52,6 @@ impl<R: ?Sized> DerefMut for AlignHigher<R> {
fn deref_mut(&mut self) -> &mut R { &mut self.1 }
}
-/// Backwards compatible alias for `Entries`.
-#[doc(hidden)]
-pub type Files... | 2 | 0 | 24 |
f3a9bd024543802a84fe796b51e1cc6d3a8c2f36 | Alex Crichton | 2016-01-19T00:17:10 | Remove the Read impl on &Archive<R>
This wasn't meant to be a public-facing impl | diff --git a/src/archive.rs b/src/archive.rs
index 95805b6..475278b 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -26,6 +26,10 @@ macro_rules! try_iter {
///
/// This archive can have an entry added to it and it can be iterated over.
pub struct Archive<R: ?Sized> {
+ inner: ArchiveInner<R>,
+}
+
+struct Arc... | 2 | 54 | 46 |
f122eb8602302ad2ea3bc4719ae0650826869581 | Alex Crichton | 2016-01-18T22:42:41 | Add lots of tests for the header type | diff --git a/src/header.rs b/src/header.rs
index ac37c89..0a4db9a 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -214,14 +214,12 @@ impl Header {
/// Returns a view into this header as a byte array.
pub fn as_bytes(&self) -> &[u8; 512] {
- debug_assert_eq!(512, mem::size_of_val(self));
- un... | 3 | 150 | 16 |
eb42df6b34f32e35c0c9a8316a18585941892a68 | Alex Crichton | 2016-01-18T22:16:18 | Redesign the Header API
Make the default Header type an opaque structure with method accessors, but add
casts to the Old, UStar, and GNU header types. Additionally start emitting GNU
headers by default instead of UStar.
The generic `Header` can be casted to each specific header type, adding more
functionality and met... | diff --git a/src/archive.rs b/src/archive.rs
index 6bf8c76..95805b6 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -380,12 +380,12 @@ impl<W: Write> Archive<W> {
/// let mut data: &[u8] = &[1, 2, 3, 4];
///
/// let mut ar = Archive::new(Vec::new());
- /// ar.append(&header, &mut data).unwrap();
+... | 4 | 495 | 115 |
78bef06abe82264275798cb64bd1dba0b2f934ed | Alex Crichton | 2015-12-22T00:26:30 | Add support for GNU long names | diff --git a/src/archive.rs b/src/archive.rs
index 459efd7..6bf8c76 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -1,3 +1,4 @@
+use std::borrow::Cow;
use std::cell::{RefCell, Cell};
use std::cmp;
use std::fs;
@@ -10,8 +11,9 @@ use std::path::{Path, Component};
use entry::EntryFields;
use error::TarError;
-... | 6 | 162 | 12 |
6dbbe2d981f2e7511f63807fad0d3fb67ac9b3d8 | Alex Crichton | 2016-01-11T19:44:22 | Bump to 0.3.3 | diff --git a/Cargo.toml b/Cargo.toml
index 5ff46e3..6a3b56d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.3.2"
+version = "0.3.3"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
885d49b0fe907fa5c07f32ffd5baaa9d38e1a158 | Alex Crichton | 2015-12-21T23:35:42 | Add a macro to include tarball in tests | diff --git a/tests/all.rs b/tests/all.rs
index 569c852..2132b02 100644
--- a/tests/all.rs
+++ b/tests/all.rs
@@ -19,13 +19,17 @@ macro_rules! t {
})
}
+macro_rules! tar {
+ ($e:expr) => (&include_bytes!(concat!("archives/", $e))[..])
+}
+
#[test]
fn simple() {
- let ar = Archive::new(Cursor::new(&includ... | 1 | 16 | 12 |
60a785dbf5b4e1091d88f999c421f69b562eda66 | Alex Crichton | 2015-12-21T23:32:44 | Move try_iter to archive | diff --git a/src/archive.rs b/src/archive.rs
index 349c825..459efd7 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -13,6 +13,13 @@ use error::TarError;
use {Entry, Header};
use other;
+macro_rules! try_iter {
+ ($me:expr, $e:expr) => (match $e {
+ Ok(e) => e,
+ Err(e) => { $me.done = true; ret... | 2 | 7 | 7 |
4560b06a0a766e558ff33e5591f458563a4b74d5 | Alex Crichton | 2015-12-21T23:32:21 | Purge bad_archive, fix windows build | diff --git a/src/archive.rs b/src/archive.rs
index 67bf0eb..349c825 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -11,7 +11,7 @@ use std::path::{Path, Component};
use entry::EntryFields;
use error::TarError;
use {Entry, Header};
-use {bad_archive, other};
+use other;
/// A top-level representation of an arc... | 3 | 62 | 66 |
e422865a0e4ad37a2b49bf50d04a22db72f58051 | Alex Crichton | 2015-12-21T23:26:58 | Extract Archive and iterators to a separate module | diff --git a/src/archive.rs b/src/archive.rs
new file mode 100644
index 0000000..67bf0eb
--- /dev/null
+++ b/src/archive.rs
@@ -0,0 +1,620 @@
+use std::cell::{RefCell, Cell};
+use std::cmp;
+use std::fs;
+use std::io::prelude::*;
+use std::io::{self, SeekFrom};
+use std::marker;
+use std::mem;
+use std::ops::{Deref, De... | 2 | 632 | 625 |
69eb4983561287e08374439b63f754906845ce72 | Alex Crichton | 2015-12-21T23:26:40 | Reduce usage of bad_archive() | diff --git a/src/entry.rs b/src/entry.rs
index 139e59a..9c86b9d 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -9,7 +9,7 @@ use filetime::{self, FileTime};
use error::TarError;
use {Header, Archive};
-use {bad_archive, other};
+use other;
/// Backwards compatible alias for `Entry`.
#[doc(hidden)]
@@ -132,7 +13... | 2 | 5 | 5 |
51b5d676eeb4fecaff4b46687a72a5e9f4b0b58c | Alex Crichton | 2015-12-21T23:20:25 | Extract Entry to its own module | diff --git a/src/entry.rs b/src/entry.rs
new file mode 100644
index 0000000..139e59a
--- /dev/null
+++ b/src/entry.rs
@@ -0,0 +1,203 @@
+use std::cmp;
+use std::fs;
+use std::io::prelude::*;
+use std::io::{self, SeekFrom};
+use std::marker;
+use std::path::Path;
+
+use filetime::{self, FileTime};
+
+use error::TarError... | 2 | 210 | 190 |
da2988bbd875a5c02bbe551bc1ed45f683f94ab0 | Alex Crichton | 2015-12-21T23:19:42 | Move truncate to the header module | diff --git a/src/header.rs b/src/header.rs
index 082f3b5..e40f0c2 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -14,7 +14,7 @@ use std::str;
use libc;
use EntryType;
-use {bad_archive, truncate, other, path2bytes, bytes2path};
+use {bad_archive, other, path2bytes, bytes2path};
/// Representation of the heade... | 2 | 8 | 8 |
7cd9bb2fb4e01a034deaa8518d808a1db7b2d1c0 | Alex Crichton | 2015-12-21T23:12:44 | Extract TarError to its own module | diff --git a/src/error.rs b/src/error.rs
new file mode 100644
index 0000000..0e9cff9
--- /dev/null
+++ b/src/error.rs
@@ -0,0 +1,40 @@
+use std::error;
+use std::fmt;
+use std::io::{self, Error};
+
+#[derive(Debug)]
+pub struct TarError {
+ desc: String,
+ io: io::Error,
+}
+
+impl TarError {
+ pub fn new(desc... | 2 | 43 | 41 |
198bf295ba9fa540acf1c329e330f2bed70aa04d | Alex Crichton | 2015-12-21T23:07:36 | Extract entry_type to its own module | diff --git a/src/entry_type.rs b/src/entry_type.rs
new file mode 100644
index 0000000..a2ad8a2
--- /dev/null
+++ b/src/entry_type.rs
@@ -0,0 +1,104 @@
+// See https://en.wikipedia.org/wiki/Tar_%28computing%29#UStar_format
+/// Indicate for the type of file described by a header.
+///
+/// Each `Header` has an `entry_ty... | 3 | 108 | 105 |
45346b7e975d35c086e0056a372a7a2110c784b8 | Alex Crichton | 2015-12-21T23:05:32 | Move Header to its own module | diff --git a/src/header.rs b/src/header.rs
new file mode 100644
index 0000000..fa1ad27
--- /dev/null
+++ b/src/header.rs
@@ -0,0 +1,468 @@
+#[cfg(unix)] use std::os::unix::prelude::*;
+#[cfg(windows)] use std::os::windows::prelude::*;
+
+use std::borrow::Cow;
+use std::cmp;
+use std::fmt;
+use std::fs;
+use std::io;
+u... | 2 | 487 | 474 |
ecfab7bd72094a6c0dce34e7d1fd99470d88c3c4 | Alex Crichton | 2015-12-02T01:45:04 | Force a higher alignment for stored objects
Hopefully this should work around the segfaults on Windows. | diff --git a/src/lib.rs b/src/lib.rs
index f03ff41..ac3f394 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -29,6 +29,7 @@ use std::io::{self, Error, ErrorKind, SeekFrom};
use std::iter::repeat;
use std::marker;
use std::mem;
+use std::ops::{Deref, DerefMut};
use std::path::{Path, PathBuf, Component};
use std::str;
... | 1 | 23 | 4 |
8e08ccc26545f90abc1c24795109fa3f73e43fd5 | Alex Crichton | 2015-12-02T01:37:27 | Be a little more faithful to the phantom type
Instead of &R we're actually storing &Archive<R> which has a RefCell in the
middle and might affect something down the road. | diff --git a/src/lib.rs b/src/lib.rs
index 5175b0c..f03ff41 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -69,7 +69,7 @@ pub type Files<'a, T> = Entries<'a, T>;
/// Requires that `R` implement `Seek`.
pub struct Entries<'a, R: 'a> {
fields: EntriesFields<'a>,
- _ignored: marker::PhantomData<&'a R>,
+ _ignore... | 1 | 3 | 3 |
1d816a87328582806688ace4cc44b51dd8977054 | Alex Crichton | 2015-12-02T01:37:18 | Remove some unnecessary ?Sized annotations | diff --git a/src/lib.rs b/src/lib.rs
index 1bbae4a..5175b0c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -67,7 +67,7 @@ pub type Files<'a, T> = Entries<'a, T>;
/// An iterator over the entries of an archive.
///
/// Requires that `R` implement `Seek`.
-pub struct Entries<'a, R: 'a + ?Sized> {
+pub struct Entries<'a, ... | 1 | 5 | 5 |
53dc3144741caf9be2a6f9e2f303708d53981036 | Alex Crichton | 2015-12-01T19:03:44 | Revert "Fix 32-bit Windows CI"
This reverts commit 0d205874338d2326f6937796a269298bf16edf1d.
Conflicts:
src/lib.rs | diff --git a/src/lib.rs b/src/lib.rs
index 93e6826..1bbae4a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -55,29 +55,11 @@ macro_rules! try_iter {
/// A top-level representation of an archive file.
///
/// This archive can have an entry added to it and it can be iterated over.
-pub struct Archive<R> {
+pub struct Arch... | 1 | 70 | 108 |
775813ddf55c26b85e5c19c817d6a6f3e5e36bd2 | Alex Crichton | 2015-11-30T22:16:30 | Move the `entries` method onto an object | diff --git a/src/lib.rs b/src/lib.rs
index bd0adcf..93e6826 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -216,17 +216,26 @@ impl<R: Seek + Read> Archive<R> {
/// to handle invalid tar archives as well as any intermittent I/O error
/// that occurs.
pub fn entries(&self) -> io::Result<Entries<R>> {
+ ... | 1 | 19 | 10 |
0d205874338d2326f6937796a269298bf16edf1d | Alex Crichton | 2015-11-30T22:06:44 | Fix 32-bit Windows CI
Apparently there are some codegen problems with unsized types flying around. To
alleviate this just box up the `RefCell<T>` and then hope it all works out.
Involves jumping through a few hoops to get all the types to work out just right
though. | diff --git a/src/lib.rs b/src/lib.rs
index e9091ba..bd0adcf 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -55,10 +55,28 @@ macro_rules! try_iter {
/// A top-level representation of an archive file.
///
/// This archive can have an entry added to it and it can be iterated over.
-pub struct Archive<R: ?Sized> {
+pub str... | 1 | 99 | 65 |
dfd7338e8a5dd73f12fe1e01399cea8bd87ae63f | Alex Crichton | 2015-11-23T20:22:09 | Detect symlinks when unpacking and handle them
Also prevent future unknown file types from silently succeeding, instead return
an error for any unknown file type found.
Closes #40
Closes #41 | diff --git a/src/lib.rs b/src/lib.rs
index 6a13671..e9091ba 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -340,20 +340,16 @@ impl<'a> Archive<Read + 'a> {
continue
}
- let entry_type = EntryType::new(file.header.link[0]);
- if entry_type.is_dir() {
- tr... | 1 | 56 | 11 |
8cb15510b682f8adbaef79042ee948467cc4799b | Alex Crichton | 2015-11-23T20:19:17 | Add shorthand for other errors | diff --git a/src/lib.rs b/src/lib.rs
index d24d9ed..6a13671 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -278,9 +278,8 @@ impl<R: Read> Archive<R> {
impl<'a> Archive<Read + 'a> {
fn _entries_mut(&mut self) -> io::Result<EntriesMutFields> {
if self.pos.get() != 0 {
- return Err(Error::new(ErrorK... | 1 | 17 | 16 |
7ec62b85b2e692754b4c9373ac502d232e8c039b | Alex Crichton | 2015-11-23T19:55:27 | Re-fix windows compiles | diff --git a/src/lib.rs b/src/lib.rs
index 6a9ded2..d24d9ed 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1057,7 +1057,7 @@ impl Header {
let ft = meta.file_type();
self.set_entry_type(if ft.is_dir() {
- EntryType::directory()
+ EntryType::dir()
} else if ft.is_file() {... | 1 | 1 | 1 |
c7f799feb3ddcfd9c29e2fbf7461077d0ea5dd59 | Alex Crichton | 2015-11-23T19:49:49 | Add a link to more docs | diff --git a/src/lib.rs b/src/lib.rs
index 8e60e3f..5dce591 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -7,6 +7,9 @@
//!
//! [1]: http://en.wikipedia.org/wiki/Tar_%28computing%29
+// More docs about the detailed tar format can also be found here:
+// http://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5&manpath=Fr... | 1 | 3 | 0 |
5a720db503d237047837c9425b3862a2d7f2d861 | Alex Crichton | 2015-11-23T19:41:50 | Add a link_name accessor to Header | diff --git a/src/lib.rs b/src/lib.rs
index c7d2751..8e60e3f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -759,36 +759,7 @@ impl Header {
/// Note that this function will convert any `\` characters to directory
/// separators.
pub fn path(&self) -> io::Result<Cow<Path>> {
- return bytes2path(self.pa... | 1 | 99 | 47 |
82c3b23570644bd2987b6854d68dfdd830ba8637 | Alex Crichton | 2015-11-23T19:41:36 | Add Debug for EntryType | diff --git a/src/lib.rs b/src/lib.rs
index 9051507..c7d2751 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -154,7 +154,7 @@ pub struct Header {
///
/// Each `Header` has an `entry_type` method returning an instance of this type
/// which can be used to inspect what the header is describing.
-#[derive(Clone, Copy, Parti... | 1 | 1 | 1 |
e7d622b103e7814eebd06024f0f7e854fde8a564 | Alex Crichton | 2015-11-23T19:16:27 | Fix compile on Windows | diff --git a/src/lib.rs b/src/lib.rs
index c9bc072..a5fe734 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1054,15 +1054,15 @@ impl Header {
self.set_gid(0);
let ft = meta.file_type();
- self.link[0] = if ft.is_dir() {
- EntryType::Directory
+ self.set_entry_type(if ft.is_dir(... | 1 | 6 | 6 |
71b60399f0ce5d20765e81441b1f3d79255e1a48 | Alex Crichton | 2015-11-23T18:22:09 | Move append methods to concrete in-crate methods
Rely on vtable dispatch to get everything codegen'd into one unit. | diff --git a/src/lib.rs b/src/lib.rs
index 87b2d15..c9bc072 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -24,6 +24,7 @@ use std::fs;
use std::io::prelude::*;
use std::io::{self, Error, ErrorKind, SeekFrom};
use std::iter::repeat;
+use std::marker;
use std::mem;
use std::path::{Path, PathBuf, Component};
use std::s... | 1 | 244 | 131 |
81e1b3dd77f0abe04ea215474c1a35c389c77250 | Alex Crichton | 2015-11-23T17:55:48 | Expose EntryType
Touch up the API in a few places but otherwise expose it basically wholesale.
Closes #39 | diff --git a/src/lib.rs b/src/lib.rs
index 586dbe0..87b2d15 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -41,83 +41,6 @@ macro_rules! try_iter{ ($me:expr, $e:expr) => (
}
) }
-// https://golang.org/pkg/archive/tar/#pkg-constants
-/// Entry types recognised in the high level API
-#[derive(Clone, Copy, PartialEq)]... | 1 | 124 | 88 |
774e28340be36974a27791ff4d1d7355202a3b0a | Aidan Hobson Sayers | 2015-11-16T14:54:33 | Implement a conversion for type flags to an enum | diff --git a/src/lib.rs b/src/lib.rs
index 5b236b9..586dbe0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -41,6 +41,83 @@ macro_rules! try_iter{ ($me:expr, $e:expr) => (
}
) }
+// https://golang.org/pkg/archive/tar/#pkg-constants
+/// Entry types recognised in the high level API
+#[derive(Clone, Copy, PartialEq)]... | 1 | 96 | 14 |
b4abdefa65895b3d95ed548e4518b6ba54693ce6 | Aidan Hobson Sayers | 2015-10-28T13:49:55 | Convert tests to use new function names | diff --git a/src/lib.rs b/src/lib.rs
index 9737e27..5b236b9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1189,8 +1189,8 @@ mod tests {
#[test]
fn simple() {
let ar = Archive::new(Cursor::new(&include_bytes!("tests/simple.tar")[..]));
- for file in t!(ar.files()) {
- t!(file);
+ ... | 1 | 28 | 28 |
3237ef18d43493347255817c6e7c7b4556183df3 | Aidan Hobson Sayers | 2015-10-20T14:31:01 | Convert file api to entries api | diff --git a/src/lib.rs b/src/lib.rs
index 9cdd067..9737e27 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -43,50 +43,62 @@ macro_rules! try_iter{ ($me:expr, $e:expr) => (
/// A top-level representation of an archive file.
///
-/// This archive can have a file added to it and it can be iterated over.
+/// This archive... | 1 | 78 | 53 |
db63627f19b1280927f287bfa3e9b588eb92ffd1 | Alex Crichton | 2015-11-04T21:06:23 | Bump to 0.3.2 | diff --git a/Cargo.toml b/Cargo.toml
index 6290848..5ff46e3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.3.1"
+version = "0.3.2"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
1e43ec10f1ce5e5099c6d7d7b6c2c0722510cd9e | Alex Crichton | 2015-11-04T21:05:50 | Add more contextual information to tar errors
This commit adds more information to errors that happen when unpacking to
hopefully help diagnose problems a little more easily | diff --git a/src/lib.rs b/src/lib.rs
index fbb47bf..9cdd067 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -18,6 +18,7 @@ extern crate filetime;
use std::borrow::Cow;
use std::cell::{RefCell, Cell};
use std::cmp;
+use std::error;
use std::fmt;
use std::fs;
use std::io::prelude::*;
@@ -110,6 +111,13 @@ pub struct Hea... | 1 | 96 | 26 |
442e3cc5a6e3a79c11596aacbdd5d0eb4c76dd65 | Alex Crichton | 2015-11-04T00:36:51 | Fix windows build | diff --git a/Cargo.toml b/Cargo.toml
index c759842..6290848 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,6 +20,7 @@ contents are never required to be entirely resident in memory all at once.
[dependencies]
libc = "0.2"
filetime = "0.1.5"
+winapi = "0.2"
[dev-dependencies]
tempdir = "0.3"
diff --git a/src/lib.... | 2 | 3 | 1 |
41b8f29d6a5326a0658b7014e925d27615ecbf6a | Alex Crichton | 2015-11-03T21:41:08 | Bump dep on libc | diff --git a/Cargo.toml b/Cargo.toml
index 88ef166..c759842 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,7 @@ contents are never required to be entirely resident in memory all at once.
"""
[dependencies]
-libc = "0.1"
+libc = "0.2"
filetime = "0.1.5"
[dev-dependencies] | 1 | 1 | 1 |
96313d067204aeb1cc509173174aab869028e973 | Aidan Hobson Sayers | 2015-10-22T18:27:06 | Implement Clone, Eq and PartialEq for Header, expose as_bytes | diff --git a/src/lib.rs b/src/lib.rs
index c63921c..4a36a0d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -523,6 +523,12 @@ impl<'a, R: Read> Iterator for FilesMut<'a, R> {
}
}
+impl Clone for Header {
+ fn clone(&self) -> Header {
+ Header { ..*self }
+ }
+}
+
impl Header {
/// Creates a new b... | 1 | 23 | 1 |
e7a78c62f5061c0e2ec13e2cef7aa6fba2f80afc | aidanhs | 2015-10-19T11:17:54 | Doc typo fix | diff --git a/src/lib.rs b/src/lib.rs
index c63921c..02dad50 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -127,7 +127,7 @@ impl<O> Archive<O> {
impl<R: Seek + Read> Archive<R> {
/// Construct an iterator over the files of this archive.
///
- /// This function can return an error if any underlying I/O operat... | 1 | 1 | 1 |
e56db8ca2039c45c8d3492fe0e41b79e2345f14a | Alex Crichton | 2015-10-18T18:26:43 | Add a test for inserting with a nul byte in a path | diff --git a/src/lib.rs b/src/lib.rs
index dbfdab1..c63921c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1444,4 +1444,17 @@ mod tests {
t!(ar.unpack(td.path()));
assert!(fs::metadata(td.path().join("foo/bar")).is_ok());
}
+
+ #[cfg(unix)]
+ #[test]
+ fn nul_bytes_in_path() {
+ use... | 1 | 13 | 0 |
303e01bc9247256957c1e54bd4bb7cd8cd49084b | Alex Crichton | 2015-10-18T18:23:27 | Add tests for treatment of backslash | diff --git a/src/lib.rs b/src/lib.rs
index ff87ee0..dbfdab1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -157,6 +157,11 @@ impl<R: Read> Archive<R> {
/// sequence. If files are processed out of sequence (from what the iterator
/// returns), then the contents read for each file may be corrupted.
pub fn fil... | 1 | 50 | 6 |
46dc707e80f65033a67a4d1e4c7cfc1d8467b229 | Aidan Hobson Sayers | 2015-10-18T13:21:53 | Make skipping more defensive in general | diff --git a/src/lib.rs b/src/lib.rs
index c30533f..277bfdc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -241,6 +241,10 @@ impl<R: Read> Archive<R> {
while amt > 0 {
let n = cmp::min(amt, buf.len() as u64);
let n = try!(Read::read(&mut me, &mut buf[..n as usize]));
+ if n ==... | 1 | 11 | 1 |
4287ef6b91f40df90b3e649aa0f891dd14a25347 | Aidan Hobson Sayers | 2015-10-17T23:29:51 | Ensure individual blocks of 0s are not ignored | diff --git a/src/lib.rs b/src/lib.rs
index 6c53eb7..24b5760 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -252,14 +252,19 @@ impl<R: Read> Archive<R> {
-> io::Result<Option<File<R>>> {
// If we have 2 or more sections of 0s, then we're done!
let mut chunk = [0; 512];
- let mut c... | 1 | 33 | 5 |
0a08a3c0249b626f5805819189ca34673cb38978 | Aidan Hobson Sayers | 2015-10-17T22:40:47 | Ensure invalid file sizes error immediately | diff --git a/src/lib.rs b/src/lib.rs
index 6c53eb7..c30533f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -908,7 +908,10 @@ impl<'a, R: Read> File<'a, R> {
}
fn unpack2(&mut self, dst: &Path) -> io::Result<()> {
- try!(io::copy(self, &mut try!(fs::File::create(dst))));
+ let unpackfile = &mut tr... | 1 | 28 | 2 |
5abe330dbbe5e746fd251377f2fa9d27f972c761 | Aidan Hobson Sayers | 2015-10-15T19:50:16 | Implement append_dir, allow dirs in append_path | diff --git a/src/lib.rs b/src/lib.rs
index 74cf542..6c53eb7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -369,8 +369,16 @@ impl<W: Write> Archive<W> {
}
fn append_path2(&self, path: &Path) -> io::Result<()> {
- let mut file = try!(fs::File::open(path));
- self.append_file(path, &mut file)
+ ... | 1 | 95 | 21 |
f09f7a125b1f0e717ec6c04e5e0398ef8428ba3b | Alex Crichton | 2015-07-31T18:24:02 | Bump to 0.3.1 | diff --git a/Cargo.toml b/Cargo.toml
index 41adc4d..88ef166 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.3.0"
+version = "0.3.1"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
13abe896f711e37898dec3d8d6b777002ec600b6 | Alex Crichton | 2015-07-29T17:19:36 | Use support in filetime instead of utime | diff --git a/Cargo.toml b/Cargo.toml
index 0d4c62d..41adc4d 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]
libc = "0.1"
-utime = "0.1"
+filetime = "0.1.5"
[dev-dependencies]
tempdir = "0.3"
diff --git a/src/lib... | 2 | 16 | 9 |
cc5723da169983d3cf9544b8db8d70ead69f0128 | Hyeon Kim | 2015-07-28T09:41:51 | Restore the mtime or the unpacked files
Do the utime before the chmod because some versions of utime are broken
and trash the modes of the file. | diff --git a/Cargo.toml b/Cargo.toml
index 6d713e2..0d4c62d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,6 +19,7 @@ contents are never required to be entirely resident in memory all at once.
[dependencies]
libc = "0.1"
+utime = "0.1"
[dev-dependencies]
tempdir = "0.3"
diff --git a/src/lib.rs b/src/lib.rs
ind... | 2 | 5 | 0 |
0f786236901df1333460031cad777f5a835cd1f0 | Alex Crichton | 2015-07-16T04:30:33 | Bump to 0.3.0 | diff --git a/Cargo.toml b/Cargo.toml
index 13d8e28..6d713e2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.2.14"
+version = "0.3.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.c... | 1 | 1 | 1 |
01b7597cbff68ffc97a574576f2c08ff23e0a05e | Alex Crichton | 2015-07-16T04:28:33 | Go back to denying warnings in tests | diff --git a/src/lib.rs b/src/lib.rs
index 56ffadb..5d096ef 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -9,14 +9,13 @@
#![doc(html_root_url = "http://alexcrichton.com/tar-rs")]
#![deny(missing_docs)]
-// #![cfg_attr(test, deny(warnings))]
+#![cfg_attr(test, deny(warnings))]
extern crate libc;
use std::borrow:... | 1 | 2 | 2 |
fc216c645586d2036752d8ecb32e50c239e69312 | Alex Crichton | 2015-07-16T04:08:53 | Overhaul the public API of the crate
* Move all header accessor functions directly onto the `Header` type
* Add `set_foo` for all fields of a `Header`
* Add `File::unpack`
* Rename `File::raw_header` to `File::header`
* Make many functions generic over `P: AsRef<Path>`
* Add docs and examples here and there
* Change `... | diff --git a/src/lib.rs b/src/lib.rs
index be54e5a..34ff1cd 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -9,22 +9,26 @@
#![doc(html_root_url = "http://alexcrichton.com/tar-rs")]
#![deny(missing_docs)]
-#![cfg_attr(test, deny(warnings))]
+// #![cfg_attr(test, deny(warnings))]
extern crate libc;
+use std::borrow:... | 1 | 571 | 285 |
f96853a19df9904d48a348c82e5edbecf613494c | Alex Crichton | 2015-06-13T17:16:39 | Bump to 0.2.14 | diff --git a/Cargo.toml b/Cargo.toml
index 8cb931d..d10d1ea 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.2.13"
+version = "0.2.14"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.... | 1 | 1 | 1 |
4d6f9266c76826d41b11daa5a3f4d88748964a29 | Alex Crichton | 2015-06-13T17:16:27 | Fix compile on nightly | diff --git a/src/lib.rs b/src/lib.rs
index d80a571..d0148f7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -9,9 +9,6 @@
#![doc(html_root_url = "http://alexcrichton.com/tar-rs")]
#![deny(missing_docs)]
-#![cfg_attr(feature = "nightly", feature(fs, metadata_ext))]
-#![cfg_attr(all(unix, feature = "nightly"), feature(fs_... | 1 | 0 | 4 |
8804388a2e1260299204c3589ce05a2ea8a136b6 | Alex Crichton | 2015-05-26T17:16:12 | Bump to 0.2.13 | diff --git a/Cargo.toml b/Cargo.toml
index 57349f2..8cb931d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.2.12"
+version = "0.2.13"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.... | 1 | 1 | 1 |
a5e2151703e4f9233b1436f1701c8827ee0f2152 | Alex Crichton | 2015-05-26T15:58:42 | Really fix the build on Windows | diff --git a/src/lib.rs b/src/lib.rs
index 8105942..d80a571 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -247,7 +247,7 @@ impl<R: Read> Archive<R> {
fs::set_permissions(dst, perm)
}
#[cfg(all(windows, not(feature = "nightly")))]
- fn set_perms(dst: &PathBuf, mode: i32) -> io::Result... | 1 | 11 | 11 |
14f0d34436fb11e4ffdb3734ff124af126aff971 | Alex Crichton | 2015-05-26T15:43:51 | Clean up some style here and there | diff --git a/src/lib.rs b/src/lib.rs
index 9e35d26..8105942 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -165,8 +165,7 @@ impl<R: Read> Archive<R> {
if b == b'\\' {b'/'} else {b}
}).collect::<Vec<_>>();
if bytes.len() == 0 {
- return Err(io::Error::new(io::ErrorK... | 1 | 43 | 37 |
e288ee34ed1dd6b1065c404edca7edb50b05deae | Alex Crichton | 2015-05-26T15:29:12 | Fix build on windows and clean up some feature usage | diff --git a/src/lib.rs b/src/lib.rs
index ee6d59d..9e35d26 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -9,9 +9,8 @@
#![doc(html_root_url = "http://alexcrichton.com/tar-rs")]
#![deny(missing_docs)]
-#![cfg_attr(feature = "nightly", feature(metadata_ext))]
-#![cfg_attr(feature = "nightly", feature(fs))]
-#![cfg_attr... | 1 | 19 | 17 |
288a9754a8205b1f032e1c92015e4dbe49998855 | Alex Crichton | 2015-05-18T15:58:21 | Bump to 0.2.12 | diff --git a/Cargo.toml b/Cargo.toml
index f508e7c..57349f2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.2.11"
+version = "0.2.12"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.... | 1 | 1 | 1 |
5830d58f105ad05f1ad53569e6072b0354400538 | Alex Crichton | 2015-05-03T17:51:22 | Bump to 0.2.11 | diff --git a/Cargo.toml b/Cargo.toml
index 8a5cd27..ad0635a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.2.10"
+version = "0.2.11"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.... | 1 | 1 | 1 |
613e11de08344db8c4d514d4703046e1561661ed | user | 2015-05-03T05:04:08 | unstable mode_t went to u32
Since this crate attempts to emulate UNIX style permissions on #[cfg(windows)] but the unstable std::os::linux::raw::mode_t type is only going to be available on #[cfg(linux)], it broke
when mode_t was changed from i32 to u32.
Easy enough to fix... u32 and i32 are treated the same when yo... | diff --git a/src/lib.rs b/src/lib.rs
index 97e7e87..fca18d4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -182,12 +182,12 @@ impl<R: Read> Archive<R> {
return Ok(());
#[cfg(unix)]
- fn set_perms(perm: &mut fs::Permissions, mode: i32) {
+ fn set_perms(perm: &mut fs::Permissions, mode: u32... | 1 | 6 | 6 |
eaa238200f41375adc2413897a033a41f8081591 | Alex Crichton | 2015-04-27T23:56:54 | Really fix unused attribute on windows | diff --git a/src/lib.rs b/src/lib.rs
index cb8c215..97e7e87 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -10,7 +10,7 @@
#![doc(html_root_url = "http://alexcrichton.com/tar-rs")]
#![feature(fs, fs_time)]
#![deny(missing_docs)]
-#![cfg_attr(unix, fs_ext)]
+#![cfg_attr(unix, feature(fs_ext))]
#![cfg_attr(test, deny(war... | 1 | 1 | 1 |
76d5fc025817c44e467d2dc5109c34520331c394 | Alex Crichton | 2015-04-27T23:22:11 | Fix warnings on windows | diff --git a/src/lib.rs b/src/lib.rs
index 40c1884..cb8c215 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -8,8 +8,9 @@
//! [1]: http://en.wikipedia.org/wiki/Tar_%28computing%29
#![doc(html_root_url = "http://alexcrichton.com/tar-rs")]
-#![feature(fs, fs_time, fs_ext)]
+#![feature(fs, fs_time)]
#![deny(missing_docs)]... | 1 | 2 | 1 |
1713f63a062df263078992d53fbe4a59faf49b38 | Alex Crichton | 2015-04-27T22:54:45 | Bump to 0.2.10 | diff --git a/Cargo.toml b/Cargo.toml
index 33686f2..a97957e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.2.9"
+version = "0.2.10"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.c... | 1 | 1 | 1 |
6f6616d76302685d3f1d3c27853892eae367df47 | Alex Crichton | 2015-04-27T22:43:12 | Windows dates are relative to 1601
Tarballs, however, have dates relative to 1970, so we need to add some time to
the returned time to ensure they're relative to the same point
Closes #19 | diff --git a/src/lib.rs b/src/lib.rs
index 50899c5..40c1884 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -305,7 +305,7 @@ impl<W: Write> Archive<W> {
// Prepare the metadata fields.
octal(&mut header.mode, perm_bits(&stat)); // TODO: is this right?
- octal(&mut header.mtime, stat.modified() / ... | 1 | 12 | 1 |
51719255eed6b5daf5a18001ec3d0a779810a4c9 | Alex Crichton | 2015-04-27T22:37:24 | Leverage fix-sized byte string literals | diff --git a/src/lib.rs b/src/lib.rs
index 79279e2..50899c5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -279,8 +279,8 @@ impl<W: Write> Archive<W> {
// Prepare the header, flagging it as a UStar archive
let mut header: Header = unsafe { mem::zeroed() };
- header.ustar = [b'u', b's', b't', b'a... | 1 | 2 | 2 |
ffccfa53ca2aaa40900e24a902bdb55c23c86e4f | Alex Crichton | 2015-04-02T17:02:07 | Bump to 0.2.9 | diff --git a/Cargo.toml b/Cargo.toml
index 1686611..33686f2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.2.8"
+version = "0.2.9"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 2 | 10 | 13 |
78bfdf59a56d52c9cf46b9bd2142c5463523e3c9 | Alex Crichton | 2015-04-01T16:59:10 | Bump to 0.2.8 | diff --git a/Cargo.toml b/Cargo.toml
index 7bea4fc..1686611 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.2.7"
+version = "0.2.8"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 2 | 17 | 12 |
cc97fb23ac584fff096edff932a7111c39fe7bf4 | Alex Crichton | 2015-03-31T00:53:10 | Bump to 0.2.7 | diff --git a/Cargo.toml b/Cargo.toml
index 5740ac0..7bea4fc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.2.6"
+version = "0.2.7"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
b541bacf83cbf4a204f7a1bc713109ec076f6261 | Alex Crichton | 2015-03-31T00:50:38 | Handle partial reads in Archive::skip | diff --git a/src/lib.rs b/src/lib.rs
index dfac3d8..18a291d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -210,8 +210,8 @@ impl<R: Read> Archive<R> {
let mut me = self;
while amt > 0 {
let n = cmp::min(amt, buf.len() as u64);
- try!(Read::read(&mut me, &mut buf[..n as usize]));
-... | 1 | 2 | 2 |
58b86794d78f81d6a9d40ad516a8faf6c7738e2d | Alex Crichton | 2015-03-31T00:50:14 | No need to use UFCS any more | diff --git a/src/lib.rs b/src/lib.rs
index d28c245..dfac3d8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -163,7 +163,7 @@ impl<R: Read> Archive<R> {
}).collect::<Vec<_>>();
let is_directory = bytes[bytes.len() - 1] == b'/';
let mut dst = into.to_path_buf();
- for part in... | 1 | 1 | 1 |
9bba8f5294af848fc7bee1250da43ea8621487b4 | Alex Crichton | 2015-03-22T17:39:14 | Bump to 0.2.6 | diff --git a/Cargo.toml b/Cargo.toml
index 53f0b8b..5740ac0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.2.5"
+version = "0.2.6"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 2 | 2 | 2 |
0146225575e86a05cf97520c05747604fc88e0be | Alex Crichton | 2015-03-21T17:38:26 | Fix tests for rust master | diff --git a/src/lib.rs b/src/lib.rs
index e7eb105..e686e47 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -635,7 +635,7 @@ mod tests {
#[test]
fn simple() {
- let ar = Archive::new(Cursor::new(include_bytes!("tests/simple.tar")));
+ let ar = Archive::new(Cursor::new(&include_bytes!("tests/simple... | 1 | 5 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.