This patch file represents the entire difference between the package as shipped
by Debian and the official upstream sources. The goal is to maintain this file
as small as possible, avoiding non-upstreamed patches at all costs.

The Debian packaging is maintained in the following Git repository:

  http://anonscm.debian.org/gitweb/?p=collab-maint/ruby.git

To obtain a view of the individual commits that affect non-Debian-specific
files, you can clone that repository, and from the master branch, run:

  $ ./debian/upstream-changes

--- ruby2.1-2.1.5.orig/ext/io/console/io-console.gemspec
+++ ruby2.1-2.1.5/ext/io/console/io-console.gemspec
@@ -1,11 +1,10 @@
 # -*- ruby -*-
 _VERSION = "0.4.2"
-date = %w$Date::                           $[1]
 
 Gem::Specification.new do |s|
   s.name = "io-console"
   s.version = _VERSION
-  s.date = date
+  s.date = RUBY_RELEASE_DATE
   s.summary = "Console interface"
   s.email = "nobu@ruby-lang.org"
   s.description = "add console capabilities to IO instances."
--- ruby2.1-2.1.5.orig/include/ruby/intern.h
+++ ruby2.1-2.1.5/include/ruby/intern.h
@@ -769,8 +769,8 @@ VALUE rb_str_replace(VALUE, VALUE);
 VALUE rb_str_inspect(VALUE);
 VALUE rb_str_dump(VALUE);
 VALUE rb_str_split(VALUE, const char*);
-void rb_str_associate(VALUE, VALUE);
-VALUE rb_str_associated(VALUE);
+DEPRECATED(void rb_str_associate(VALUE, VALUE));
+DEPRECATED(VALUE rb_str_associated(VALUE));
 void rb_str_setter(VALUE, ID, VALUE*);
 VALUE rb_str_intern(VALUE);
 VALUE rb_sym_to_s(VALUE);
--- ruby2.1-2.1.5.orig/lib/test/unit/test-unit.gemspec
+++ ruby2.1-2.1.5/lib/test/unit/test-unit.gemspec
@@ -3,6 +3,7 @@
 Gem::Specification.new do |s|
   s.name = "test-unit"
   s.version = "#{RUBY_VERSION}.0"
+  s.date = RUBY_RELEASE_DATE
   s.homepage = "http://www.ruby-lang.org"
   s.author = "Shota Fukumori"
   s.email = "sorah@tubusu.net"
--- ruby2.1-2.1.5.orig/pack.c
+++ ruby2.1-2.1.5/pack.c
@@ -234,6 +234,45 @@ static void qpencode(VALUE,VALUE,long);
 
 static unsigned long utf8_to_uv(const char*,long*);
 
