Class: Homebrew::InstallSteps::DSL Private

Inherits:
Object
  • Object
show all
Defined in:
install_steps.rb

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(default_base: nil, default_source_base: nil, default_target_base: nil) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:



80
81
82
83
84
85
86
87
# File 'install_steps.rb', line 80

def initialize(default_base: nil, default_source_base: nil, default_target_base: nil)
  @default_base = default_base
  @default_source_base = default_source_base
  @default_target_base = default_target_base
  @steps = ::T.let([], Steps)
  @guards = ::T.let([], PathSpecs)
  @next_guard_id = ::T.let(0, ::Integer)
end

Instance Attribute Details

#steps ⇒ Steps (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



90
91
92
# File 'install_steps.rb', line 90

def steps
  @steps
end

Class Method Details

.build(default_base: nil, default_source_base: nil, default_target_base: nil, &block) ⇒ Steps

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:



126
127
128
129
130
# File 'install_steps.rb', line 126

def self.build(default_base: nil, default_source_base: nil, default_target_base: nil, &block)
  dsl = new(default_base:, default_source_base:, default_target_base:)
  dsl.instance_eval(&block) if block
  dsl.steps
end

.normalise_steps(steps) ⇒ Steps

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:



165
166
167
168
169
170
171
172
173
# File 'install_steps.rb', line 165

def self.normalise_steps(steps)
  steps.map do |step|
    step = step.to_h do |key, value|
      key = key.to_s
      [key, normalise_step_value(key, value)]
    end
    compact_step(step)
  end
end

Instance Method Details

#arch ⇒ String

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



109
110
111
# File 'install_steps.rb', line 109

def arch
  "{{arch}}"
end

#bootstrap_cpython ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



808
809
810
# File 'install_steps.rb', line 808

def bootstrap_cpython
  add_step("bootstrap_cpython")
end

#bootstrap_pypy(abi_version:) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



813
814
815
# File 'install_steps.rb', line 813

def bootstrap_pypy(abi_version:)
  add_step("bootstrap_pypy", "abi_version" => abi_version)
end

#change_dylib_id(source, id, base: nil, resolve_source: false) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



691
692
693
694
695
696
# File 'install_steps.rb', line 691

def change_dylib_id(source, id, base: nil, resolve_source: false)
  add_step("change_dylib_id",
           "source"         => path_spec(source, base:, default_base: @default_source_base),
           "id"             => id.to_s,
           "resolve_source" => resolve_source)
end

#compile_gsettings_schemas ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



574
575
576
# File 'install_steps.rb', line 574

def compile_gsettings_schemas
  add_rebuild_action("compile_gsettings_schemas", "share/glib-2.0/schemas")
end

#configure_clang_system ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



798
799
800
# File 'install_steps.rb', line 798

def configure_clang_system
  add_step("configure_clang_system")
end

#configure_gcc_runtime ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



774
775
776
# File 'install_steps.rb', line 774

def configure_gcc_runtime
  add_step("configure_gcc_runtime")
end

#configure_glibc_runtime ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



793
794
795
# File 'install_steps.rb', line 793

def configure_glibc_runtime
  add_step("configure_glibc_runtime")
end

#configure_php ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



803
804
805
# File 'install_steps.rb', line 803

def configure_php
  add_step("configure_php")
end

#copy(source, target, source_base: nil, target_base: nil, recursive: false, overwrite: true, source_glob: false) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



328
329
330
331
332
333
334
335
336
# File 'install_steps.rb', line 328

def copy(source, target, source_base: nil, target_base: nil, recursive: false, overwrite: true,
         source_glob: false)
  add_step("copy",
           "source"      => path_spec(source, base: source_base, default_base: @default_source_base),
           "target"      => path_spec(target, base: target_base, default_base: @default_target_base),
           "recursive"   => recursive,
           "overwrite"   => (false unless overwrite),
           "source_glob" => source_glob)
end

#delete_keychain_certificate(name, matching_certificate: nil, base: nil) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



629
630
631
632
633
634
635
636
# File 'install_steps.rb', line 629

def delete_keychain_certificate(name, matching_certificate: nil, base: nil)
  ::Utils::Output.odeprecated "`delete_keychain_certificate` in an install steps block",
                              "`delete_keychain_certificates`"
  add_step("delete_keychain_certificate",
           "name"                 => name,
           "matching_certificate" => (path_spec(matching_certificate, base:, default_base: nil) if
             matching_certificate))
end

#delete_keychain_certificates(name, fingerprint_of: nil, base: nil) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



