Claudia d026cb91e7
Fix cask loading after adding an artifact type
This commit fixes an issue where we added a new global artifact
and then updated a cask to make use of that new artifact.
This caused a number of `brew cask` commands to fail for users
who had the cask installed before the artifact was added.

When loading the definition of an installed cask, we configure it
using a snapshot from install time, e. g. `/usr/local/Caskroom/markdownmdimporter/.metadata/config.json`.

The snapshot looks like this:

```
{
  "default": {
    "appdir": "/Applications",
    "prefpanedir": "/Users/claudia/Library/PreferencePanes",
    "qlplugindir": "/Users/claudia/Library/QuickLook",
    "dictionarydir": "/Users/claudia/Library/Dictionaries",
    "fontdir": "/Users/claudia/Library/Fonts",
    "colorpickerdir": "/Users/claudia/Library/ColorPickers",
    "servicedir": "/Users/claudia/Library/Services",
    "input_methoddir": "/Users/claudia/Library/Input Methods",
    "internet_plugindir": "/Users/claudia/Library/Internet Plug-Ins",
    "audio_unit_plugindir": "/Users/claudia/Library/Audio/Plug-Ins/Components",
    "vst_plugindir": "/Users/claudia/Library/Audio/Plug-Ins/VST",
    "vst3_plugindir": "/Users/claudia/Library/Audio/Plug-Ins/VST3",
    "screen_saverdir": "/Users/claudia/Library/Screen Savers"
  },
  "env": {},
  "explicit": {}
}
```

Note that there is no `mdimporterdir` because the cask was installed
before the artifact was added.

The root cause is that the cask loading code still expects the snapshot
to contain directory configuration for all artifact types.
Since the snapshot never learned about the new artifact type, cask
loading would fail.

The fix applied in this commit is to fall back to the global default
whenever the `default` directory map of a configuration snapshot is
incomplete.

See also:
- https://github.com/Homebrew/brew/pull/7286#issuecomment-613376568
- https://discourse.brew.sh/t/cask-definition-is-invalid-invalid-mdimporter-stanza-key-not-found-mdimporterdir
2020-04-21 18:29:14 +02:00
..
2020-04-20 16:45:43 +01:00
2020-04-20 16:45:43 +01:00
2020-04-07 09:58:26 +01:00
2020-04-16 11:22:40 +01:00
2020-03-13 21:16:18 +00:00
2020-04-21 18:26:51 +02:00
2020-04-15 10:41:46 +01:00
2020-04-21 14:36:01 +01:00
2020-04-07 09:58:26 +01:00
2020-04-07 09:58:26 +01:00
2020-04-07 09:58:26 +01:00
2020-04-20 16:45:43 +01:00
2020-04-15 15:14:13 +02:00
2020-04-07 09:58:26 +01:00
2020-04-20 10:27:14 +01:00
2020-04-07 09:58:26 +01:00
2020-04-07 09:58:26 +01:00
2020-03-13 21:16:18 +00:00
2020-03-15 18:32:21 +05:30
2020-04-18 15:44:24 +01:00
2020-04-07 09:58:26 +01:00
2020-04-07 09:58:26 +01:00
2020-04-13 16:01:26 +01:00
2020-04-07 09:58:26 +01:00
2020-03-13 21:16:18 +00:00
2020-04-07 09:58:26 +01:00
2020-02-28 14:57:28 -05:00

Homebrew's Formula API

This is the public API for Homebrew.

The main class you should look at is the {Formula} class (and classes linked from there). That's the class that's used to create Homebrew formulae (i.e. package descriptions). Assume anything else you stumble upon is private.

You may also find the Formula Cookbook and Ruby Style Guide helpful in creating formulae.

Good luck!