+static ID id_associated;
+
+static void
+str_associate(VALUE str, VALUE add)
+{
+    VALUE assoc;
+
+    assoc = rb_attr_get(str, id_associated);
+    if (RB_TYPE_P(assoc, T_ARRAY)) {
+	/* already associated */
+	rb_ary_concat(assoc, add);
+    }
+    else {
+	rb_ivar_set(str, id_associated, add);
+    }
+}
+
+static VALUE
+str_associated(VALUE str)
+{
+    VALUE assoc = rb_attr_get(str, id_associated);
+    if (NIL_P(assoc)) assoc = Qfalse;
+    return assoc;
+}
+
+void
+rb_str_associate(VALUE str, VALUE add)
+{
+    rb_warn("rb_str_associate() is only for internal use and deprecated; do not use");
+    str_associate(str, add);
+}
+
+VALUE
+rb_str_associated(VALUE str)
+{
+    rb_warn("rb_str_associated() is only for internal use and deprecated; do not use");
+    return str_associated(str);
+}
+
 /*
  *  call-seq:
  *     arr.pack ( aTemplateString ) -> aBinaryString
@@ -921,7 +960,7 @@ pack_pack(VALUE ary, VALUE fmt)
     }
 
     if (associates) {
-	rb_str_associate(res, associates);
+	str_associate(res, associates);
     }
     OBJ_INFECT(res, fmt);
     switch (enc_info) {
@@ -1803,7 +1842,7 @@ pack_unpack(VALUE str, VALUE fmt)
 		    VALUE a;
 		    const VALUE *p, *pend;
 
-		    if (!(a = rb_str_associated(str))) {
+		    if (!(a = str_associated(str))) {
 			rb_raise(rb_eArgError, "no associated pointer");
 		    }
 		    p = RARRAY_CONST_PTR(a);
@@ -1812,7 +1851,7 @@ pack_unpack(VALUE str, VALUE fmt)
 			if (RB_TYPE_P(*p, T_STRING) && RSTRING_PTR(*p) == t) {
 			    if (len < RSTRING_LEN(*p)) {
 				tmp = rb_tainted_str_new(t, len);
-				rb_str_associate(tmp, a);
+				str_associate(tmp, a);
 			    }
 			    else {
 				tmp = *p;
@@ -1846,7 +1885,7 @@ pack_unpack(VALUE str, VALUE fmt)
 			VALUE a;
 			const VALUE *p, *pend;
 
-			if (!(a = rb_str_associated(str))) {
+			if (!(a = str_associated(str))) {
 			    rb_raise(rb_eArgError, "no associated pointer");
 			}
 			p = RARRAY_CONST_PTR(a);
@@ -2008,4 +2047,6 @@ Init_pack(void)
 {
     rb_define_method(rb_cArray, "pack", pack_pack, 1);
     rb_define_method(rb_cString, "unpack", pack_unpack, 1);
+
+    id_associated = rb_intern_const("__pack_associated__");
 }
--- ruby2.1-2.1.5.orig/string.c
+++ ruby2.1-2.1.5/string.c
@@ -1536,47 +1536,6 @@ str_discard(VALUE str)
 }
 
 void
-rb_str_associate(VALUE str, VALUE add)
-{
-    /* sanity check */
-    rb_check_frozen(str);
-    if (STR_ASSOC_P(str)) {
-	/* already associated */
-	rb_ary_concat(RSTRING(str)->as.heap.aux.shared, add);
-    }
-    else {
-	if (STR_SHARED_P(str)) {
-	    VALUE assoc = RSTRING(str)->as.heap.aux.shared;
-	    str_make_independent(str);
-	    if (STR_ASSOC_P(assoc)) {
-		assoc = RSTRING(assoc)->as.heap.aux.shared;
-		rb_ary_concat(assoc, add);
-		add = assoc;
-	    }
-	}
-	else if (STR_EMBED_P(str)) {
-	    str_make_independent(str);
-	}
-	else if (RSTRING(str)->as.heap.aux.capa != RSTRING_LEN(str)) {
-	    RESIZE_CAPA(str, RSTRING_LEN(str));
-	}
-	FL_SET(str, STR_ASSOC);
-	RBASIC_CLEAR_CLASS(add);
-	RB_OBJ_WRITE(str, &RSTRING(str)->as.heap.aux.shared, add);
-    }
-}
-
-VALUE
-rb_str_associated(VALUE str)
-{
-    if (STR_SHARED_P(str)) str = RSTRING(str)->as.heap.aux.shared;
-    if (STR_ASSOC_P(str)) {
-	return RSTRING(str)->as.heap.aux.shared;
-    }
-    return Qfalse;
-}
-
-void
 rb_must_asciicompat(VALUE str)
 {
     rb_encoding *enc = rb_enc_get(str);
--- ruby2.1-2.1.5.orig/test/ruby/test_pack.rb
+++ ruby2.1-2.1.5/test/ruby/test_pack.rb
@@ -181,7 +181,7 @@ class TestPack < Test::Unit::TestCase
     assert_equal a[0], a.pack("p").unpack("p")[0]
     assert_equal a, a.pack("p").freeze.unpack("p*")
     assert_raise(ArgumentError) { (a.pack("p") + "").unpack("p*") }
-    assert_raise(ArgumentError) { (a.pack("p") << "d").unpack("p*") }
+    assert_equal a, (a.pack("p") << "d").unpack("p*")
   end
 
   def test_format_string_modified
--- ruby2.1-2.1.5.orig/tool/rbinstall.rb
+++ ruby2.1-2.1.5/tool/rbinstall.rb
@@ -666,7 +666,8 @@ module RbInstall
         @gemspec ||= begin
           spec = Gem::Specification.load(src) || raise("invalid spec in #{src}")
           file_collector = FileCollector.new(File.dirname(src))
-          spec.files = file_collector.collect
+          spec.executables = spec.executables.sort
+          spec.files = file_collector.collect.sort
           spec
         end
       end
@@ -687,8 +688,8 @@ Gem::Specification.new do |s|
   s.name = #{name.dump}
   s.version = #{version.dump}
   s.summary = "This #{name} is bundled with Ruby"
-  s.executables = #{execs.inspect}
-  s.files = #{files.inspect}
+  s.executables = #{execs.sort.inspect}
+  s.files = #{files.sort.inspect}
 end
         GEMSPEC
       end
