minitar 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of minitar might be problematic. Click here for more details.

data/ChangeLog CHANGED
@@ -2,6 +2,9 @@ Revision history for Ruby library Archive::Tar::Minitar. Unless explicitly
2
2
  noted otherwise, all changes are produced by Austin Ziegler
3
3
  <austin@rubyforge.org>.
4
4
 
5
+ == 0.5.3
6
+ * Fix for long names (http://rubyforge.org/tracker/index.php?func=detail&aid=22628&group_id=84&atid=407)
7
+
5
8
  == 0.5.2
6
9
  * Fixed a Ruby 1.9 compatibility error.
7
10
 
data/README CHANGED
@@ -4,6 +4,8 @@ Archive::Tar::Minitar is a pure-Ruby library and command-line utility that
4
4
  provides the ability to deal with POSIX tar(1) archive files. The
5
5
  implementation is based heavily on Mauricio Ferna'ndez's implementation in
6
6
  rpa-base, but has been reorganised to promote reuse in other projects.
7
+ Antoine Toulme forked the original project on rubyforge to place it on github, under
8
+ http://www.github.com/atoulme/minitar
7
9
 
8
10
  This release is version 0.5.2, offering a Ruby 1.9 compatibility bugfix over
9
11
  version 0.5.1. The library can only handle files and directories at this
@@ -86,8 +86,8 @@ class Archive::Tar::PosixHeader
86
86
  empty = (data == "\0" * 512)
87
87
 
88
88
  if typeflag == 'L' && name == '././@LongLink'
89
- long_name = stream.read(512).rstrip
90
- return new_from_stream(stream, long_name)
89
+ long_name = stream.read(512).rstrip
90
+ return new_from_stream(stream, long_name)
91
91
  end
92
92
 
93
93
  new(:name => long_name || name,
@@ -231,7 +231,7 @@ require 'find'
231
231
  # modified under the terms of the GPL version 2 (or later) or Ruby's
232
232
  # licence.
233
233
  module Archive::Tar::Minitar
234
- VERSION = "0.5.2"
234
+ VERSION = "0.5.4"
235
235
 
236
236
  # The exception raised when a wrapped data stream class is expected to
237
237
  # respond to #rewind or #pos but does not.
@@ -517,7 +517,7 @@ module Archive::Tar::Minitar
517
517
 
518
518
  # Returns +true+ if the entry represents a plain file.
519
519
  def file?
520
- @typeflag == "0"
520
+ @typeflag == "0" or @typeflag == "\0"
521
521
  end
522
522
  alias_method :file, :file?
523
523
 
@@ -465,6 +465,7 @@ class TC_Tar__Input < Test::Unit::TestCase
465
465
  require 'rbconfig'
466
466
 
467
467
  TEST_TGZ = "\037\213\010\000\001B1A\000\vKI,I\324+I,\322K\257b\240\0250\000\002sSS\254\342 `dj\306``nnnbndbjd\000\0247336`P0\240\231\213\220@i1\320\367@+\351a\327 \004\362\335\034\f\313\034\r\035\031\270\337Ns\344b2\344q\335\375M\304\266QM1W\357\321>\221U\021\005\246\306\367\356\367u3\262;\212\004\265\236\\\334}\351,\377\037;\217\223\301e\247\030\024\\\236\211\277\347\346sii\265\010\330\355\234\240\362\274\371[\202\361\366\302S\316\335o&~m\237r\355\377\303\230\365\352WNW\334\266_\373\273\237\347Q\315t?\263{\377?\006\271\337?\367\207\325\346]\371\376y\307_\234~d\3772\265\346\261}\323\317\373\315\352\377O\376\271/\305\377?X\253\324\303S\373\361\347\277\372^)\267\377\363\03460\331\311\\wW|\031\203\300@\207\325p\004i\2319\251\3064\266\203P\376702B\313\377\246\246\006&\243\371\237\036 $#\263X\001\210@\351@\301XO\201\227k\240]4\nF\301(\030\005\243\200\036\000\000\004\330t\023\000\f\000\000"
468
+ TEST_LONG_ENTRY_TGZ = "\037\213\b\000\022LAL\000\003\355\323Kn\3020\020\006`\2579EN\020l\3428\333\036 w\210\fq!\305\261\301\017H8=\345QJ\027\024\251*\251\250\376o1\036yF\262ek\322q:~)\255\231\227\215Y\222\307\240'\267V\232\361\374\222\037\367\031\313EA\222\362A\367\371\"\372 ]\222\020gm\370\256\357^\375I\371\270R\256\252\217\361:W]p\322\272\2721\322\365\225SR\353\276\332(w\016>Nu\323\352KENg\265z\235/\232\267\245n\215]\255\235\017q\263\355\372]\025\224\017\237a\350\363\322\320\375\307o\3735C\374\307a\250\005\347\207\031gEN\257\3273A\030\343\023:\341y\221\275\367e\2023A\022:\304\003|\314\177\260Q\267J\232[}\367\352Oj\241\264\266\243\277\276\005\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\374\324\036\373\275\021\004\000(\000\000"
468
469
  FILETIMES = Time.utc(2004,"jan",1,5,0,0).to_i
469
470
 
470
471
  TEST_CONTENTS = [
@@ -561,6 +562,20 @@ class TC_Tar__Input < Test::Unit::TestCase
561
562
  assert_equal(1, ii)
562
563
  end
563
564
  end
565
+
566
+ def test_extract_long_file_name_entry_works
567
+ gzr = Zlib::GzipReader.new(StringIO.new(TEST_LONG_ENTRY_TGZ))
568
+ Input.open(gzr) do |is|
569
+ ii = 0
570
+ is.each_with_index do |entry, ii|
571
+ assert_equal("super_duper_super_duper_extraordinary_really_very_very_sublimly_really_abcdefghijklmnopqrstuvwxyz_test_test_testsuper_duper_super_duper_extraordinary_really_very_very_sublimly_really_abcdefghijklmnopqrstuvwxyz_test_test_test.txt", entry.name)
572
+ is.extract_entry("data__", entry)
573
+ name = File.join("data__", entry.name)
574
+ assert(File.file?(name))
575
+ end
576
+ assert_equal(0, ii)
577
+ end
578
+ end
564
579
  end
565
580
 
566
581
  class TC_Tar__Output < Test::Unit::TestCase
metadata CHANGED
@@ -1,29 +1,30 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: minitar
3
- version: !ruby/object:Gem::Version
4
- version: 0.5.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.4
5
+ prerelease:
5
6
  platform: ruby
6
- authors:
7
+ authors:
7
8
  - Austin Ziegler, Mauricio Fernandez, Antoine Toulme
8
9
  autorequire: archive/tar/minitar
9
10
  bindir: bin
10
11
  cert_chain: []
11
-
12
- date: 2010-07-12 00:00:00 -07:00
13
- default_executable:
12
+ date: 2012-11-14 00:00:00.000000000 Z
14
13
  dependencies: []
15
-
16
- description: Archive::Tar::Minitar is a pure-Ruby library and command-line utility that provides the ability to deal with POSIX tar(1) archive files. The implementation is based heavily on Mauricio Ferna'ndez's implementation in rpa-base, but has been reorganised to promote reuse in other projects.
17
- email: minitar@halostatue.ca
18
- executables:
14
+ description: Archive::Tar::Minitar is a pure-Ruby library and command-line utility
15
+ that provides the ability to deal with POSIX tar(1) archive files. The implementation
16
+ is based heavily on Mauricio Ferna'ndez's implementation in rpa-base, but has been
17
+ reorganised to promote reuse in other projects. Antoine Toulme forked the original
18
+ project on rubyforge to place it on github, under http://www.github.com/atoulme/minitar
19
+ email: antoine@lunar-ocean.com
20
+ executables:
19
21
  - minitar
20
22
  extensions: []
21
-
22
- extra_rdoc_files:
23
+ extra_rdoc_files:
23
24
  - README
24
25
  - ChangeLog
25
26
  - Install
26
- files:
27
+ files:
27
28
  - bin/minitar
28
29
  - ChangeLog
29
30
  - Install
@@ -33,37 +34,34 @@ files:
33
34
  - README
34
35
  - tests/tc_tar.rb
35
36
  - tests/testall.rb
36
- has_rdoc: true
37
- homepage: http://rubyforge.org/projects/ruwiki/
37
+ homepage: http://www.github.com/atoulme/minitar
38
38
  licenses: []
39
-
40
39
  post_install_message:
41
- rdoc_options:
40
+ rdoc_options:
42
41
  - --title
43
42
  - Archive::Tar::MiniTar -- A POSIX tarchive library
44
43
  - --main
45
44
  - README
46
45
  - --line-numbers
47
- require_paths:
46
+ require_paths:
48
47
  - lib
49
- required_ruby_version: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
53
  version: 1.8.2
54
- version:
55
- required_rubygems_version: !ruby/object:Gem::Requirement
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- version: "0"
60
- version:
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
61
60
  requirements: []
62
-
63
- rubyforge_project: ruwiki
64
- rubygems_version: 1.3.5
61
+ rubyforge_project:
62
+ rubygems_version: 1.8.24
65
63
  signing_key:
66
64
  specification_version: 3
67
65
  summary: Provides POSIX tarchive management from Ruby programs.
68
- test_files:
66
+ test_files:
69
67
  - tests/testall.rb