291 Commits

Author SHA1 Message Date
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Ruiyang Wu
73a1380055 dev-cmd/bottle: Refactor setup_tar_and_args! to extend/os 2023-04-11 11:00:47 -04:00
Ruiyang Wu
d7427ab762 Don't save mac metadata/extended attributes for brew bottle
This commit includes `--no-mac-metadata` `--no-acls` and `--no-xattrs`
in `default_tar_args` for `brew bottle` command.

Although `default_tar_args` is only active when `--only-json-tab` is
not passed, in which case we don't require reproducible bottles, it is
nonetheless beneficial to "regularize" tarball creation. In
particular, this resolves a sporadic `brew tests
--only=dev-cmd/bottle:20` failure (see
https://github.com/orgs/Homebrew/discussions/4376 and
https://github.com/Homebrew/brew/pull/14997).

Furthermore, with `gnu tar`, `--no-acls` and `--no-xattrs` are default
flags. As for "mac metadata", although I couldn't find official
documentation, this post (https://superuser.com/a/61188) shares some
info:
- Resource forks (resource forks have been extended attributes since 10.4)
  - Custom icons set in Finder and the images of Icon\r files
  - Metadata in PSD files
  - Objects stored in scpt files, AppleScript Editor window state, descriptions of scripts
- Information about aliases (aliases stop working if extended attributes are removed)
- Quarantine status or source URLs of files downloaded from the internet
- Spotlight comments
- Encoding of files saved with TextEdit
- Caret position of files opened with TextMate
- Skim notes

None of these is supposed to be in the bottle I believe.
2023-04-11 11:00:47 -04:00
Douglas Eichelberger
4d32699f61 Placate rubocop 2023-03-14 23:01:09 -07:00
Douglas Eichelberger
f4c9a96c70 Enable types in dev-cmd 2023-03-14 08:32:03 -07:00
Issy Long
e9d994622e
rubocop: Drop "f" from Naming/MethodParameterName allowlist
- This either stands for "file" but more often than not "formula".
2023-03-11 00:17:27 +00:00
Issy Long
298bb65dfb
rubocop: Entirely disable Metrics cops
- These are arbitrary length limits that had a load of disables in code.
- The limits were only increasing over time rather than decreasing.
- Fixing the problematic code to be shorter would take a long time for
  questionable gain since the problem has been around so long.
2023-02-21 00:34:17 +00:00
Issy Long
f8654bd363
rubocop: In-line disables of Metrics/{Module,Block,Class}Length
- We're not going to make the really long things be any shorter any time soon.
- The instructions in issue 14685 say, pragmatically, "disable all the rubocop
  rules we're never going to realistically fix e.g. Metrics/ClassLength". But
  that felt like a slippery slope to more _really_ long modules/classes/blocks,
  and the limits are here for a reason.
2023-02-19 16:33:23 +00:00
Mike McQuaid
30b2a546e5
Revert "move dev-cmd/bottle methods to extend/os" 2023-02-10 17:01:22 +00:00
hyuraku
ddf4d6af79 repair style 2023-02-07 23:53:09 +09:00
hyuraku
853421e968 repair setup_tar_and_args! method 2023-02-07 23:45:09 +09:00
hyuraku
ade7118057 add new method: gnutar_args 2023-02-07 23:22:33 +09:00
hyuraku
ec1a1566bc separate setup_tar_and_args method 2023-02-07 23:22:33 +09:00
hyuraku
fde7ca31b8 add alias generic_formula_ignores formula_ignores 2023-02-07 23:22:33 +09:00
hyuraku
26a615f009 move dev-cmd/bottle methods to extend/os 2023-02-07 23:22:33 +09:00
Caleb Xu
e0915a2c34
dev-cmd/bottle: use Utils::Gzip.compress_with_options 2023-01-06 23:04:03 -05:00
Rylan Polster
68bbe03d04
Remove remaining formula_api_path references 2023-01-06 02:46:21 -05:00
Mike McQuaid
4a0e16fbd9
dev-cmd/bottle: use gnu-tar's --mtime.
This allows us to remove all the manual timestamp fiddling and lets
`gnu-tar` handle it for us instead (as-per the most recent
recommendations on https://reproducible-builds.org/docs/archives/).
2022-12-12 16:47:56 +00:00
apainintheneck
c477b9aab3 Cleanup after adding os specific rubocop
- Change name of rubocop warning
- Disable linting on remaining offending lines
- Add todos to move lines with disabled linting
  checks to extend/os in the future
2022-11-29 23:13:50 -08:00
Bo Anderson
5fb368d9b8
dev-cmd/bottle: add --no-all-checks 2022-11-04 18:46:43 +00:00
danielnachun
b137d4ae00
bottle.rb: make GCC relocatable again 2022-07-11 01:25:16 -07:00
Michka Popoff
0815a4481a
Merge pull request #13494 from Bo98/bottle-dep-fix
Fix `Keg.bottle_dependencies` including unneeded build dependencies
2022-06-30 22:26:09 +02:00
Mike McQuaid
22d6af1258
Manual brew style fixes. 2022-06-30 08:56:21 +01:00
Mike McQuaid
2d5eab2e1c
brew style --fix 2022-06-30 08:56:21 +01:00
Bo Anderson
2ddce84225
Remove Keg.relocation_formulae
We no longer use any formulae for relocation.
2022-06-30 03:39:29 +01:00
Mike McQuaid
1bb44979ee
Disable and delete code for 3.5.0
The next planned release will be 3.5.0 so let's fix things up for there.
2022-05-30 14:59:14 +01:00
hyuraku
e46e35bb0c delete bottle deprecate key 2022-02-24 21:57:54 +09:00
Adrian Ho
af4955adfc dev-cmd/bottle: clean up intermediate tar
Otherwise Cellar gets cluttered.

Fixes https://github.com/Homebrew/brew/issues/12744.
2022-01-18 15:58:35 +08:00
XuehaiPan
9ef52080e3 utils: extract common word "for" in reason 2021-11-23 23:59:09 +08:00
XuehaiPan
d749173adc utils: mark reason as keyword argument in ensure_formula_installed! 2021-11-23 23:31:22 +08:00
XuehaiPan
3376479e95 utils: add method ensure_formula_installed! 2021-11-23 22:48:39 +08:00
Bo Anderson
38ebaac869
dev-cmd/bottle: fix pkg_version comparison on merge 2021-11-08 03:42:41 +00:00
Bo Anderson
d4c33634db
dev-cmd/bottle: correct all rebuild matching logic 2021-11-06 03:44:14 +00:00
Bo Anderson
d2ba21c1b1
dev-cmd/bottle: don't gen all bottles if a bottle spec already exists 2021-11-05 17:29:18 +00:00
danielnachun
e69fbaf357
bottle.rb: fix typo in go regex 2021-10-25 23:21:01 -07:00
danielnachun
0323c3ae30
bottle.rb: add workaround to make gcc have cellar :any 2021-10-19 10:55:03 -07:00
fn ⌃ ⌥
35d6839b56 archive: delete 2021-09-30 09:50:04 -07:00
Bo Anderson
b55498269f
Revamp APIs around bottle specifications 2021-09-20 15:02:05 +01:00
Rylan Polster
b1215800d4
Fix tests 2021-08-06 11:42:55 -04:00
Mike McQuaid
82c5756690
dev-cmd/bottle: use native Ruby.
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2021-07-14 11:45:03 +01:00
Mike McQuaid
721ed8542b
dev-cmd/bottle: fixup macOS symlink permissions.
These can be changed on macOS but not on Linux so we need to make them
consistent in both places for `all:` bottles to have consistent
checksums.

I investigated adding to `cleaner.rb` to fix these symlink permissions
on installation but it seems it already happens by default when
extracting so there's no need.
2021-07-14 10:31:25 +01:00
Rylan Polster
023063d6a2
bottle: calculate rebuild correctly when removing bottle :unneeded 2021-06-01 11:39:07 -04:00
Rylan Polster
7c68b1738b
Merge pull request #11332 from Rylan12/relocate-paths-at-start
keg_relocate: only replace matches at the start of a path
2021-05-13 12:19:06 -04:00
Rylan Polster
4457dc904b
Cleanup using suggestions from code review 2021-05-13 11:02:39 -04:00
Bo Anderson
6d31408606
dev-cmd/bottle: make gzip creation consistent across platforms 2021-05-12 14:21:38 +01:00
Mike McQuaid
b914411ac8
Delete Bintray code
Remove all code related to Bintray. It no longer works so there's no
point keeping it around.

Some of this could arguably be deprecated/disabled first/instead but:
I'm not sure I see the sense in keeping stuff around that's known to be
broken.
2021-05-12 13:37:18 +01:00
Rylan Polster
5f781770b4
Extract Keg::text_matches_in_file from bottle command 2021-05-11 14:26:14 -04:00
Rylan Polster
fe7f80f647
Refactor out and correctly create path regex 2021-05-11 14:26:14 -04:00
Rylan Polster
fd3730a531
bottle: allow links to pkgconfig directory in HOMEBREW_REPOSITORY 2021-05-11 14:26:14 -04:00
Rylan Polster
9ddb531249
bottle: update keg_contain? to match correctly 2021-05-11 14:26:14 -04:00