memcached 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v1.0.7. Fix build on BSD (Stew Mckinney). Fix build on Rubinius (brixen).
2
+
1
3
  v1.0.6. Make build step repeatable in the event of failure.
2
4
 
3
5
  v1.0.5. Fix Manifest.
@@ -25,8 +25,13 @@ if ENV['DEBUG']
25
25
  end
26
26
 
27
27
  def patch(prefix, reason)
28
- puts "Patching libmemcached source for #{reason}."
29
- puts(cmd = "#{PATCH_CMD} -p1 -f < #{prefix}.patch")
28
+ cmd = "#{PATCH_CMD} -p1 -f < #{prefix}.patch"
29
+ run(cmd, "Patching libmemcached source for #{reason}.")
30
+ end
31
+
32
+ def run(cmd, reason)
33
+ puts reason
34
+ puts cmd
30
35
  raise "'#{cmd}' failed" unless system(cmd) or ENV['DEV']
31
36
  end
32
37
 
@@ -51,10 +56,7 @@ def check_libmemcached
51
56
  # end
52
57
 
53
58
  system("rm -rf #{BUNDLE_PATH}") unless ENV['DEBUG'] or ENV['DEV']
54
-
55
- puts "Building libmemcached."
56
- puts(cmd = "#{TAR_CMD} xzf #{BUNDLE} 2>&1")
57
- raise "'#{cmd}' failed" unless system(cmd)
59
+ run("#{TAR_CMD} xzf #{BUNDLE} 2>&1", "Building libmemcached.")
58
60
 
59
61
  patch("libmemcached", "mark-dead behavior")
60
62
  patch("sasl", "SASL")
@@ -64,19 +66,13 @@ def check_libmemcached
64
66
  patch("libmemcached-5", "get_len method")
65
67
  patch("libmemcached-6", "failure count bug")
66
68
 
67
- puts "Touching aclocal.m4 in libmemcached."
68
- puts(cmd = "touch -r #{BUNDLE_PATH}/m4/visibility.m4 #{BUNDLE_PATH}/configure.ac #{BUNDLE_PATH}/m4/pandora_have_sasl.m4")
69
- raise "'#{cmd}' failed" unless system(cmd)
69
+ run("touch -r #{BUNDLE_PATH}/m4/visibility.m4 #{BUNDLE_PATH}/configure.ac #{BUNDLE_PATH}/m4/pandora_have_sasl.m4", "Touching aclocal.m4 in libmemcached.")
70
70
 
71
71
  Dir.chdir(BUNDLE_PATH) do
72
- puts(cmd = "env CFLAGS='-fPIC #{$CFLAGS}' LDFLAGS='-fPIC #{$LDFLAGS}' ./configure --prefix=#{HERE} --without-memcached --disable-shared --disable-utils --disable-dependency-tracking #{$EXTRA_CONF} 2>&1")
73
- raise "'#{cmd}' failed" unless system(cmd)
72
+ run("env CFLAGS='-fPIC #{$CFLAGS}' LDFLAGS='-fPIC #{$LDFLAGS}' ./configure --prefix=#{HERE} --without-memcached --disable-shared --disable-utils --disable-dependency-tracking #{$EXTRA_CONF} 2>&1", "Configuring libmemcached.")
74
73
 
75
- puts(cmd = "#{GMAKE_CMD} CXXFLAGS='#{$CXXFLAGS}' || true 2>&1")
76
- raise "'#{cmd}' failed" unless system(cmd)
77
-
78
- puts(cmd = "#{GMAKE_CMD} install || true 2>&1")
79
- raise "'#{cmd}' failed" unless system(cmd)
74
+ #Running the make command in another script invoked by another shell command solves the "cd ." issue on FreeBSD 6+
75
+ run("GMAKE_CMD='#{GMAKE_CMD}' CXXFLAGS='#{$CXXFLAGS}' SOURCE_DIR='#{BUNDLE_PATH}' HERE='#{HERE}' ruby ../extconf-make.rb", "Making libmemcached.")
80
76
  end