645
646
647
648
649
# File 'install_steps.rb', line 645

def delete_keychain_certificates(name, fingerprint_of: nil, base: nil)
  add_step("delete_keychain_certificate",
           "name"                 => name,
           "matching_certificate" => (path_spec(fingerprint_of, base:, default_base: nil) if fingerprint_of))
end

#formula_name ⇒ String

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



99
100
101
# File 'install_steps.rb', line 99

def formula_name
  "{{formula_name}}"
end

#gdk_pixbuf_query_loaders ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



590
591
592
593
594
# File 'install_steps.rb', line 590

def gdk_pixbuf_query_loaders
  ::Utils::Output.odeprecated "`gdk_pixbuf_query_loaders` in an install steps block",
                              "`update_gdk_pixbuf_loaders_cache`"
  add_step("gdk_pixbuf_query_loaders")
end

#gio_querymodules ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



579
580
581
582
# File 'install_steps.rb', line 579

def gio_querymodules
  ::Utils::Output.odeprecated "`gio_querymodules` in an install steps block", "`update_gio_modules_cache`"
  add_rebuild_action("gio_querymodules", "lib/gio/modules")
end

#gtk_update_icon_cache ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



602
603
604
605
# File 'install_steps.rb', line 602

def gtk_update_icon_cache
  ::Utils::Output.odeprecated "`gtk_update_icon_cache` in an install steps block", "`update_gtk_icon_cache`"
  add_rebuild_action("gtk_update_icon_cache", "share/icons/hicolor")
end

#if_path_exists(path, base: nil, &block) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



139
140
141
# File 'install_steps.rb', line 139

def if_path_exists(path, base: nil, &block)
  with_guard(path_spec(path, base:, default_base: @default_base).merge("condition" => "if_exists"), &block)
end

#init_data_dir(path, using:, base: nil, locale: nil) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



560
561
562
563
564
565
566
567
568
569
570
571
# File 'install_steps.rb', line 560

def init_data_dir(path, using:, base: nil, locale: nil)
  using = case using.to_s
  when "postgresql" then "postgresql_initdb"
  when "mysql" then "mysql_initialize"
  when "mariadb" then "mariadb_install_db"
  else using.to_s
  end
  add_step("init_data_dir",
           "path"   => path_spec(path, base:, default_base: @default_base),
           "using"  => using,
           "locale" => locale)
end

#inreplace(path, before, after, base: nil, audit_result: true, global: true) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



368
369
370
371
372
373
374
375
376
377
# File 'install_steps.rb', line 368

def inreplace(path, before, after, base: nil, audit_result: true, global: true)
  add_step("inreplace",
           "path"           => path_spec(path, base:, default_base: @default_base),
           "before"         => before.is_a?(::Regexp) ? before.source : before,
           "after"          => after,
           "regexp"         => before.is_a?(::Regexp),
           "regexp_options" => (before.options if before.is_a?(::Regexp)),
           "skip_audit"     => !audit_result,
           "first_only"     => !global)
end

#install_gzipped_executable(source, target, source_base: nil, target_base: nil) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



786
787
788
789
790
# File 'install_steps.rb', line 786

def install_gzipped_executable(source, target, source_base: nil, target_base: nil)
  add_step("install_gzipped_executable",
           "source" => path_spec(source, base: source_base, default_base: @default_source_base),
           "target" => path_spec(target, base: target_base, default_base: @default_target_base))
end

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



490
491
492
493
494
495
496
497
# File 'install_steps.rb', line 490

def link_children(source, target = nil, source_base: nil, target_base: :homebrew_prefix, prefix: "", suffix: "")
  ::Utils::Output.odeprecated "`link_children` in an install steps block", "`symlink_children`"
  add_step("link_children",
           "source" => path_spec(source, base: source_base, default_base: @default_source_base),
           "target" => path_spec(target || source, base: target_base, default_base: @default_target_base),
           "prefix" => prefix,
           "suffix" => suffix)
end

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



459
460
461
462
463
464
# File 'install_steps.rb', line 459

def link_dir(source, target, source_base: nil, target_base: :homebrew_prefix)
  ::Utils::Output.odeprecated "`link_dir` in an install steps block", "`symlink_tree`"
  add_step("link_dir",
           "source" => path_spec(source, base: source_base, default_base: @default_source_base),
           "target" => path_spec(target, base: target_base, default_base: @default_target_base))
end

#ln_s(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil, force: false, uninstall: false) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



426
427
428
429
430
431
# File 'install_steps.rb', line 426

