Class: Homebrew::InstallSteps::DSL Private
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
- #steps ⇒ Steps readonly private
Class Method Summary collapse
- .build(default_base: nil, default_source_base: nil, default_target_base: nil, &block) ⇒ Steps private
- .normalise_steps(steps) ⇒ Steps private
Instance Method Summary collapse
- #arch ⇒ String private
- #bootstrap_cpython ⇒ void private
- #bootstrap_pypy(abi_version:) ⇒ void private
- #change_dylib_id(source, id, base: nil, resolve_source: false) ⇒ void private
- #compile_gsettings_schemas ⇒ void private
- #configure_clang_system ⇒ void private
- #configure_gcc_runtime ⇒ void private
- #configure_glibc_runtime ⇒ void private
- #configure_php ⇒ void private
- #copy(source, target, source_base: nil, target_base: nil, recursive: false, overwrite: true, source_glob: false) ⇒ void private
- #delete_keychain_certificate(name, matching_certificate: nil, base: nil) ⇒ void private
- #delete_keychain_certificates(name, fingerprint_of: nil, base: nil) ⇒ void private
- #formula_name ⇒ String private
- #gdk_pixbuf_query_loaders ⇒ void private
- #gio_querymodules ⇒ void private
- #gtk_update_icon_cache ⇒ void private
- #if_path_exists(path, base: nil, &block) ⇒ void private
- #init_data_dir(path, using:, base: nil, locale: nil) ⇒ void private
- #initialize(default_base: nil, default_source_base: nil, default_target_base: nil) ⇒ void constructor private
- #inreplace(path, before, after, base: nil, audit_result: true, global: true) ⇒ void private
- #install_gzipped_executable(source, target, source_base: nil, target_base: nil) ⇒ void private
- #link_children(source, target = nil, source_base: nil, target_base: :homebrew_prefix, prefix: "", suffix: "") ⇒ void private
- #link_dir(source, target, source_base: nil, target_base: :homebrew_prefix) ⇒ void private
- #ln_s(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil, force: false, uninstall: false) ⇒ void private
- #ln_sf(source, target, source_base: nil, target_base: nil, source_formula: nil, target_formula: nil, uninstall: false) ⇒ void private
- #mkdir(path, base: nil) ⇒ void private
- #mkdir_p(path, base: nil) ⇒ void private
- #move(source, target, source_base: nil, target_base: nil, force: false, overwrite: true, source_glob: false) ⇒ void private
- #move_children(source, target, source_base: nil, target_base: nil) ⇒ void private
- #move_contents(source, target, source_base: nil, target_base: nil) ⇒ void private
- #mv(source, target, source_base: nil, target_base: nil, force: false, overwrite: true, source_glob: false) ⇒ void private
- #name ⇒ String private
- #on_linux(&block) ⇒ void private
- #on_macos(&block) ⇒ void private
- #remove(paths, base: nil, recursive: false, sudo: false, symlink_target_contains: nil, content_contains: nil) ⇒ void private
- #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 private
- #set_ownership(paths, user: nil, group: "staff", base: nil, recursive: true) ⇒ void private
- #set_permissions(paths, permissions, base: nil, recursive: true) ⇒ void private
- #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) ⇒ void private
- #symlink_children(source, target = nil, source_base: nil, target_base: :homebrew_prefix, prefix: "", suffix: "") ⇒ void private
- #symlink_tree(source, target, source_base: nil, target_base: :homebrew_prefix) ⇒ void private
- #terminate_process(name, match: :name, sudo: false, attempts: 1, must_succeed: false, notices: [], failure_message: nil) ⇒ void private
- #token ⇒ String private
- #touch(path, base: nil) ⇒ void private
- #unless_path_exists(path, base: nil, &block) ⇒ void private
- #update_desktop_database ⇒ void private
- #update_gdk_pixbuf_loaders_cache ⇒ void private
- #update_gio_modules_cache ⇒ void private
- #update_gtk_icon_cache ⇒ void private
- #update_mime_database ⇒ void private
- #version ⇒ TemplateVersion private
- #warn(message) ⇒ void private
- #write(path, content, base: nil, overwrite: false) ⇒ void private
- #write_file(path, content, base: nil, overwrite: true, append_newline: false) ⇒ void private
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.
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
#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.
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.
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.
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
#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.
108 109 110 |
# File 'install_steps.rb', line 108 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.
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.
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.
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_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.
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_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.
797 798 799 |
# File 'install_steps.rb', line 797 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.
773 774 775 |
# File 'install_steps.rb', line 773 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.
792 793 794 |
# File 'install_steps.rb', line 792 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.
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.
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.
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.
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_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.
98 99 100 |
# File 'install_steps.rb', line 98 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.
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_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.
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_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.
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.
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.
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.
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. 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.
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 |
#link_children(source, target = nil, source_base: nil, target_base: :homebrew_prefix, prefix: "", suffix: "") ⇒ 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.
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 |
#link_dir(source, target, source_base: nil, target_base: :homebrew_prefix) ⇒ 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.
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.
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.
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.
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.
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.
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.
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.
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.
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 |
#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.
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.
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.
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.
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.
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.
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.
658 659 660 661 662 663 |
# File 'install_steps.rb', line 658 def (paths, , base: nil, recursive: true) add_step("set_permissions", "paths" => path_specs(paths, base:, default_base: @default_base), "permissions" => , "non_recursive" => !recursive) end |
#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) ⇒ 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.
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 |
#symlink_children(source, target = nil, source_base: nil, target_base: :homebrew_prefix, prefix: "", suffix: "") ⇒ 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.
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 |
#symlink_tree(source, target, source_base: nil, target_base: :homebrew_prefix) ⇒ 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.
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.
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" => ) 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.
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.
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.
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_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.
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_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.
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_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.
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_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.
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_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.
612 613 614 |
# File 'install_steps.rb', line 612 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.
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.
768 769 770 |
# File 'install_steps.rb', line 768 def warn() add_step("warn", "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.
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.
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 |