81
77
 
82
78
  system("rm -rf #{BUNDLE_PATH}") unless ENV['DEBUG'] or ENV['DEV']
@@ -94,11 +90,13 @@ end
94
90
  check_libmemcached
95
91
 
96
92
  if ENV['SWIG']
97
- puts "Running SWIG."
98
- puts(cmd = "swig #{$defines} #{$includes} -ruby -autorename rlibmemcached.i")
99
- raise "'#{cmd}' failed" unless system(cmd)
100
- puts(cmd = "sed -i '' 's/STR2CSTR/StringValuePtr/' rlibmemcached_wrap.c")
101
- raise "'#{cmd}' failed" unless system(cmd)
93
+ if (`swig -version`=~ /2.0.1/)
94
+ run("swig #{$defines} #{$includes} -ruby -autorename rlibmemcached.i", "Running SWIG.")
95
+ run("sed -i '' 's/STR2CSTR/StringValuePtr/' rlibmemcached_wrap.c", "Patching SWIG output for Ruby 1.9.")
96
+ run("sed -i '' 's/\"swig_runtime_data\"/\"SwigRuntimeData\"/' rlibmemcached_wrap.c", "Patching SWIG output for Ruby 1.9.")
97
+ else
98
+ raise "Swig 2.0.1 not found. Newer versions may not work."
99
+ end
102
100
  end
103
101
 
104
102
  $CFLAGS << " -Os"
@@ -34,7 +34,7 @@
34
34
  Check_Type($input, T_ARRAY);
35
35
  $3 = (unsigned int) RARRAY_LEN($input);
36
36
  $2 = (size_t *) malloc(($3+1)*sizeof(size_t));
37
- $1 = (char **) malloc(($3+1)*sizeof(char *));
37
+ $1 = (char **) malloc(($3+1)*sizeof(char *));
38
38
  for(i = 0; i < $3; i ++) {
39
39
  Check_Type(RARRAY_PTR($input)[i], T_STRING);
40
40
  $2[i] = RSTRING_LEN(RARRAY_PTR($input)[i]);
@@ -46,7 +46,7 @@
46
46
  Check_Type($input, T_ARRAY);
47
47
  $3 = (unsigned int) RARRAY_LEN($input);
48
48
  $2 = (size_t *) malloc(($3+1)*sizeof(size_t));
49
- $1 = (char **) malloc(($3+1)*sizeof(char *));
49
+ $1 = (char **) malloc(($3+1)*sizeof(char *));
50
50
  for(i = 0; i < $3; i ++) {
51
51
  Check_Type(RARRAY_PTR($input)[i], T_STRING);
52
52
  $2[i] = RSTRING_LEN(RARRAY_PTR($input)[i]);
@@ -74,8 +74,8 @@
74
74
  };
75
75
 
76
76
  %apply (const char *str, size_t len) {
77
- (const char *namespace, size_t namespace_length),
78
- (const char *key, size_t key_length),
77
+ (const char *namespace, size_t namespace_length),
78
+ (const char *key, size_t key_length),
79
79
  (const char *value, size_t value_length)
80
80
  };
81
81
 
@@ -116,16 +116,16 @@
116
116
  size_t length = 0;
117
117
  $1 = string;
118
118
  $2 = &length;
119
- };
119
+ };
120
120
  %typemap(argout) (char *key, size_t *key_length) {
121
121
  // Pushes an empty string when *key_length == 0
122
- rb_ary_push($result, rb_str_new($1, *$2));
122
+ rb_ary_push($result, rb_str_new($1, *$2));
123
123
  }
124
124
 
125
125
  // Array of strings
126
126
 
