Spec-Zone.ru › Homebrew

Класс: Cleaner Закрытый

Наследует:
Object
  • Object
  • Cleaner
показать всё
Включает:
Context, OS::Linux::Cleaner, OS::Mac::Cleaner, Utils::Output::Mixin
Определён в:
cleaner.rb

Обзор

Этот класс является частью закрытого API. Этот класс можно использовать только в репозитории Homebrew/brew. Третьим сторонам следует по возможности избегать использования этого класса, поскольку он может быть удалён или изменён без предупреждения.

Очищает недавно установленный keg. По умолчанию:

  • удаляет файлы .la
  • удаляет файлы .tbd
  • удаляет файлы perllocal.pod
  • удаляет файлы .packlist
  • удаляет пустые каталоги
  • устанавливает разрешения для исполняемых файлов
  • удаляет неразрешённые символические ссылки

Краткое описание методов экземпляра свернуть

  • #clean ⇒ void закрытый

    Очищает keg формулы.

  • #initialize(formula) ⇒ void конструктор закрытый

    Создаёт очиститель для указанной формулы.

Методы, включённые из Utils::Output::Mixin

#issue_reporting_message, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #opoo_without_github_actions_annotation, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_install_status, #pretty_installed, #pretty_uninstalled, #pretty_upgradable, #pretty_warning

Методы, включённые из Context

current, current=, #debug?, #quiet?, #verbose?, #with_context

Подробное описание конструкторов

#initialize(formula) ⇒ void

Этот метод является частью закрытого API. Этот метод можно использовать только в репозитории Homebrew/brew. Третьим сторонам следует по возможности избегать использования этого метода, поскольку он может быть удалён или изменён без предупреждения.

Создаёт очиститель для указанной формулы.

Параметры:

  • formula (Formula)


22
23
24
# File 'cleaner.rb', line 22

def initialize(formula)
  @formula = formula
end

Подробное описание методов экземпляра

#clean ⇒ void

Этот метод является частью закрытого API. Этот метод можно использовать только в репозитории Homebrew/brew. Третьим сторонам следует по возможности избегать использования этого метода, поскольку он может быть удалён или изменён без предупреждения.

Этот метод возвращает неопределённое значение.

Очищает keg формулы.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'cleaner.rb', line 28

def clean
  ObserverPathnameExtension.reset_counts!

  # Many formulae include `lib/charset.alias`, but it is not strictly needed
  # and will conflict if more than one formula provides it.
  observe_file_removal @formula.lib/"charset.alias"

  [@formula.bin, @formula.sbin, @formula.lib].each { |dir| clean_dir(dir) if dir.exist? }

  # Get rid of any info `dir` files, so they don't conflict at the link stage.
  #
  # The `dir` files come in at least 3 locations:
  #
  # 1. `info/dir`
  # 2. `info/#{name}/dir`
  # 3. `info/#{arch}/dir`
  #
  # Of these 3 only `info/#{name}/dir` is safe to keep since the rest will
  # conflict with other formulae because they use a shared location.
  #
  # See
  # [cleaner: recursively delete info `dir`s][1],
  # [emacs 28.1 bottle does not contain `dir` file][2] and
  # [Keep `info/#{f.name}/dir` files in cleaner][3]
  # for more info.
  #
  # [1]: https://github.com/Homebrew/brew/pull/11597
  # [2]: https://github.com/Homebrew/homebrew-core/issues/100190
  # [3]: https://github.com/Homebrew/brew/pull/13215
  @formula.info.glob("**/dir").each do |info_dir_file|
    next unless info_dir_file.file?
    next if info_dir_file == @formula.info/@formula.name/"dir"
    next if @formula.skip_clean?(info_dir_file)

    observe_file_removal info_dir_file
  end

  rewrite_shebangs
  clean_python_metadata

  prune
end

© 2009–present Homebrew contributors
Licensed under the BSD 2-Clause License.
https://docs.brew.sh/rubydoc/Cleaner.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API