diff options
Diffstat (limited to 'Library/Homebrew/compat')
| -rw-r--r-- | Library/Homebrew/compat/dependency_collector.rb | 25 | ||||
| -rw-r--r-- | Library/Homebrew/compat/keg.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/compat/pathname.rb | 17 |
3 files changed, 48 insertions, 0 deletions
diff --git a/Library/Homebrew/compat/dependency_collector.rb b/Library/Homebrew/compat/dependency_collector.rb new file mode 100644 index 000000000..516c55b56 --- /dev/null +++ b/Library/Homebrew/compat/dependency_collector.rb @@ -0,0 +1,25 @@ +module DependencyCollectorCompat + def parse_symbol_spec(spec, tags) + case spec + when :clt + when :autoconf, :automake, :bsdmake, :libtool + autotools_dep(spec, tags) + when :cairo, :fontconfig, :freetype, :libpng, :pixman + Dependency.new(spec.to_s, tags) + when :libltdl + tags << :run + Dependency.new("libtool", tags) + else + super(spec, tags) + end + end +end + +class DependencyCollector + prepend DependencyCollectorCompat + + def autotools_dep(spec, tags) + tags << :build unless tags.include? :run + Dependency.new(spec.to_s, tags) + end +end diff --git a/Library/Homebrew/compat/keg.rb b/Library/Homebrew/compat/keg.rb new file mode 100644 index 000000000..015e6ae1f --- /dev/null +++ b/Library/Homebrew/compat/keg.rb @@ -0,0 +1,6 @@ +class Keg + def fname + opoo "Keg#fname is a deprecated alias for Keg#name and will be removed soon" + name + end +end diff --git a/Library/Homebrew/compat/pathname.rb b/Library/Homebrew/compat/pathname.rb new file mode 100644 index 000000000..7248525e5 --- /dev/null +++ b/Library/Homebrew/compat/pathname.rb @@ -0,0 +1,17 @@ +class Pathname + def cp(dst) + opoo "Pathname#cp is deprecated, use FileUtils.cp" + if file? + FileUtils.cp to_s, dst + else + FileUtils.cp_r to_s, dst + end + dst + end + + def chmod_R(perms) + opoo "Pathname#chmod_R is deprecated, use FileUtils.chmod_R" + require "fileutils" + FileUtils.chmod_R perms, to_s + end +end |