def ln_s(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil,
         force: false, uninstall: false)
  ::Utils::Output.odeprecated "`ln_s` in an install steps block", "`symlink`"
  symlink(source, target, source_base:, target_base:, source_formula:, target_formula:,
          overwrite: force, remove_on_uninstall: uninstall)
end

#ln_sf(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil, uninstall: false) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



444
445
446
447
448
449
# File 'install_steps.rb', line 444

def ln_sf(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil,
          uninstall: false)
  ::Utils::Output.odeprecated "`ln_sf` in an install steps block", "`symlink`"
  symlink(source, target, source_base:, target_base:, source_formula:, target_formula:,
          overwrite: true, remove_on_uninstall: uninstall)
end

#mkdir(path, base: nil) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



235
236
237
238
# File 'install_steps.rb', line 235

def mkdir(path, base: nil)
  ::Utils::Output.odeprecated "`mkdir` in an install steps block", "`mkdir_p`"
  add_step("mkdir", "path" => path_spec(path, base:, default_base: @default_base))
end

#mkdir_p(path, base: nil) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



241
242
243
# File 'install_steps.rb', line 241

def mkdir_p(path, base: nil)
  add_step("mkdir_p", "path" => path_spec(path, base:, default_base: @default_base))
end

#move(source, target, source_base: nil, target_base: nil, force: false, overwrite: true, source_glob: false) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



261
262
263
264
265
266
267
268
269
270
# File 'install_steps.rb', line 261

def move(source, target, source_base: nil, target_base: nil, force: false, overwrite: true, source_glob: false)
  ::Utils::Output.odeprecated "`force:` in `move`", "`overwrite:` in `move`" if force

  add_step("move",
           "source"      => path_spec(source, base: source_base, default_base: @default_source_base),
           "target"      => path_spec(target, base: target_base, default_base: @default_target_base),
           "force"       => force,
           "overwrite"   => overwrite,
           "source_glob" => source_glob)
end

#move_children(source, target, source_base: nil, target_base: nil) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



296
297
298
299
300
301
# File 'install_steps.rb', line 296

def move_children(source, target, source_base: nil, target_base: nil)
  ::Utils::Output.odeprecated "`move_children` in an install steps block", "`move_contents`"
  add_step("move_children",
           "source" => path_spec(source, base: source_base, default_base: @default_source_base),
           "target" => path_spec(target, base: target_base, default_base: @default_target_base))
end

#move_contents(source, target, source_base: nil, target_base: nil) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



311
312
313
314
315
# File 'install_steps.rb', line 311

def move_contents(source, target, source_base: nil, target_base: nil)
  add_step("move_contents",
           "source" => path_spec(source, base: source_base, default_base: @default_source_base),
           "target" => path_spec(target, base: target_base, default_base: @default_target_base))
end

#mv(source, target, source_base: nil, target_base: nil, force: false, overwrite: true, source_glob: false) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



283
284
285
286
# File 'install_steps.rb', line 283

def mv(source, target, source_base: nil, target_base: nil, force: false, overwrite: true, source_glob: false)
  ::Utils::Output.odeprecated "`mv` in an install steps block", "`move`"
  move(source, target, source_base:, target_base:, overwrite: overwrite || force, source_glob:)
end

#name ⇒ String

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



93
94
95
96
# File 'install_steps.rb', line 93

def name
  ::Utils::Output.odeprecated "`name` in an install steps block", "`formula_name`"
  "{{name}}"
end

#on_linux(&block) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:

  • block (::T.proc.void)


160
161
162
# File 'install_steps.rb', line 160

def on_linux(&block)
  with_guard({ "condition" => "on", "value" => "linux" }, &block)
end

#on_macos(&block) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:

  • block (::T.proc.void)


155
156
157
# File 'install_steps.rb', line 155

def on_macos(&block)
  with_guard({ "condition" => "on", "value" => "macos" }, &block)
end

#remove(paths, base: nil, recursive: false, sudo: false, symlink_target_contains: nil, content_contains: nil) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:

  • paths (Paths)
  • base (::T.nilable(::T.any(::String, ::Symbol))) (defaults to: nil)
  • recursive (::T::Boolean) (defaults to: false)
  • sudo (::T.any(::T::Boolean, ::Symbol)) (defaults to: false)
  • symlink_target_contains (::T.nilable(::String)) (defaults to: nil)
  • content_contains (::T.nilable(::String)) (defaults to: nil)


348
349
350
351
352
353
354
355
356
# File 'install_steps.rb', line 348

