minitar 1.0.2 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +326 -0
- data/CODE_OF_CONDUCT.md +167 -0
- data/CONTRIBUTING.md +312 -0
- data/CONTRIBUTORS.md +27 -0
- data/LICENCE.md +42 -0
- data/Manifest.txt +31 -8
- data/README.md +82 -0
- data/Rakefile +74 -20
- data/SECURITY.md +54 -0
- data/lib/minitar/input.rb +242 -189
- data/lib/minitar/output.rb +72 -64
- data/lib/minitar/pax_header.rb +111 -0
- data/lib/minitar/posix_header.rb +276 -239
- data/lib/minitar/reader.rb +226 -231
- data/lib/minitar/version.rb +5 -0
- data/lib/minitar/writer.rb +246 -299
- data/lib/minitar.rb +134 -115
- data/licenses/bsdl.txt +20 -0
- data/licenses/dco.txt +34 -0
- data/licenses/ruby.txt +52 -0
- data/test/fixtures/issue_46.tar.gz +0 -0
- data/test/fixtures/issue_62.tar.gz +0 -0
- data/test/fixtures/tar_input.tgz +0 -0
- data/test/fixtures/test_input_non_strict_octal.tgz +0 -0
- data/test/fixtures/test_input_relative.tgz +0 -0
- data/test/fixtures/test_input_space_octal.tgz +0 -0
- data/test/fixtures/test_minitar.tar.gz +0 -0
- data/test/minitest_helper.rb +12 -1
- data/test/support/minitar_test_helpers/fixtures.rb +38 -0
- data/test/support/minitar_test_helpers/header.rb +130 -0
- data/test/support/minitar_test_helpers/tarball.rb +324 -0
- data/test/support/minitar_test_helpers.rb +36 -0
- data/test/test_filename_boundary_conditions.rb +74 -0
- data/test/test_gnu_tar_compatibility.rb +92 -0
- data/test/test_integration_pack_unpack_cycle.rb +38 -0
- data/test/test_issue_46.rb +5 -23
- data/test/test_issue_62.rb +50 -0
- data/test/test_minitar.rb +168 -39
- data/test/test_path_normalization.rb +170 -0
- data/test/test_pax_header.rb +104 -0
- data/test/test_pax_support.rb +66 -0
- data/test/test_tar_header.rb +289 -75
- data/test/test_tar_input.rb +14 -61
- data/test/test_tar_output.rb +7 -9
- data/test/test_tar_reader.rb +17 -18
- data/test/test_tar_writer.rb +105 -126
- data/test/test_windows_extraction.rb +121 -0
- metadata +108 -95
- data/Code-of-Conduct.md +0 -128
- data/Contributing.md +0 -94
- data/History.md +0 -236
- data/Licence.md +0 -15
- data/README.rdoc +0 -92
- data/docs/bsdl.txt +0 -19
- data/docs/ruby.txt +0 -56
- data/test/support/tar_test_helpers.rb +0 -134
data/History.md
DELETED
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
# History
|
|
2
|
-
|
|
3
|
-
## 1.0.2 / 2024-08-23
|
|
4
|
-
|
|
5
|
-
- Bugfix:
|
|
6
|
-
|
|
7
|
-
- Minitar 1.0.1 was released with an unchanged gemspec. Reported by Debashish
|
|
8
|
-
Biswas in [#65][#65].
|
|
9
|
-
|
|
10
|
-
## 1.0.1 / 2024-08-08
|
|
11
|
-
|
|
12
|
-
- Bugfix:
|
|
13
|
-
|
|
14
|
-
- Resolve a constant lookup issue. The accepted fix has been provided by Aram
|
|
15
|
-
Price in [#58][#58].
|
|
16
|
-
|
|
17
|
-
## 1.0.0 / 2024-08-07
|
|
18
|
-
|
|
19
|
-
- Breaking Changes:
|
|
20
|
-
|
|
21
|
-
- Minimum Ruby version is 3.1.
|
|
22
|
-
|
|
23
|
-
- The `Archive::Tar::Minitar` namespace has been completely removed and
|
|
24
|
-
`Minitar` is a class instead of a module.
|
|
25
|
-
|
|
26
|
-
- Enhancements:
|
|
27
|
-
|
|
28
|
-
- Added `Minitar.pack_as_file`, originally proposed by John Prince back in
|
|
29
|
-
2011 [#7][#7].
|
|
30
|
-
|
|
31
|
-
## 0.12.1 / 2024-08-21
|
|
32
|
-
|
|
33
|
-
- Reverted @adbbb9b596 to restore compatibility with Ruby < 2.0. Resolves
|
|
34
|
-
[#63][#63] reported by Robert Schulze.
|
|
35
|
-
|
|
36
|
-
## 0.12 / 2024-08-06
|
|
37
|
-
|
|
38
|
-
- Properly handle very long GNU filenames, resolving [#46][#46].
|
|
39
|
-
- Handle very long GNU filenames that are 512 or more bytes, resolving
|
|
40
|
-
[#45][#45]. Originally implemented in [#47][#47] by Vijay, but accidentally
|
|
41
|
-
closed.
|
|
42
|
-
|
|
43
|
-
## 0.11 / 2022-12-31
|
|
44
|
-
|
|
45
|
-
- symlink support is complete. Merged as PR [#42][#42], rebased and built on top
|
|
46
|
-
of PR [#12][#12] by fetep.
|
|
47
|
-
|
|
48
|
-
- kymmt90 fixed a documentation error on `Minitar.pack` in PR [#43][#43].
|
|
49
|
-
|
|
50
|
-
- This version is a soft-deprecation of all versions before Ruby 2.7, as they
|
|
51
|
-
will no longer be tested in CI.
|
|
52
|
-
|
|
53
|
-
## 0.10 / 2022-03-26
|
|
54
|
-
|
|
55
|
-
- nevesenin fixed an issue with long filename handling. Merged as PR [#40][#40].
|
|
56
|
-
|
|
57
|
-
## 0.9 / 2019-09-04
|
|
58
|
-
|
|
59
|
-
- jtappa added the ability to skip fsync with a new option to `Minitar.unpack`
|
|
60
|
-
and `Minitar::Input#extract_entry`. Provide `:fsync => false` as the last
|
|
61
|
-
parameter to enable. Merged from a modified version of PR [#37][#37].
|
|
62
|
-
|
|
63
|
-
## 0.8 / 2019-01-05
|
|
64
|
-
|
|
65
|
-
- inkstak resolved an issue introduced in the fix for [#31][#31] by allowing
|
|
66
|
-
spaces to be considered valid characters in strict octal handling. Octal
|
|
67
|
-
conversion ignores leading spaces. Merged from a slightly modified version of
|
|
68
|
-
PR [#35][#35].
|
|
69
|
-
|
|
70
|
-
- dearblue contributed PR [#32][#32] providing an explicit call to #bytesize for
|
|
71
|
-
strings that include multibyte characters. The PR has been modified to be
|
|
72
|
-
compatible with older versions of Ruby and extend tests.
|
|
73
|
-
|
|
74
|
-
- Akinori MUSHA (knu) contributed PR [#36][#36] that treats certain badly
|
|
75
|
-
encoded regular files (with names ending in `/`) as if they were directories
|
|
76
|
-
on decode.
|
|
77
|
-
|
|
78
|
-
## 0.7 / 2018-02-19
|
|
79
|
-
|
|
80
|
-
- Fixed issue [#28][#28] with a modified version of PR [#29][#29] covering the
|
|
81
|
-
security policy and position for `Minitar`. Thanks so much to ooooooo_q for
|
|
82
|
-
the report and an initial patch. Additional information was added as
|
|
83
|
-
[#30][#30].
|
|
84
|
-
|
|
85
|
-
- dearblue contributed PR [#33][#33] providing a fix for `Minitar::Reader` when
|
|
86
|
-
the IO-like object does not have a `#pos` method.
|
|
87
|
-
|
|
88
|
-
- Kevin McDermott contributed PR [#34][#34] so that an InvalidTarStream is
|
|
89
|
-
raised if the tar header is not valid, preventing incorrect streaming of files
|
|
90
|
-
from a non-tarfile. This is a minor breaking change, so the version has been
|
|
91
|
-
bumped accordingly.
|
|
92
|
-
|
|
93
|
-
- Kazuyoshi Kato contributed PR [#26][#26] providing support for the GNU tar
|
|
94
|
-
long filename extension.
|
|
95
|
-
|
|
96
|
-
- Addressed a potential DOS with negative size fields in tar headers
|
|
97
|
-
([#31][#31]). This has been handled in two ways: the size field in a tar
|
|
98
|
-
header is interpreted as a strict octal value and the `Minitar` reader will
|
|
99
|
-
raise an InvalidTarStream if the size ends up being negative anyway.
|
|
100
|
-
|
|
101
|
-
## 0.6.1 / 2017-02-07
|
|
102
|
-
|
|
103
|
-
- Fixed issue [#24][#24] where streams were being improperly closed immediately
|
|
104
|
-
on open unless there was a block provided.
|
|
105
|
-
|
|
106
|
-
- Hopefully fixes issue [#23][#23] by releasing archive-tar-minitar after
|
|
107
|
-
minitar-cli is available.
|
|
108
|
-
|
|
109
|
-
## 0.6 / 2017-02-07
|
|
110
|
-
|
|
111
|
-
- Breaking Changes:
|
|
112
|
-
|
|
113
|
-
- Extracted `bin/minitar` into a new gem, `minitar-cli`. No, I am _not_ going
|
|
114
|
-
to bump the major version for this. As far as I can tell, few people use the
|
|
115
|
-
command-line utility anyway. (Installing `archive-tar-minitar` will install
|
|
116
|
-
both `minitar` and `minitar-cli`, at least until version 1.0.)
|
|
117
|
-
|
|
118
|
-
- `Minitar` extraction before 0.6 traverses directories if the tarball
|
|
119
|
-
includes a relative directory reference, as reported in [#16][#16] by
|
|
120
|
-
@ecneladis. This has been disallowed entirely and will throw a
|
|
121
|
-
`SecureRelativePathError` when found. Additionally, if the final destination
|
|
122
|
-
of an entry is an already-existing symbolic link, the existing symbolic link
|
|
123
|
-
will be removed and the file will be written correctly (on platforms that
|
|
124
|
-
support symbolic links).
|
|
125
|
-
|
|
126
|
-
- Enhancements:
|
|
127
|
-
|
|
128
|
-
- Licence change. After speaking with Mauricio Fernández, we have changed the
|
|
129
|
-
licensing of this library to Ruby and Simplified BSD and have dropped the
|
|
130
|
-
GNU GPL license. This takes effect from the 0.6 release.
|
|
131
|
-
- Printing a deprecation warning for including Archive::Tar to put `Minitar`
|
|
132
|
-
in the top-level namespace.
|
|
133
|
-
- Printing a deprecation warning for including `Archive::Tar::Minitar` into a
|
|
134
|
-
class (`Minitar` will be a class for version 1.0).
|
|
135
|
-
- Moved `Archive::Tar::PosixHeader` to `Archive::Tar::Minitar::PosixHeader`
|
|
136
|
-
with a deprecation warning. Do not depend on
|
|
137
|
-
`Archive::Tar::Minitar::PosixHeader`, as it will be moving to
|
|
138
|
-
`::Minitar::PosixHeader` in a future release.
|
|
139
|
-
- Added an alias, `::Minitar`, for `Archive::Tar::Minitar`, opted in with
|
|
140
|
-
`require 'minitar'`. In future releases, this alias will be enabled by
|
|
141
|
-
default, and the `Archive::Tar` namespace will be removed entirely for
|
|
142
|
-
version 1.0.
|
|
143
|
-
- Modified the handling of `mtime` in `PosixHeader` to do an integer
|
|
144
|
-
conversion (`#to_i`) so that a Time object can be used instead of the
|
|
145
|
-
integer value of the time object.
|
|
146
|
-
- `Writer::RestrictedStream` was renamed to `Writer::WriteOnlyStream` for
|
|
147
|
-
clarity. No alias or deprecation warning was provided for this as it is an
|
|
148
|
-
internal implementation detail.
|
|
149
|
-
- `Writer::BoundedStream` was renamed to `Writer::BoundedWriteStream` for
|
|
150
|
-
clarity. A deprecation warning is provided on first use because a
|
|
151
|
-
BoundedWriteStream may raise a `BoundedWriteStream::FileOverflow` exception.
|
|
152
|
-
- `Writer::BoundedWriteStream::FileOverflow` has been renamed to
|
|
153
|
-
`Writer::WriteBoundaryOverflow` and inherits from `StandardError` instead of
|
|
154
|
-
`RuntimeError`. Note that for Ruby 2.0 or higher, an error will be raised
|
|
155
|
-
when specifying `Writer::BoundedWriteStream::FileOverflow` because
|
|
156
|
-
`Writer::BoundedWriteStream` has been declared a private constant.
|
|
157
|
-
- Modified `Writer#add_file_simple` to accept the data for a file in
|
|
158
|
-
`opts[:data]`. When `opts[:data]` is provided, a stream block must not be
|
|
159
|
-
provided. Improved the documentation for this method.
|
|
160
|
-
- Modified `Writer#add_file` to accept `opts[:data]` and transparently call
|
|
161
|
-
`Writer#add_file_simple` in this case.
|
|
162
|
-
- Methods that require blocks are no longer required, so the
|
|
163
|
-
`Archive::Tar::Minitar::BlockRequired` exception has been removed with a
|
|
164
|
-
warning (this may not work on Ruby 1.8).
|
|
165
|
-
- Dramatically reduced the number of strings created when creating a POSIX
|
|
166
|
-
tarball header.
|
|
167
|
-
- Added a helper, `Input.each_entry` that iterates over each entry in an
|
|
168
|
-
opened entry object.
|
|
169
|
-
|
|
170
|
-
- Bugs:
|
|
171
|
-
|
|
172
|
-
- Fix [#2][#2] to handle IO streams that are not seekable, such as pipes,
|
|
173
|
-
`STDIN`, or `STDOUT`.
|
|
174
|
-
- Fix [#3][#3] to make the test timezone resilient.
|
|
175
|
-
- Fix [#4][#4] for supporting the reading of tar files with filenames in the
|
|
176
|
-
GNU long filename extension format. Ported from @atoulme’s fork, originally
|
|
177
|
-
provided by Curtis Sampson.
|
|
178
|
-
- Fix [#6][#6] by making it raise the correct error for a long filename with
|
|
179
|
-
no path components.
|
|
180
|
-
- Fix [#13][#13] provided by @fetep fixes an off-by-one error on filename
|
|
181
|
-
splitting.
|
|
182
|
-
- Fix [#14][#14] provided by @kzys should fix Windows detection issues.
|
|
183
|
-
- Fix [#16][#16] as specified above.
|
|
184
|
-
- Fix an issue where `Minitar.pack` would not include Unix hidden files when
|
|
185
|
-
creating a tarball.
|
|
186
|
-
|
|
187
|
-
- Development:
|
|
188
|
-
|
|
189
|
-
- Modernized minitar tooling around Hoe.
|
|
190
|
-
- Added travis and coveralls.
|
|
191
|
-
|
|
192
|
-
## 0.5.2 / 2008-02-26
|
|
193
|
-
|
|
194
|
-
- Bugs:
|
|
195
|
-
- Fixed a Ruby 1.9 compatibility error.
|
|
196
|
-
|
|
197
|
-
## 0.5.1 / 2004-09-27
|
|
198
|
-
|
|
199
|
-
- Bugs:
|
|
200
|
-
- Fixed a variable name error.
|
|
201
|
-
|
|
202
|
-
## 0.5.0
|
|
203
|
-
|
|
204
|
-
- Initial release. Does files and directories. Command does create, extract, and
|
|
205
|
-
list.
|
|
206
|
-
|
|
207
|
-
[#2]: https://github.com/halostatue/minitar/issues/2
|
|
208
|
-
[#3]: https://github.com/halostatue/minitar/issues/3
|
|
209
|
-
[#4]: https://github.com/halostatue/minitar/issues/4
|
|
210
|
-
[#6]: https://github.com/halostatue/minitar/issues/6
|
|
211
|
-
[#7]: https://github.com/halostatue/minitar/issues/7
|
|
212
|
-
[#12]: https://github.com/halostatue/minitar/pull/12
|
|
213
|
-
[#13]: https://github.com/halostatue/minitar/issues/13
|
|
214
|
-
[#14]: https://github.com/halostatue/minitar/issues/14
|
|
215
|
-
[#16]: https://github.com/halostatue/minitar/issues/16
|
|
216
|
-
[#23]: https://github.com/halostatue/minitar/issues/23
|
|
217
|
-
[#24]: https://github.com/halostatue/minitar/issues/24
|
|
218
|
-
[#26]: https://github.com/halostatue/minitar/issues/27
|
|
219
|
-
[#28]: https://github.com/halostatue/minitar/issues/28
|
|
220
|
-
[#29]: https://github.com/halostatue/minitar/pull/29
|
|
221
|
-
[#30]: https://github.com/halostatue/minitar/issues/30
|
|
222
|
-
[#31]: https://github.com/halostatue/minitar/issues/31
|
|
223
|
-
[#32]: https://github.com/halostatue/minitar/pull/32
|
|
224
|
-
[#33]: https://github.com/halostatue/minitar/pull/33
|
|
225
|
-
[#34]: https://github.com/halostatue/minitar/pull/34
|
|
226
|
-
[#35]: https://github.com/halostatue/minitar/pull/35
|
|
227
|
-
[#36]: https://github.com/halostatue/minitar/pull/36
|
|
228
|
-
[#37]: https://github.com/halostatue/minitar/pull/37
|
|
229
|
-
[#40]: https://github.com/halostatue/minitar/pull/40
|
|
230
|
-
[#42]: https://github.com/halostatue/minitar/pull/42
|
|
231
|
-
[#43]: https://github.com/halostatue/minitar/pull/43
|
|
232
|
-
[#45]: https://github.com/halostatue/minitar/issues/45
|
|
233
|
-
[#46]: https://github.com/halostatue/minitar/issues/46
|
|
234
|
-
[#47]: https://github.com/halostatue/minitar/pull/47
|
|
235
|
-
[#58]: https://github.com/halostatue/minitar/issues/58
|
|
236
|
-
[#65]: https://github.com/halostatue/minitar/issues/65
|
data/Licence.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
## Licence
|
|
2
|
-
|
|
3
|
-
minitar is free software that may be redistributed and/or modified under the
|
|
4
|
-
terms of Ruby’s licence or the Simplified BSD licence.
|
|
5
|
-
|
|
6
|
-
- Copyright 2004–2024 Austin Ziegler.
|
|
7
|
-
- Portions copyright 2004 Mauricio Julio Fernández Pradier.
|
|
8
|
-
|
|
9
|
-
### Simplified BSD Licence
|
|
10
|
-
|
|
11
|
-
See the file docs/bsdl.txt in the main distribution.
|
|
12
|
-
|
|
13
|
-
### Ruby’s Licence
|
|
14
|
-
|
|
15
|
-
See the file docs/ruby.txt in the main distribution.
|
data/README.rdoc
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
= minitar
|
|
2
|
-
|
|
3
|
-
home :: https://github.com/halostatue/minitar/
|
|
4
|
-
code :: https://github.com/halostatue/minitar/
|
|
5
|
-
bugs :: https://github.com/halostatue/minitar/issues
|
|
6
|
-
rdoc :: https://rdoc.info/gems/minitar/
|
|
7
|
-
cli :: https://github.com/halostatue/minitar-cli
|
|
8
|
-
|
|
9
|
-
== Description
|
|
10
|
-
|
|
11
|
-
The minitar library is a pure-Ruby library that provides the ability to deal
|
|
12
|
-
with POSIX tar(1) archive files.
|
|
13
|
-
|
|
14
|
-
This is release 0.12. This is likely the last revision before 1.0.
|
|
15
|
-
|
|
16
|
-
minitar (previously called Archive::Tar::Minitar) is based heavily on code
|
|
17
|
-
originally written by Mauricio Julio Fernández Pradier for the rpa-base
|
|
18
|
-
project.
|
|
19
|
-
|
|
20
|
-
== Synopsis
|
|
21
|
-
|
|
22
|
-
Using minitar is easy. The simplest case is:
|
|
23
|
-
|
|
24
|
-
require 'minitar'
|
|
25
|
-
|
|
26
|
-
# Packs everything that matches Find.find('tests').
|
|
27
|
-
# test.tar will automatically be closed by Minitar.pack.
|
|
28
|
-
Minitar.pack('tests', File.open('test.tar', 'wb'))
|
|
29
|
-
|
|
30
|
-
# Unpacks 'test.tar' to 'x', creating 'x' if necessary.
|
|
31
|
-
Minitar.unpack('test.tar', 'x')
|
|
32
|
-
|
|
33
|
-
A gzipped tar can be written with:
|
|
34
|
-
|
|
35
|
-
require 'zlib'
|
|
36
|
-
# test.tgz will be closed automatically.
|
|
37
|
-
Minitar.pack('tests', Zlib::GzipWriter.new(File.open('test.tgz', 'wb'))
|
|
38
|
-
|
|
39
|
-
# test.tgz will be closed automatically.
|
|
40
|
-
Minitar.unpack(Zlib::GzipReader.new(File.open('test.tgz', 'rb')), 'x')
|
|
41
|
-
|
|
42
|
-
As the case above shows, one need not write to a file. However, it will
|
|
43
|
-
sometimes require that one dive a little deeper into the API, as in the case of
|
|
44
|
-
StringIO objects. Note that I'm not providing a block with Minitar::Output, as
|
|
45
|
-
Minitar::Output#close automatically closes both the Output object and the
|
|
46
|
-
wrapped data stream object.
|
|
47
|
-
|
|
48
|
-
begin
|
|
49
|
-
sgz = Zlib::GzipWriter.new(StringIO.new(String.new))
|
|
50
|
-
tar = Output.new(sgz)
|
|
51
|
-
Find.find('tests') do |entry|
|
|
52
|
-
Minitar.pack_file(entry, tar)
|
|
53
|
-
end
|
|
54
|
-
ensure
|
|
55
|
-
# Closes both tar and sgz.
|
|
56
|
-
tar.close
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
== Minitar and Security
|
|
60
|
-
|
|
61
|
-
Minitar aims to be secure by default for the data *inside* of a tarfile. If
|
|
62
|
-
there are any security issues discovered, please feel free to open an issue.
|
|
63
|
-
Should you wish to make a more confidential report, you can find my PGP key
|
|
64
|
-
information at {Keybase}[https://keybase.io/halostatue]. Bear with me: I do not
|
|
65
|
-
use PGP regularly, so it may take some time to remember the command invocations
|
|
66
|
-
required to successfully handle this.
|
|
67
|
-
|
|
68
|
-
Minitar does *not* perform validation of path names provided to the convenience
|
|
69
|
-
calsses Minitar::Output and Minitar::Input, which use Kernel.open for their
|
|
70
|
-
underlying implementations when not given an IO-like object.
|
|
71
|
-
|
|
72
|
-
Improper use of these classes with arbitrary input filenames may leave your
|
|
73
|
-
your software to the same class of vulnerability as reported for Net::FTP
|
|
74
|
-
({CVE-2017-17405}[https://nvd.nist.gov/vuln/detail/CVE-2017-17405]). Of
|
|
75
|
-
particular note, "if the localfile argument starts with the '|' pipe character,
|
|
76
|
-
the command following the pipe character is executed."
|
|
77
|
-
|
|
78
|
-
Additionally, the use of the `open-uri` library (which extends Kernel.open with
|
|
79
|
-
transparent implementations of Net::HTTP, Net::HTTPS, and Net::FTP), there are
|
|
80
|
-
other possible vulnerabilities when accepting arbitrary input, as
|
|
81
|
-
{detailed}[https://sakurity.com/blog/2015/02/28/openuri.html] by Egor Homakov.
|
|
82
|
-
|
|
83
|
-
These security vulnerabilities may be avoided, even with the Minitar::Output
|
|
84
|
-
and Minitar::Input convenience classes, by providing IO-like objects instead of
|
|
85
|
-
pathname-like objects as the source or destination of these classes.
|
|
86
|
-
|
|
87
|
-
== minitar Semantic Versioning
|
|
88
|
-
|
|
89
|
-
The minitar library uses a {Semantic Versioning}[http://semver.org/] scheme
|
|
90
|
-
with one change:
|
|
91
|
-
|
|
92
|
-
* When PATCH is zero (+0+), it will be omitted from version references.
|
data/docs/bsdl.txt
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Redistribution and use in source and binary forms, with or without
|
|
2
|
-
modification, are permitted provided that the following conditions are met:
|
|
3
|
-
|
|
4
|
-
1. Redistributions of source code must retain the above copyright notice, this
|
|
5
|
-
list of conditions and the following disclaimer.
|
|
6
|
-
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
7
|
-
this list of conditions and the following disclaimer in the documentation
|
|
8
|
-
and/or other materials provided with the distribution.
|
|
9
|
-
|
|
10
|
-
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
|
|
11
|
-
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
12
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
13
|
-
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
|
|
14
|
-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
15
|
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
16
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
17
|
-
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
18
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
19
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/docs/ruby.txt
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
|
2
|
-
You can redistribute it and/or modify it under either the terms of the
|
|
3
|
-
2-clause BSDL (see the file BSDL), or the conditions below:
|
|
4
|
-
|
|
5
|
-
1. You may make and give away verbatim copies of the source form of the
|
|
6
|
-
software without restriction, provided that you duplicate all of the
|
|
7
|
-
original copyright notices and associated disclaimers.
|
|
8
|
-
|
|
9
|
-
2. You may modify your copy of the software in any way, provided that
|
|
10
|
-
you do at least ONE of the following:
|
|
11
|
-
|
|
12
|
-
a) place your modifications in the Public Domain or otherwise
|
|
13
|
-
make them Freely Available, such as by posting said
|
|
14
|
-
modifications to Usenet or an equivalent medium, or by allowing
|
|
15
|
-
the author to include your modifications in the software.
|
|
16
|
-
|
|
17
|
-
b) use the modified software only within your corporation or
|
|
18
|
-
organization.
|
|
19
|
-
|
|
20
|
-
c) give non-standard binaries non-standard names, with
|
|
21
|
-
instructions on where to get the original software distribution.
|
|
22
|
-
|
|
23
|
-
d) make other distribution arrangements with the author.
|
|
24
|
-
|
|
25
|
-
3. You may distribute the software in object code or binary form,
|
|
26
|
-
provided that you do at least ONE of the following:
|
|
27
|
-
|
|
28
|
-
a) distribute the binaries and library files of the software,
|
|
29
|
-
together with instructions (in the manual page or equivalent)
|
|
30
|
-
on where to get the original distribution.
|
|
31
|
-
|
|
32
|
-
b) accompany the distribution with the machine-readable source of
|
|
33
|
-
the software.
|
|
34
|
-
|
|
35
|
-
c) give non-standard binaries non-standard names, with
|
|
36
|
-
instructions on where to get the original software distribution.
|
|
37
|
-
|
|
38
|
-
d) make other distribution arrangements with the author.
|
|
39
|
-
|
|
40
|
-
4. You may modify and include the part of the software into any other
|
|
41
|
-
software (possibly commercial). But some files in the distribution
|
|
42
|
-
are not written by the author, so that they are not under these terms.
|
|
43
|
-
|
|
44
|
-
For the list of those files and their copying conditions, see the
|
|
45
|
-
file LEGAL.
|
|
46
|
-
|
|
47
|
-
5. The scripts and library files supplied as input to or produced as
|
|
48
|
-
output from the software do not automatically fall under the
|
|
49
|
-
copyright of the software, but belong to whomever generated them,
|
|
50
|
-
and may be sold commercially, and may be aggregated with this
|
|
51
|
-
software.
|
|
52
|
-
|
|
53
|
-
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
|
54
|
-
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
|
55
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
56
|
-
PURPOSE.
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
module TarTestHelpers
|
|
2
|
-
Field = Struct.new(:name, :offset, :length)
|
|
3
|
-
def self.Field(name, length)
|
|
4
|
-
# standard:disable ThreadSafety/InstanceVariableInClassMethod
|
|
5
|
-
@offset ||= 0
|
|
6
|
-
field = Field.new(name, @offset, length)
|
|
7
|
-
@offset += length
|
|
8
|
-
# standard:enable ThreadSafety/InstanceVariableInClassMethod
|
|
9
|
-
|
|
10
|
-
FIELDS[name] = field
|
|
11
|
-
FIELD_ORDER << name
|
|
12
|
-
field
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
private
|
|
16
|
-
|
|
17
|
-
FIELDS = {}
|
|
18
|
-
FIELD_ORDER = []
|
|
19
|
-
|
|
20
|
-
Field("name", 100)
|
|
21
|
-
Field("mode", 8)
|
|
22
|
-
Field("uid", 8)
|
|
23
|
-
Field("gid", 8)
|
|
24
|
-
Field("size", 12)
|
|
25
|
-
Field("mtime", 12)
|
|
26
|
-
Field("checksum", 8)
|
|
27
|
-
Field("typeflag", 1)
|
|
28
|
-
Field("linkname", 100)
|
|
29
|
-
Field("magic", 6)
|
|
30
|
-
Field("version", 2)
|
|
31
|
-
Field("uname", 32)
|
|
32
|
-
Field("gname", 32)
|
|
33
|
-
Field("devmajor", 8)
|
|
34
|
-
Field("devminor", 8)
|
|
35
|
-
Field("prefix", 155)
|
|
36
|
-
|
|
37
|
-
BLANK_CHECKSUM = " " * 8
|
|
38
|
-
NULL_100 = "\0" * 100
|
|
39
|
-
USTAR = "ustar\0"
|
|
40
|
-
DOUBLE_ZERO = "00"
|
|
41
|
-
|
|
42
|
-
def assert_headers_equal(expected, actual)
|
|
43
|
-
FIELD_ORDER.each do |field|
|
|
44
|
-
message = if field == "checksum"
|
|
45
|
-
"Header checksums are expected to match."
|
|
46
|
-
else
|
|
47
|
-
"Header field #{field} is expected to match."
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
offset = FIELDS[field].offset
|
|
51
|
-
length = FIELDS[field].length
|
|
52
|
-
|
|
53
|
-
assert_equal expected[offset, length], actual[offset, length], message
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def assert_modes_equal(expected, actual, name)
|
|
58
|
-
return if Minitar.windows?
|
|
59
|
-
|
|
60
|
-
assert_equal(
|
|
61
|
-
mode_string(expected),
|
|
62
|
-
mode_string(actual),
|
|
63
|
-
"Mode for #{name} does not match"
|
|
64
|
-
)
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def tar_file_header(fname, dname, mode, length)
|
|
68
|
-
update_checksum(header("0", fname, dname, length, mode))
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
def tar_dir_header(name, prefix, mode)
|
|
72
|
-
update_checksum(header("5", name, prefix, 0, mode))
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
def tar_symlink_header(name, prefix, mode, target)
|
|
76
|
-
update_checksum(header("2", name, prefix, 0, mode, target))
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
def header(type, fname, dname, length, mode, link_name = "")
|
|
80
|
-
raw_header(type,
|
|
81
|
-
asciiz(fname, 100),
|
|
82
|
-
asciiz(dname, 155),
|
|
83
|
-
z(to_oct(length, 11)),
|
|
84
|
-
z(to_oct(mode, 7)),
|
|
85
|
-
asciiz(link_name, 100))
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
def raw_header(type, fname, dname, length, mode, link_name = "")
|
|
89
|
-
arr = [
|
|
90
|
-
fname, mode, z(to_oct(nil, 7)), z(to_oct(nil, 7)),
|
|
91
|
-
length, z(to_oct(0, 11)), BLANK_CHECKSUM, type,
|
|
92
|
-
asciiz(link_name, 100), USTAR, DOUBLE_ZERO, asciiz("", 32), asciiz("", 32),
|
|
93
|
-
z(to_oct(nil, 7)), z(to_oct(nil, 7)), dname
|
|
94
|
-
]
|
|
95
|
-
|
|
96
|
-
h = arr.join.bytes.to_a.pack("C100C8C8C8C12C12C8CC100C6C2C32C32C8C8C155")
|
|
97
|
-
ret = h + "\0" * (512 - h.bytesize)
|
|
98
|
-
assert_equal 512, ret.bytesize
|
|
99
|
-
ret
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
def update_checksum(header)
|
|
103
|
-
header[FIELDS["checksum"].offset, FIELDS["checksum"].length] =
|
|
104
|
-
# inject(:+) was introduced in which version?
|
|
105
|
-
sp(z(to_oct(header.unpack("C*").inject { |a, e| a + e }, 6)))
|
|
106
|
-
header
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
def to_oct(n, pad_size)
|
|
110
|
-
if n.nil?
|
|
111
|
-
"\0" * pad_size
|
|
112
|
-
else
|
|
113
|
-
"%0#{pad_size}o" % n
|
|
114
|
-
end
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
def asciiz(str, length)
|
|
118
|
-
str + "\0" * (length - str.bytesize)
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
def sp(s)
|
|
122
|
-
s + " "
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
def z(s)
|
|
126
|
-
s + "\0"
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
def mode_string(value)
|
|
130
|
-
"%04o" % (value & 0o777)
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
Minitest::Test.send(:include, self)
|
|
134
|
-
end
|