51 Commits

Author SHA1 Message Date
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Mike McQuaid
ca189437e4 Tweak use of with_env
- Use it in more places where it saves code
- Allow using symbolic keys for a cleaner interface
- Use `HOMEBREW_GEM_*` instead of `GEM_OLD_*`
2017-10-29 14:44:43 +00:00
ilovezfs
82afe5d7f7 fileutils: deprecate rake DSL
superenv and the `:ruby` requirement make a `rake` DSL unnecessary.
2017-10-13 02:01:28 -07:00
Viktor Szakats
b44c7a1022 upgrade more urls to https 2017-08-22 10:31:21 +00:00
Misty De Meo
890788af65
FileUtils.make: don't bypass superenv 2017-07-15 17:40:21 -07:00
ilovezfs
0d03eef655 Revert "FileUtils.make: don't bypass superenv" 2017-07-12 02:58:01 -07:00
Misty De Meo
2aefd7eed6 FileUtils.make: don't bypass superenv 2017-07-07 16:23:46 -07:00
Alyssa Ross
b0fea9eb6c fileutils: update Ruby documentation URL 2017-01-23 17:56:33 +00:00
Mike McQuaid
e767fd3df9 Merge branch 'master' into mkdir_with_intermediates 2016-09-24 20:48:03 +01:00
Markus Reiter
58e36c7319 Fix Style/GuardClause. 2016-09-24 12:24:35 +02:00
Markus Reiter
e851c9bf6c Style/Alias: Prefer alias. 2016-09-23 18:19:53 +02:00
Marc Savy
7fc241765e Make mkdir wrapper use mkdir_p to create intermediate directories 2016-09-20 12:17:44 +01:00
Mike McQuaid
df5605fa01 extend/fileutils: fix Rubocop warnings. 2016-09-13 07:57:07 +01:00
Xu Cheng
e423617d77
remove ruby 1.8 compatible codes 2016-08-18 14:35:39 +08:00
Mike McQuaid
f32251d461 extend/fileutils: assume Ruby 2. 2016-08-17 09:19:56 +01:00
Toru Tanaka
967988c444 Fix a variable name in error message (#190) 2016-05-03 02:24:32 -04:00
Misty De Meo
2008c880dd Add a helper to determine make path on Tiger 2016-04-22 22:37:21 -07:00
Andrew Janke
258a764f67 stage: fix block signature back-compatibility under Ruby 1.8.7
The new stage() signature introduced by #66 breaks back-compatibility
under Ruby 1.8.7. This fixes it by switching back to a one-argument
block signature and using a new class to wrap both the Resource and
Mktemp info for the staging context, in a signature-back-compatible
way.

Addresses homebrew/homebrew-core#529.

Closes #135.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-22 21:49:00 -04:00
Andrew Janke
acc9a7ca85 brew test, install, update-test: add --keep-tmp option
Also enables sandbox for --interactive and --debug use of install
and test, using automatic retention.

Closes #66.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-18 12:23:08 -04:00
Andrew Janke
343091c828 Merge pull request #27 from apjanke/test-bot-xml-filter
test-bot: revise Step output transcoding and XML character filtering
2016-04-05 17:23:24 -04:00
ilovezfs
332c990377 FileUtils::mktemp pass gid to Etc.getgrgid as int
We need to move the Snow Leopard fix down since Etc.getgrgid can't
handle a string.

Closes #31.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-04-05 12:24:40 -07:00
ilovezfs
2517d396aa FileUtils::mktemp fix for OS X 10.6.7 and earlier
FileUtils::fu_get_gid only started doing the conversion of the group
to_s automatically from OS X 10.6.8 (ruby-1.8.7-p358) forward.

OS X 10.6.7 (ruby-1.8.7-p174) would fail in brew's FileUtils::mktemp with the
error "Error: can't convert Fixnum into String."

Fixes Homebrew/homebrew#49045
Fixes Homebrew/homebrew#49348

Closes Homebrew/homebrew#49369.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-21 17:34:19 +00:00
Xu Cheng
12a452557d make HOMEBREW_BREW_FILE a Pathname object
Currently HOMEBREW_BREW_FILE is a String, while other of HOMEBREW_*
variables are all Pathname. This commit unifies them all as Pathname,
so it will not cause any confusion.

Closes Homebrew/homebrew#48872.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-06 02:52:48 +08:00
ilovezfs
ca77025f8b Don't accidentally inherit group "wheel" from /tmp
Because files on OS X are assigned the group of the directory in which
they are created, using /tmp during the installation process would
result in some installed files having the group "wheel" even though
"admin" was intended.

Thanks to Xu Cheng for suggesting a simpler location for the fix.

Closes Homebrew/homebrew#45869

Closes Homebrew/homebrew#48732.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-05 21:52:29 +08:00
Mike McQuaid
2c959a7d58 More API documentation.
And remove the documented stuff from the `example-formula.rb`.

Closes Homebrew/homebrew#43241.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-29 15:43:16 +01:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Xu Cheng
74ea4bd31c fileutils: use rm_rf to clean temp dir
Honestly, I don't know why git is broken under sandbox. But this seems
fix the problem in Homebrew/homebrew#38978.

Closes Homebrew/homebrew#39138.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-05-01 15:21:58 +08:00
Jack Nagel
db05618561 Use Dir.mktmpdir instead of shelling out to mktemp
Closes Homebrew/homebrew#37616.
2015-03-14 20:45:21 -04:00
Jack Nagel
316d8d756c Reduce scope of ensure block, remove conditionals 2015-03-10 23:26:54 -04:00
xxxajk
1dc384b4c4 Fix mktmp to be generic as-per SUS/BSD.
Closes Homebrew/homebrew#31586.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-08-14 10:36:07 +01:00
Jack Nagel
7f10aa3b6e Fix visibility of FileUtils extension methods 2014-06-09 21:37:52 -05:00
Jack Nagel
9e57da83a2 Stop exposing mktemp as a public method on formula objects 2014-06-09 21:36:36 -05:00
Jack Nagel
a867cb4305 Use Formula#system and existing error handling in scons helper
Fixes Homebrew/homebrew#27553.
2014-03-14 16:41:57 -05:00
Adam Vandenberg
88565ac3d4 move scons helper to fileutils 2014-02-28 07:20:52 -08:00
Jack Nagel
c72f9a469d Add an xcodebuild helper and deprecate system "xcodebuild"
In the future we can remove the ENV munging branch from Formula#system.

Closes Homebrew/homebrew#27081.
2014-02-27 21:53:21 -06:00
Jack Nagel
c6c7b9b165 Extract HOMEBREW_TEMP constant 2013-12-14 09:35:58 -06:00
Misty De Meo
25ab8212a0 FileUtils#copy_metadata: update comment, version 2013-10-06 14:06:25 -07:00
Jack Nagel
b35d9906e5 Pass the mktemp prefix as an argument 2013-10-02 22:01:31 -05:00
Jack Nagel
02a0e4e2e0 Fix mktemp directory naming 2013-10-02 19:41:05 -05:00
Jack Nagel
f0db242591 extend/fileutils: suppress discarded method definition warnings 2013-03-28 17:37:29 -05:00
Mike McQuaid
9837bbda55 Add with_system_path to run using system PATHs.
Needed for Linux compatibility.
2013-03-11 18:26:25 +00:00
Mike McQuaid
d39280bdf7 Add current Ruby globals.
Allows access to the Ruby path. Needed for Linux
porting.
2013-03-11 18:26:25 +00:00
Jack Nagel
ea15442b9a Move ruby methods to FileUtils extension 2013-02-02 11:24:55 -06:00
Misty De Meo
38283eafb2 FileUtils: backport #copy_metadata fix
Entry_#copy_metadata has a nasty bug that makes copying symlinks
across filesystems fail. This lasted all the way through 1.9.3p194
before *finally* being fixed. This backports the official fix.

Fixes Homebrew/homebrew#14710.
2012-09-27 09:52:06 -05:00
Max Howell
a217b03952 Clean up and improve build-error output and logs
All logs are now stored from each command executed in Formula.install.

Error output is truncated to five lines in an attempt to not overwhelm the user and to encourage users to read the error output and report the bug properly. Maybe we can get that figure up from 70% to 90%.
2012-09-25 11:31:56 -04:00
Max Howell
fc9b18c291 Don't catch build errors 2012-08-29 22:25:29 -04:00
Max Howell
3fbe631b02 Block form of chdir can only be used once
If you nest them, the library complains. So let's not do that.

/cc @jacknagel
2012-08-29 19:49:11 -04:00
Max Howell
d89b3272f4 Ensure mktemp cleans up after itself
Ignore interrupts.
2012-08-29 12:41:36 -04:00
Mike McQuaid
995186a72c Fix Ruby warnings.
Fixes Homebrew/homebrew#11966.
2012-05-01 20:45:17 +08:00
Jack Nagel
67c3f1b2b4 Extend FileUtils rather than include it
Fixes Homebrew/homebrew#10729.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-06 19:23:51 -06:00