127
127
  %typemap(out) (char **) {
128
- int i;
128
+ int i;
129
129
  VALUE ary = rb_ary_new();
130
130
  $result = rb_ary_new();
131
131
 
@@ -195,7 +195,7 @@ VALUE memcached_fetch_rvalue(memcached_st *ptr, char *key, size_t *key_length, u
195
195
  VALUE memcached_fetch_rvalue(memcached_st *ptr, char *key, size_t *key_length, uint32_t *flags, memcached_return *error) {
196
196
  size_t value_length;
197
197
  VALUE result = rb_ary_new();
198
-
198
+
199
199
  char *value = memcached_fetch(ptr, key, key_length, &value_length, flags, error);
200
200
  VALUE ret = rb_str_new(value, value_length);
201
201
  rb_ary_push(result, ret);
@@ -238,7 +238,7 @@ memcached_stat_st *memcached_select_stat_at(memcached_st *in_ptr, memcached_stat
238
238
  // Uint32
239
239
  VALUE memcached_generate_hash_rvalue(const char *key, size_t key_length, memcached_hash hash_algorithm);
240
240
  %{
241
- VALUE memcached_generate_hash_rvalue(const char *key, size_t key_length,memcached_hash hash_algorithm) {
241
+ VALUE memcached_generate_hash_rvalue(const char *key, size_t key_length,memcached_hash hash_algorithm) {
242
242
  return UINT2NUM(memcached_generate_hash_value(key, key_length, hash_algorithm));
243
243
  };
244
244
  %}
@@ -1734,7 +1734,7 @@ SWIGRUNTIME void
1734
1734
  SWIG_Ruby_SetModule(swig_module_info *pointer)
1735
1735
  {
1736
1736
  /* register a new class */
1737
- VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1737
+ VALUE cl = rb_define_class("SwigRuntimeData", rb_cObject);
1738
1738
  /* create and store the structure pointer to a global variable */
1739
1739
  swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1740
1740
  rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
@@ -2286,7 +2286,7 @@ VALUE memcached_get_from_last_rvalue(memcached_st *ptr, const char *key, size_t
2286
2286
  VALUE memcached_fetch_rvalue(memcached_st *ptr, char *key, size_t *key_length, uint32_t *flags, memcached_return *error) {
2287
2287
  size_t value_length;
2288
2288
  VALUE result = rb_ary_new();
2289
-
2289
+
2290
2290
  char *value = memcached_fetch(ptr, key, key_length, &value_length, flags, error);
2291
2291
  VALUE ret = rb_str_new(value, value_length);
2292
2292
  rb_ary_push(result, ret);
@@ -2315,7 +2315,7 @@ memcached_stat_st *memcached_select_stat_at(memcached_st *in_ptr, memcached_stat
2315
2315
  };
2316
2316
 
2317
2317
 
2318
- VALUE memcached_generate_hash_rvalue(const char *key, size_t key_length,memcached_hash hash_algorithm) {
2318
+ VALUE memcached_generate_hash_rvalue(const char *key, size_t key_length,memcached_hash hash_algorithm) {
2319
2319
  return UINT2NUM(memcached_generate_hash_value(key, key_length, hash_algorithm));
2320
2320
  };
2321
2321
 
@@ -8224,7 +8224,7 @@ _wrap_memcached_stat_get_keys(int argc, VALUE *argv, VALUE self) {
8224
8224
  arg2 = (memcached_stat_st *)(argp2);
8225
8225
  result = (char **)memcached_stat_get_keys(arg1,arg2,arg3);
8226
8226
  {
8227
- int i;
8227
+ int i;
8228
8228
  VALUE ary = rb_ary_new();
8229
8229
  vresult = rb_ary_new();
8230
8230
 
@@ -8836,7 +8836,7 @@ _wrap_memcached_mget(int argc, VALUE *argv, VALUE self) {
8836
8836
  Check_Type(argv[1], T_ARRAY);
8837
8837
  arg4 = (unsigned int) RARRAY_LEN(argv[1]);
8838
8838
  arg3 = (size_t *) malloc((arg4+1)*sizeof(size_t));
8839
- arg2 = (char **) malloc((arg4+1)*sizeof(char *));
8839
+ arg2 = (char **) malloc((arg4+1)*sizeof(char *));
8840
8840
  for(i = 0; i < arg4; i ++) {
8841
8841
  Check_Type(RARRAY_PTR(argv[1])[i], T_STRING);
8842
8842
  arg3[i] = RSTRING_LEN(RARRAY_PTR(argv[1])[i]);
@@ -8878,7 +8878,7 @@ _wrap_memcached_mget_len(int argc, VALUE *argv, VALUE self) {
8878
8878
  Check_Type(argv[1], T_ARRAY);
8879
8879
  arg4 = (unsigned int) RARRAY_LEN(argv[1]);
8880
8880
  arg3 = (size_t *) malloc((arg4+1)*sizeof(size_t));
8881
- arg2 = (char **) malloc((arg4+1)*sizeof(char *));
8881
+ arg2 = (char **) malloc((arg4+1)*sizeof(char *));
8882
8882
  for(i = 0; i < arg4; i ++) {
8883
8883
  Check_Type(RARRAY_PTR(argv[1])[i], T_STRING);
8884
8884
  arg3[i] = RSTRING_LEN(RARRAY_PTR(argv[1])[i]);
@@ -9012,7 +9012,7 @@ _wrap_memcached_mget_by_key(int argc, VALUE *argv, VALUE self) {
9012
9012
  Check_Type(argv[3], T_ARRAY);
9013
9013
  arg6 = (unsigned int) RARRAY_LEN(argv[3]);
9014
9014
  arg5 = (size_t *) malloc((arg6+1)*sizeof(size_t));
9015
- arg4 = (char **) malloc((arg6+1)*sizeof(char *));
9015
+ arg4 = (char **) malloc((arg6+1)*sizeof(char *));
9016
9016
  for(i = 0; i < arg6; i ++) {
9017
9017
  Check_Type(RARRAY_PTR(argv[3])[i], T_STRING);
9018
9018
  arg5[i] = RSTRING_LEN(RARRAY_PTR(argv[3])[i]);
@@ -9074,7 +9074,7 @@ _wrap_memcached_fetch(int argc, VALUE *argv, VALUE self) {
9074
9074
  vresult = SWIG_FromCharPtr((const char *)result);
9075
9075
  {
9076
9076
  // Pushes an empty string when *key_length == 0
9077
- rb_ary_push(vresult, rb_str_new(arg2, *arg3));
9077
+ rb_ary_push(vresult, rb_str_new(arg2, *arg3));
9078
9078
  }
9079
9079
  if (SWIG_IsTmpObj(res4)) {
9080
9080
  vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_size_t((*arg4)));
@@ -12642,7 +12642,7 @@ _wrap_memcached_fetch_rvalue(int argc, VALUE *argv, VALUE self) {
12642
12642
  vresult = result;
12643
12643
  {
12644
12644
  // Pushes an empty string when *key_length == 0
12645
- rb_ary_push(vresult, rb_str_new(arg2, *arg3));
12645
+ rb_ary_push(vresult, rb_str_new(arg2, *arg3));
12646
12646
  }
12647
12647
  if (SWIG_IsTmpObj(res4)) {
12648
12648
  vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_unsigned_SS_int((*arg4)));
@@ -2,12 +2,12 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{memcached}
5
- s.version = "1.0.6"
5
+ s.version = "1.0.7"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Evan Weaver"]
9
9
  s.cert_chain = ["/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-public_cert.pem"]
10
- s.date = %q{2011-02-09}
10
+ s.date = %q{2011-02-22}
11
11
  s.description = %q{An interface to the libmemcached C client.}
12
12
  s.email = %q{}
13
13
  s.extensions = ["ext/extconf.rb"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memcached
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 6
10
- version: 1.0.6
9
+ - 7
10
+ version: 1.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Evan Weaver
@@ -36,7 +36,7 @@ cert_chain:
36
36
  yZ0=
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2011-02-09 00:00:00 -08:00
39
+ date: 2011-02-22 00:00:00 -08:00
40
40
  default_executable:
41
41
  dependencies: []
42
42
 
metadata.gz.sig CHANGED
Binary file