302 Commits

Author SHA1 Message Date
Chris Araman
caf310038f
linkage: display executables with missing rpath
An executable that links against @rpath-prefixed dylibs must include at least
one runtime path. This will prevent issues like the one resolved in #91485.

Caveats:
1. This won't find executables that have only recursive dylib dependencies with
   @rpath prefixes.
2. This makes no attempt to resolve @rpath, @executable_path or @loader_path
   dylibs, or to verify the correctness of any LC_RPATH entries, or to
   otherwise simulate dlopen logic.
3. Weakly-linked dylibs are still excluded from the search for broken linkage.

The scope is narrow in order to focus on this particular problem. It is meant
only as a sanity check.
2021-12-20 13:44:35 -08:00
Alexander Bayandin
fe9a039774
unpack_strategy: add zstd 2021-09-20 14:12:30 +01:00
Mike McQuaid
714bfee81f
extend/pathname: handle missing permissions on removal.
Fixes #11783
2021-07-28 15:40:23 +01:00
Misty De Meo
c0a02442d9
Revert "language/java: use shortened brew paths"
This reverts commits 318175cfe2b23328f1b5f13812fd59cfd45fe1dc,
e7ab760392b9691a6c730b7e0d660b7874969e70 and
3b35af63f608438b1882756feca94a6ebdd0d6a3 (PR #11537).
2021-06-17 20:29:43 -07:00
Caleb Xu
e7ab760392
extend/pathname: use shortened brew paths 2021-06-15 09:58:46 -04:00
Bo Anderson
f174d4363f
extend/pathname: limit write override to a refinement 2021-05-04 14:20:20 +01:00
Markus Reiter
b6ed8915e5
Add compatibility layer for AbstractDownloadStrategy#fetch. 2021-04-03 20:10:33 +02:00
Mike McQuaid
d8a2cf9efc
Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
  and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
  local bottle file.
2021-03-31 09:43:37 +01:00
Kenneth Chew
9d6bfa5965
pathname: do not install empty metafiles 2021-03-27 13:34:50 -04:00
EricFromCanada
a427de5bee capitalization fixes
"curl" is the binary, while "cURL" is the umbrella project.
2021-01-26 15:36:44 -05:00
Seeker
fbafaff4fe rubocop: require braces for Sorbet sig 2021-01-18 16:52:45 -08:00
Seeker
b9854bd4cf rubocops: add unless_multiple_conditions 2021-01-08 10:33:54 -08:00
Michka Popoff
5e91802470 checksum: simplify, use only sha256
We use only one sha type right now.

Needed for https://github.com/Homebrew/brew/pull/10186
2021-01-07 20:46:13 +01:00
Mike McQuaid
9216d8abe6
rubocop-rails: make fixes. 2020-12-02 10:43:04 +00:00
Markus Reiter
580d915cb4 Add type signatures for Pathname extensions. 2020-11-29 21:23:55 +01:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
EricFromCanada
3768b7a6e9 apidoc: update comment wording, punctuation, formatting 2020-11-06 00:21:02 -05:00
EricFromCanada
dddfbf80fc apidoc: add/update yard tags 2020-11-06 00:16:35 -05:00
EricFromCanada
d293431b87 apidoc: update URLs 2020-11-05 23:50:55 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
490e503b1b Replace Homebrew.args with Context. 2020-08-06 16:13:14 +02:00
Caleb Xu
7f158df842 extend/pathname: use absolute path to java in write_jar_script 2020-07-31 20:26:11 -04:00
Bo Anderson
cd0c3fa835 extend/pathname: use Java.overridable_java_home_env in write_jar_script 2020-06-19 12:04:30 +01:00
Bo Anderson
c244e992af extend/pathname: add args argument to write_env_script 2020-06-19 12:04:26 +01:00
Alexander Bayandin
4d27c32d44 Revert "Merge pull request #7722 from Bo98/java-improvements"
This reverts commit 91b4d450703bcc2de6dce22eb5fdecb5a843f92e, reversing
changes made to c98901132595178b6261cbe2d51ab732dd77dac4.
2020-06-18 12:23:02 +01:00
Bo Anderson
07547e8cae extend/pathname: use Java.overridable_java_home_env in write_jar_script 2020-06-10 17:08:41 +01:00
Mike McQuaid
aa81982aba
brew style --fix 2020-06-02 09:49:23 +01:00
Mike McQuaid
4f75a77b08
Update deprecations
Add more deprecations, disable deprecations and remove disabled code.
2020-05-18 13:50:46 +01:00
Gautham Goli
acde828a45 ARGV: Replace ARGV.verbose? with Homebrew.args.verbose? 2020-02-02 14:00:04 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
86f43f79ee
Enable/fix optional Ruby frozen string literal usage
Combined with https://github.com/Homebrew/homebrew-test-bot/pull/247
this will test Homebrew's use of frozen strings in CI. After this we
will then enable it for Homebrew developers and eventually all Homebrew
users.
2019-04-19 10:30:41 +09:00
Mike McQuaid
356f72dcc6
Merge pull request #6012 from amyspark/hotpatch-fix-atomic_write
atomic_write: repair permissions after writing
2019-04-14 10:02:15 +01:00
EricFromCanada
89f0fcedbe whitespace fixes 2019-04-13 21:32:04 -04:00
L. E. Segovia
f9fcdec795
pathname.rb: style fixes 2019-04-13 17:18:14 +00:00
L. E. Segovia
f706fffc6c
atomic_write: repair permissions after writing
This restores the original file uid, gid and permissions separately.
(ActiveSupport does it in a single step - atomically. This is not
useful in our use case because it may lead to ACL changes.)

Fixes #5916
2019-04-12 18:46:57 +00:00
Shaun Jackman
5cb458d687 install_symlink_p: Fix when dest includes a symlink
install_symlink_p does not work as intended when dst includes a symlink in its path.
relative_path_from requires that both src and dst be real paths without symlinks.

From https://ruby-doc.org/stdlib-2.3.7/libdoc/pathname/rdoc/Pathname.html#method-i-relative_path_from
This method doesn't access the filesystem. It assumes no symlinks.
2019-03-16 23:11:59 -07:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00:00
Markus Reiter
bcf8cfc97c Remove atomic_write workaround. 2018-12-05 02:09:20 +01:00
Shaun Jackman
e8b22690a0 Fix Language::Java::java_home_env for Linux
/usr/libexec/java_home is specific to macOS.
Language::Java::java_home_cmd is not implemented on Linux and raises
NotImplementedError.

Add private Language::Java::java_home_shell and use it instead of java_home_cmd.
Add public Language::Java::java_home for use by formulae.
2018-11-29 12:50:31 -08:00
Mike McQuaid
737b84b54b
brew style --fix fixes. 2018-11-02 17:29:23 +00:00
Chongyu Zhu
98016b0ac6
pathname: atomic_write shouldn't make dir sticky unless world writable 2018-10-21 08:58:20 +08:00
EricFromCanada
20167e5f1b Adjust comments to tidy API docs output. 2018-10-18 21:42:43 -04:00
Markus Reiter
071108b868 Fix atomic_write inside non-sticky directory. 2018-10-02 15:58:34 +02:00
Markus Reiter
c430baaee8 Don’t treat .7z as part of a version. 2018-09-29 10:32:18 +02:00
Mike McQuaid
ead23d1f4c
Use ActiveSupport File.atomic_write
nd delete our own implementation.
2018-09-18 09:20:40 +01:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Markus Reiter
fbcaa8c85a Resolve URL to get real file extension. 2018-08-31 16:51:23 +02:00
Markus Reiter
8b5fa6824b Fix brew cleanup. 2018-08-11 18:03:49 +02:00
ilovezfs
3e298bbbc8
Revert "Explicitly chmod exec script files" 2018-07-18 09:45:05 +00:00
Mike McQuaid
87ba4c52ec
Merge pull request #4470 from apjanke/chmods-for-exec-scripts
Explicitly chmod exec script files
2018-07-17 17:18:02 +01:00