50 Commits

Author SHA1 Message Date
Marc Seeger
8457fa5af5
Fix 2nd typo in cleaner.rb 2019-04-08 10:33:49 -07:00
Marc Seeger
4f8489faa1
Fix typo in cleaner.rb
Seems like auto-correct was a bit too eager to fix things :) ?
2019-04-08 10:24:56 -07:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00:00
Bryce Glover
72a95edcfb [cleaner.rb] clean_dirs: Remove symbolic links if they point to static libra-
ries.

Reopens Homebrew/homebrew-core#35269.
Closes Homebrew/homebrew-core#35269.
2019-01-30 19:22:10 -05:00
EricFromCanada
20167e5f1b Adjust comments to tidy API docs output. 2018-10-18 21:42:43 -04:00
Markus Reiter
a5b11a6a5c Fix Style/GuardClause. 2016-09-23 15:30:07 +02:00
Dominyk Tiller
202f793d8a
cleaner: kill unnecessary perl elements
We shouldn't be packaging either `perllocal.pod` or `.packlist` files. Both
are only really useful outside of package management. They get automatically
generated whenever you install a Perl module.

Debian, Arch, MacPorts & others remove them and we should have been as well
really; keeping them causes completely unnecessary conflicts between formulae.
2016-07-31 03:44:29 +01:00
Mike McQuaid
cdf4f42ab9 cleaner: fix generic executable handling. (#498)
Don't unset things that are already set as executable for the generic path.
OS X overrides this behaviour and detects if it's an MachO executable but
there's no cross-OS generic equivalent so just fall back to whatever the build
system has set.
2016-07-12 19:47:27 +01:00
Mike McQuaid
fe29cc2920 cleaner: port to generic OS. (#447) 2016-07-04 16:10:24 +01:00
Baptiste Fontaine
8ba0fb9fcf unnecessary calls to .select simplified
These are minor perf optimizations.

Closes Homebrew/homebrew#43028.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-08-18 00:18:22 +02:00
Xu Cheng
d62095710f More core files style updates 2015-08-03 20:38:20 +08: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
Adam Vandenberg
95d16ef1ba don't clean libexec 2014-09-26 18:22:19 -07:00
Adam Vandenberg
8b5397fa28 improve comment 2014-07-20 12:17:06 -07:00
Adam Vandenberg
929fd44082 use ObserverPathnameExtension to remove these files 2014-07-20 12:17:06 -07:00
Adam Vandenberg
557f887f24 add clarifying comments 2014-07-20 12:17:06 -07:00
Adam Vandenberg
b0138e447d fix comment 2014-07-19 23:28:39 -07:00
Adam Vandenberg
a78b906389 inline this method 2014-05-12 21:22:13 -07:00
Adam Vandenberg
f5cc07dfea add more documentation 2014-02-25 20:24:34 -08:00
Adam Vandenberg
0bdce89d65 fix incorrect comment 2014-02-25 20:24:34 -08:00
Adam Vandenberg
3a4a529453 remove charset.alias directly 2014-02-25 20:24:34 -08:00
Adam Vandenberg
9559e162b2 Cleaner: do work in clean instead of constructor 2014-02-23 15:53:25 -08:00
Adam Vandenberg
bb5a2b587e Always keep info files
Closes Homebrew/homebrew#26659.
2014-02-23 08:30:50 -08:00
Jack Nagel
3cec3e36e9 cleaner: use ObserverPathnameExtension 2013-12-22 13:43:51 -06:00
Jack Nagel
095d83d10b cleaner: reorganize clean_dir to avoid repeated conditional 2013-12-22 13:43:50 -06:00
Jack Nagel
d19934dcb7 cleaner: clean up broken and orphaned symlinks 2013-12-21 23:28:04 -06:00
Jack Nagel
e480206464 cleaner: fix permission debug output 2013-12-21 23:28:03 -06:00
Jack Nagel
e5cd33c7a9 cleaner: don't change permissions on paths marked skip_clean 2013-08-28 12:00:06 -05:00
Jack Nagel
ab60b0114a cleaner: traverse directories in postorder 2013-08-08 20:52:52 -05:00
Adam Vandenberg
f85863cbd0 Clean the cleaner
* Fix a comment; we pass in formulae not names
* Don't pass the formula to factory; this is just a pass-through
* Move require to top-level
2013-06-23 12:54:28 -07:00
Jack Nagel
56fa23e07e cleaner: simplify verbose pathname extension 2013-03-18 00:11:49 -05:00
Adam Vandenberg
12d2900231 Show permission changes in debug mode 2013-02-10 08:55:09 -08:00
Adam Vandenberg
47dcc3f770 Cleaner: allow non-empty paths to be pruned from cleaning 2013-01-08 21:27:30 -08:00
Adam Vandenberg
fd1fd78a94 Cleaner: add (commented-out) debugging information for permission changes
The cleaning step changes permissions on files. Added a commented-out block
that will show permission changes when doing verbose builds.

Since this output is not generally useful for even normal verbose builds,
added as commented-out code (I'm sorry) so that maintainers can uncomment
it when this functionality is needed for debugging.
2012-10-24 09:20:56 -07:00
Max Howell
12d17155cf If we delete stuff in the clean step, make fuss
/cc @jwheare
2012-09-18 16:27:34 -04:00
Adam Vandenberg
54618074a1 Stop stripping binary files 2012-07-05 21:54:31 -07:00
samueljohn
725feb3db1 Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!

Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)

Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.

Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.

Closes Homebrew/homebrew#10510.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-06-24 19:11:06 -07:00
Jack Nagel
2a6575ad28 cleaner: use new Mach-O pathname methods in clean_file
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-30 22:32:49 -05:00
Jack Nagel
d60f4ffcd8 Restore cleaning of lib/charset.alias
Even though we now prevent linking of this file into the prefix in
Keg#link, its presence still triggers a "non-lib in lib" warning during
installation. So keep cleaning it, and leave the check in Keg#link so
things that skip_clean 'lib' still won't have it linked.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-09 12:41:22 -06:00
Jack Nagel
01994c7be1 keg: allow selective linking at the file level
Some parts of a keg's tree are not subject to the cleaner, and sometimes
we still want to remove things in directories marked skip_clean; this
allows us that freedom.

If 'lib' is marked skip_clean, we still want to avoid linking the
charset.alias file into the top of the tree. The same needs to be done
for the locale.alias file in share/locale.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-04 23:56:22 -06:00
Jack Nagel
a23357372e cleaner: remove lib/charset.alias files
This file is installed by a number of packages, but it really shouldn't
be. It is meant to be updated by packages that use it, but this is
broken (1) by software that doesn't do this correctly and (2) by the
symlink being overwritten by Homebrew's linking code.

It's presence can cause issues with tools that use libiconv/gettext.

Instead let's follow MacPorts' example and just remove it during the
clean stage.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-19 16:53:37 -06:00
Nicolas Despres
d0be4d692b keg: handle the info directory file properly
If HOMEBREW_KEEP_INFO environment variable is set:
 - Do not symlink the info directory file (aka 'share/info/dir')
   otherwise it gets overwritten by next installed brew.
 - Install an entry in the directory for each linked info file when the
   brew is linked.
 - Uninstall the entry when the brew is unlinked.

Closes Homebrew/homebrew#9700.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-01 22:52:14 -06:00
Jack Nagel
74207f71e6 cleaner: correctly obey HOMEBREW_KEEP_INFO
The advertised default is that anything in share/info is removed unless
the user sets HOMEBREW_KEEP_INFO, but we've actually been installing the
files *unless* the variable is set. To illustrate:

  $ unset HOMEBREW_KEEP_INFO
  $ brew install -v wdiff
  [...]
  ln /usr/local/share/locale/af/LC_MESSAGES/wdiff-gnulib.mo
  ln /usr/local/share/info/wdiff.info
  ln /usr/local/share/info/dir
  ==> Summary
  [...]
  $ HOMEBREW_KEEP_INFO=1 brew install -v wdiff
  ln /usr/local/share/locale/af/LC_MESSAGES/wdiff-gnulib.mo
  ==> Summary
  [...]

Obviously not what we wanted.

Closes Homebrew/homebrew#7989.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-06 00:11:34 -05:00
Max Howell
ca45147219 Be future proof, output from file becomes more verbose
New versions of file return `script, ASCII text executable`. Apple may ship the newer version with 10.8 so we may as well be ready for it.
2011-09-01 12:53:46 +01:00
Max Howell
1c28de6538 Use fullpaths to file and strip
Fixes Homebrew/homebrew#7353.
2011-09-01 12:08:30 +01:00
Max Howell
c1a3b724fd Some Cleanup 2011-03-12 11:55:03 -08:00
Max Howell
768910283a Refactor the brew command into one file per command
The code was sucking. To the extent that maintenance was hard. It's a lot
easier to work with code that is sensibly split at sensible boundaries. So
now it is more like that.

But the refactor is minimal. Because we don't want you to have more merge
hell than absolutely necessary.

If you merge you will need to pay attention to brew.h.rb (as it is deleted)
and bin/brew (as command logic is gone). It will be painful, but you will just
have to help git out by moving any changes around manually.

Note compatibility.rb. It ensures that any function renames or removals don't
break anything. We're pretty serious about backwards compatibility. And that's
because we encourage you to hack around with the innards. And we couldn't do
that if we would then just make stuff disappear behind your back.
2011-03-12 11:55:02 -08:00
Adam Vandenberg
3a4ab5ed97 HOMEBREW_KEEP_INFO to keep info pages 2010-08-21 11:23:54 -07:00
Adam Vandenberg
0fd221dadd use f.info 2010-08-21 11:07:04 -07:00
Adam Vandenberg
8ff8b84235 Move cleaner to separate file 2010-08-21 11:06:02 -07:00