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:



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

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

#stepsSteps (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:



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

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:



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

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:



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

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

#archString

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:



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

def arch
  "{{arch}}"
end

#bootstrap_cpythonvoid

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.



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

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:



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

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:



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

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_schemasvoid

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.



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

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

#configure_clang_systemvoid

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.



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

def configure_clang_system
  add_step("configure_clang_system")
end

#configure_gcc_runtimevoid

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.



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

def configure_gcc_runtime
  add_step("configure_gcc_runtime")
end

#configure_glibc_runtimevoid

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.



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

def configure_glibc_runtime
  add_step("configure_glibc_runtime")
end

#configure_phpvoid

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.



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

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:



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

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:



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

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:



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

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_nameString

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:



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

def formula_name
  "{{formula_name}}"
end

#gdk_pixbuf_query_loadersvoid

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.



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

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_querymodulesvoid

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.



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

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_cachevoid

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.



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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

#nameString

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:



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

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)


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

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)


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

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)


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

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:



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

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:



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

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:



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

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)


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

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:



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

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:



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

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)


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

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

#tokenString

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:



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

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:



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

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:



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

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_databasevoid

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.



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

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

#update_gdk_pixbuf_loaders_cachevoid

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.



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

def update_gdk_pixbuf_loaders_cache
  add_step("gdk_pixbuf_query_loaders")
end

#update_gio_modules_cachevoid

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.



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

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

#update_gtk_icon_cachevoid

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.



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

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

#update_mime_databasevoid

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.



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

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

#versionTemplateVersion

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)


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

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:



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

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:



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

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:



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

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