273 Commits

Author SHA1 Message Date
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
Mike McQuaid
5c6ef3d920 Disable more deprecations.
- Turn more old `odeprecated` into `odisabled`
- Remove more old `odisabled`
- Remove code for older Ruby versions
2018-07-14 16:00:50 +01:00
Andrew Janke
3598652116 Explicitly chmod exec script files 2018-07-14 02:15:18 -04:00
Markus Reiter
5b3bbb76c9 Separate staging from download. 2018-07-12 10:39:27 +02:00
Markus Reiter
7762ce32aa Use more descriptive heredoc names. 2018-07-11 18:15:30 +02:00
Markus Reiter
fcf8cb24fd Remove unused incremental_hash method. 2018-07-06 23:14:34 +02:00
Mike McQuaid
8035afcc36 linkage_checker: fix generic pathname calls. 2018-04-25 12:08:33 +01:00
Mike McQuaid
cffa5a9864 Disable/delete/add more deprecations
Move various `odeprecated` to `odisabled` and delete uses of
`odisabled`.
2018-04-08 14:57:17 -07:00
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Andrew Janke
49972e5905 write_jar_script: add java version option 2018-02-11 14:47:51 -05:00
ilovezfs
2e1ec02aeb pathname: fix rmdir_if_possible with mount points
Attempting to rmdir a directory that is a mount point results in EBUSY,
not EACCES or ENOENT, so also rescue EBUSY in rmdir_if_possible.
2018-01-19 14:06:22 -08:00
Shaun Jackman
841dae4b8c pathname: Use CI env variable rather than TRAVIS 2018-01-03 13:17:23 -08:00
Shaun Jackman
d79c5ade1a Implement linkage for Linux 2017-12-03 16:22:51 -08:00
Mike McQuaid
fb6cf0c3f8 More environment filtering fixes
- Make `brew pull` pass through Git environment variables
- Whitelist all `TRAVIS_` variables.
2017-11-27 10:48:03 +00:00
Mike McQuaid
5241d07474 environment filtering: pass through TRAVIS vars.
We use these internally so let's map them to `HOMEBREW_` variables.
2017-11-13 10:01:54 +00:00
Maxim Belkin
de0b93f912
pathname: improvements, cleanups, and new methods
- atomic_write: close file before renaming to prevent error:
  'Device or resource busy'
- ensure_writable: preserve executable bit
- new elf? and dynamic? methods
2017-11-07 14:18:25 -06:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Viktor Szakats
b44c7a1022 upgrade more urls to https 2017-08-22 10:31:21 +00:00
Markus Reiter
2d6ae61314 Re-revert "Fix operator spacing." 2017-06-02 19:22:05 +02:00
ilovezfs
197392b56d Revert "Fix operator spacing." 2017-06-01 04:06:40 -07:00
Markus Reiter
d34ba7395b Fix operator spacing. 2017-05-31 19:53:41 +02:00
Misty De Meo
a40291ee4a
Pathname: use Digest::SHA256 alias
Digest::SHA2 wasn't exposed under that name in older versions of Ruby.
2017-05-30 18:30:16 -07:00
Mike McQuaid
45a7730f61 Fix and remove various TODOs.
Fix those that can be done so without tearing Homebrew to pieces and
remove the comments for those that can never be done.
2017-04-23 15:10:18 +01:00
Mike McQuaid
ba3c46d24f More deprecations.
Deprecate more methods. Internal APIs have been verified to be unused
elsewhere and removed. External APIs have had deprecation methods added.
Existing deprecations have been either upgraded to produce warnings or
no longer deprecated and the reasoning documented.
2017-04-22 16:28:07 +01:00
Naoto Kaneko
928eaca267 Merge branch 'master' into exclude-executable-metafiles
Added tests in keg_test and pathname_test was
moved into keg_spec and pathname_spec.
2017-02-27 14:23:53 +09:00
Naoto Kaneko
56a0afe579 Extend #ds_file? in Pathname 2017-02-24 17:44:18 +09:00
Markus Reiter
9dda84ad6b Add integration test helper methods. 2017-02-23 09:23:22 +01:00
Mike McQuaid
6c2b614a04 pathname: make compute_disk_usage handle symlinks. 2017-01-06 08:50:20 +00:00
Markus Reiter
59e2d67721 No if/unless-modifier on multiline blocks. 2016-11-13 23:37:40 +01:00