def remove(paths, base: nil, recursive: false, sudo: false, symlink_target_contains: nil,
           content_contains: nil)
  add_step("remove",
           "paths"                   => path_specs(paths, base:, default_base: @default_base),
           "recursive"               => recursive,
           "sudo"                    => sudo.is_a?(::Symbol) ? sudo.to_s : sudo,
           "symlink_target_contains" => symlink_target_contains,
           "content_contains"        => content_contains)
end

#run(command, args: [], base: nil, env: {}, sudo: false, must_succeed: true, print_stdout: false, print_stderr: true, stdin_path: nil, stdout_path: nil, chdir: nil, writable_paths: [], writable_base: nil, network_access: false) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
# File 'install_steps.rb', line 716

def run(command, args: [], base: nil, env: {}, sudo: false, must_succeed: true, print_stdout: false,
        print_stderr: true, stdin_path: nil, stdout_path: nil, chdir: nil, writable_paths: [],
        writable_base: nil, network_access: false)
  add_step("run",
           "command"         => path_spec(command, base:, default_base: nil),
           "args"            => args.map(&:to_s),
           "env"             => env,
           "sudo"            => sudo,
           "allow_failure"   => !must_succeed,
           "print_stdout"    => print_stdout,
           "suppress_stderr" => !print_stderr,
           "stdin_path"      => optional_path_spec(stdin_path, default_base: @default_base),
           "stdout_path"     => optional_path_spec(stdout_path, default_base: @default_base),
           "chdir"           => optional_path_spec(chdir, default_base: @default_base),
           "writable_paths"  => path_specs(
             writable_paths,
             base:         writable_base,
             default_base: @default_base,
           ),
           "network_access"  => network_access)
end

#set_ownership(paths, user: nil, group: "staff", base: nil, recursive: true) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



675
676
677
678
679
680
681
# File 'install_steps.rb', line 675

def set_ownership(paths, user: nil, group: "staff", base: nil, recursive: true)
  add_step("set_ownership",
           "paths"         => path_specs(paths, base:, default_base: @default_base),
           "user"          => user,
           "group"         => (group if group != "staff"),
           "non_recursive" => !recursive)
end

#set_permissions(paths, permissions, base: nil, recursive: true) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



659
660
661
662
663
664
# File 'install_steps.rb', line 659

def set_permissions(paths, permissions, base: nil, recursive: true)
  add_step("set_permissions",
           "paths"         => path_specs(paths, base:, default_base: @default_base),
           "permissions"   => permissions,
           "non_recursive" => !recursive)
end

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:

  • source (::T.any(::String, ::Pathname))
  • target (::T.any(::String, ::Pathname))
  • source_base (::T.nilable(::T.any(::String, ::Symbol))) (defaults to: nil)
  • target_base (::T.nilable(::T.any(::String, ::Symbol))) (defaults to: nil)
  • source_formula (::T.nilable(::String)) (defaults to: nil)
  • target_formula (::T.nilable(::String)) (defaults to: nil)
  • force (::T::Boolean) (defaults to: false)
  • uninstall (::T::Boolean) (defaults to: false)
  • overwrite (::T::Boolean) (defaults to: false)
  • remove_on_uninstall (::T::Boolean) (defaults to: false)
  • source_glob (::T::Boolean) (defaults to: false)
  • sudo (::T.any(::T::Boolean, ::Symbol)) (defaults to: false)


395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'install_steps.rb', line 395

def symlink(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil,
            force: false, uninstall: false, overwrite: false, remove_on_uninstall: false,
            source_glob: false, sudo: false)
  ::Utils::Output.odeprecated "`force:` in `symlink`", "`overwrite:` in `symlink`" if force
  if uninstall
    ::Utils::Output.odeprecated "`uninstall:` in `symlink`", "`remove_on_uninstall:` in `symlink`"
  end

  add_step("symlink",
           "source"      => path_spec(source, base: source_base, formula: source_formula,
                              default_base: @default_source_base),
           "target"      => path_spec(target, base: target_base, formula: target_formula,
                              default_base: @default_target_base),
           "force"       => (true if force || overwrite),
           "uninstall"   => (true if uninstall || remove_on_uninstall),
           "source_glob" => source_glob,
           "sudo"        => sudo.is_a?(::Symbol) ? sudo.to_s : sudo)
end

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



509
510
511
512
513
514
515
516
# File 'install_steps.rb', line 509

def symlink_children(source, target = nil, source_base: nil, target_base: :homebrew_prefix, prefix: "",
                     suffix: "")
  add_step("link_children",
           "source" => path_spec(source, base: source_base, default_base: @default_source_base),
           "target" => path_spec(target || source, base: target_base, default_base: @default_target_base),
           "prefix" => prefix,
           "suffix" => suffix)
