Skip to content

Commit ef8f828

Browse files
committed
Merge branch 'master' into dist/2.5/trusty
2 parents 7aa91ec + 7523236 commit ef8f828

File tree

6 files changed

+61
-5
lines changed

6 files changed

+61
-5
lines changed

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
ruby-defaults (1:2.5.2+0nkmi1~dist) unstable; urgency=medium
2+
3+
* Port from debian upstream
4+
5+
-- Sorah Fukumori <[email protected]> Wed, 21 Nov 2018 21:59:38 +0000
6+
17
ruby-defaults (1:2.5.0+0nkmi1~trusty) trusty; urgency=medium
28

39
* Make Ruby 2.5 the default

debian/control

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Source: ruby-defaults
22
Section: ruby
33
Priority: optional
4-
Maintainer: Antonio Terceiro <terceiro@debian.org>,
5-
Sorah Fukumori <[email protected]>,
4+
Maintainer: Debian Ruby Team <[email protected].debian.org>,
5+
Sorah Fukumori <[email protected]>
66
Build-Depends: debhelper (>= 9)
77
Standards-Version: 3.9.8
88
Homepage: http://www.ruby-lang.org/

debian/rules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/make -f
22

3+
include /usr/share/dpkg/pkg-info.mk
4+
35
# XXX remember to regenerate debian/ruby.postinst when you change either of
46
# these variables.
57
#
@@ -18,6 +20,10 @@ export DEBIAN_RUBY_PROGRAMS = \
1820
%:
1921
dh $@
2022

23+
override_dh_auto_configure:
24+
debian/version-check "$(DEB_VERSION)" "$(DEBIAN_DEFAULT_RUBY_VERSION)"
25+
dh_auto_configure
26+
2127
debian/ruby.postinst: debian/ruby.postinst.in
2228
sed -e 's/@@DEBIAN_DEFAULT_RUBY_VERSION@@/$(DEBIAN_DEFAULT_RUBY_VERSION)/g; s/@@DEBIAN_RUBY_PROGRAMS@@/$(DEBIAN_RUBY_PROGRAMS)/g' $< > $@ || ($(RM) $@; false)
2329

debian/tests/ruby-all-dev

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ describe RubyDebianDev do
99
it "installs #{data[:binary]}" do
1010
File.executable?(data[:binary]).must_equal true
1111
end
12+
13+
it "has an associated minimum version of #{ruby}" do
14+
v = RubyDebianDev.min_ruby_dependency_for("lib#{ruby}")
15+
v.must_match %r{^ruby \(>= .+\)$}
16+
end
17+
end
18+
19+
it 'provides a Ruby upper bound' do
20+
ruby_upper_bound = RubyDebianDev.ruby_upper_bound
21+
ruby_upper_bound.must_match %r{^ruby \(<< .+\)}
1222
end
23+
24+
it 'provides list of supported interpreters with default first' do
25+
default = File.basename(File.readlink('/usr/bin/ruby'))
26+
default.must_equal RubyDebianDev::SUPPORTED_RUBY_VERSIONS.keys.first
27+
end
28+
1329
end
1430

debian/version-check

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
package_version="$1"
6+
default_ruby_version="$2"
7+
8+
case "$package_version" in
9+
[0-9]:$default_ruby_version*)
10+
: ok
11+
;;
12+
*)
13+
echo "E: Inconsistent package version number: $package_version"
14+
echo "E: Default Ruby version: $default_ruby_version"
15+
exit 1;
16+
;;
17+
esac

ruby_debian_dev.rb

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,36 @@ def self.has_support_for(ruby)
66
RUBY_INTERPRETERS[ruby] = yield
77
end
88

9-
has_support_for 'ruby2.4' do
9+
has_support_for 'ruby2.5' do
1010
{
1111
version: '2.5',
1212
binary: '/usr/bin/ruby2.5',
1313
api_version: '2.5.0',
1414
shared_library: 'libruby2.5',
15-
min_ruby_dependency: 'ruby (>= 1:2.5~0)',
15+
min_ruby_version: '1:2.5~0',
16+
ruby_upper_bound: '1:2.6~',
1617
}
1718
end
1819

1920
def self.min_ruby_dependency_for(shared_library)
2021
RUBY_INTERPRETERS.each do |int,data|
2122
if data[:shared_library] == shared_library
22-
return data[:min_ruby_dependency]
23+
return "ruby (>= %s)" % data[:min_ruby_version]
2324
end
2425
end
2526
return nil
2627
end
2728

29+
def self.ruby_upper_bound
30+
sort = IO.popen('sort -V', 'w+')
31+
RUBY_INTERPRETERS.values.map do |data|
32+
sort.puts(data[:ruby_upper_bound])
33+
end
34+
sort.close_write()
35+
version = sort.read.split.last
36+
"ruby (<< #{version})"
37+
end
38+
2839
#################################################################
2940
# These constants below are kept here for backwards compatibility
3041
#################################################################

0 commit comments

Comments
 (0)