end

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



474
475
476
477
478
# File 'install_steps.rb', line 474

def symlink_tree(source, target, source_base: nil, target_base: :homebrew_prefix)
  add_step("link_dir",
           "source" => path_spec(source, base: source_base, default_base: @default_source_base),
           "target" => path_spec(target, base: target_base, default_base: @default_target_base))
end

#terminate_process(name, match: :name, sudo: false, attempts: 1, must_succeed: false, notices: [], failure_message: nil) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:

  • name (::String)
  • match (::T.any(::String, ::Symbol)) (defaults to: :name)
  • sudo (::T::Boolean) (defaults to: false)
  • attempts (::Integer) (defaults to: 1)
  • must_succeed (::T::Boolean) (defaults to: false)
  • notices (::T::Array[::String]) (defaults to: [])
  • failure_message (::T.nilable(::String)) (defaults to: nil)


749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
# File 'install_steps.rb', line 749

def terminate_process(name, match: :name, sudo: false, attempts: 1, must_succeed: false,
                      notices: [], failure_message: nil)
  ::Kernel.raise ::ArgumentError, "terminate_process attempts must be positive" if attempts < 1

  match = match.to_s
  unless %w[name full].include?(match)
    ::Kernel.raise ::ArgumentError, "terminate_process match must be :name or :full"
  end

  add_step("terminate_process",
           "name"            => name,
           "match"           => (match if match != "name"),
           "sudo"            => sudo,
           "attempts"        => (attempts if attempts != 1),
           "must_succeed"    => must_succeed,
           "notices"         => notices,
           "failure_message" => failure_message)
end

#token ⇒ String

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



104
105
106
# File 'install_steps.rb', line 104

def token
  "{{token}}"
end

#touch(path, base: nil) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



246
247
248
# File 'install_steps.rb', line 246

def touch(path, base: nil)
  add_step("touch", "path" => path_spec(path, base:, default_base: @default_base))
end

#unless_path_exists(path, base: nil, &block) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



150
151
152
# File 'install_steps.rb', line 150

def unless_path_exists(path, base: nil, &block)
  with_guard(path_spec(path, base:, default_base: @default_base).merge("condition" => "unless_exists"), &block)
end

#update_desktop_database ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



618
619
620
# File 'install_steps.rb', line 618

def update_desktop_database
  add_rebuild_action("update_desktop_database", "share/applications")
end

#update_gdk_pixbuf_loaders_cache ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



597
598
599
# File 'install_steps.rb', line 597

def update_gdk_pixbuf_loaders_cache
  add_step("gdk_pixbuf_query_loaders")
end

#update_gio_modules_cache ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



585
586
587
# File 'install_steps.rb', line 585

def update_gio_modules_cache
  add_rebuild_action("gio_querymodules", "lib/gio/modules")
end

#update_gtk_icon_cache ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



608
609
610
# File 'install_steps.rb', line 608

def update_gtk_icon_cache
  add_rebuild_action("gtk_update_icon_cache", "share/icons/hicolor")
end

#update_mime_database ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



613
614
615
# File 'install_steps.rb', line 613

def update_mime_database
  add_rebuild_action("update_mime_database", "share/mime")
end

#version ⇒ TemplateVersion

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (TemplateVersion)


114
115
116
# File 'install_steps.rb', line 114

def version
  TEMPLATE_VERSION
end

#warn(message) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



769
770
771
# File 'install_steps.rb', line 769

def warn(message)
  add_step("warn", "message" => message)
end

#write(path, content, base: nil, overwrite: false) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



526
527
528
529
530
531
532
533
# File 'install_steps.rb', line 526

def write(path, content, base: nil, overwrite: false)
  ::Utils::Output.odeprecated "`write` in an install steps block", "`write_file`"
  content = "#{content}\n" unless content.end_with?("\n")
  add_step("write",
           "path"      => path_spec(path, base:, default_base: @default_base),
           "content"   => content,
           "overwrite" => (true if overwrite))
end

#write_file(path, content, base: nil, overwrite: true, append_newline: false) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



544
545
546
547
548
549
550
# File 'install_steps.rb', line 544

def write_file(path, content, base: nil, overwrite: true, append_newline: false)
  content = "#{content}\n" if append_newline && !content.end_with?("\n")
  add_step("write",
           "path"      => path_spec(path, base:, default_base: @default_base),
           "content"   => content,
           "overwrite" => (true if overwrite))
end