Library/Homebrew/cleaner.rb
# Clean a top-level (bin, sbin, lib) directory, recursively, by fixing file
# permissions and removing .la files, unless the files (or parent
# directories) are protected by skip_clean.
#
# bin and sbin should not have any subdirectories; if either do that is
# caught as an audit warning
#
# lib may have a large directory tree (see Erlang for instance), and
# clean_dir applies cleaning rules to the entire tree
Clean a top-level (bin, sbin, lib) directory, recursively, by fixing file
permissions and removing .la files, unless the files (or parent
directories) are protected by skip_clean.

bin and sbin should not have any subdirectories; if either do that is
caught as an audit warning

lib may have a large directory tree , and
clean_dir applies cleaning rules to the entire tree
Clean a top - level ( bin sbin lib ) directory recursively by fixing file permissions and removing . la files unless the files ( or parent directories ) are protected by skip_clean . bin and sbin should not have any subdirectories ; if either do that is caught as an audit warning lib may have a large directory tree and clean_dir applies cleaning rules to the entire tree
def clean_dir(d)
    d.find do |path|
      path.extend(ObserverPathnameExtension)
      Find.prune if @f.skip_clean? path
      next if path.symlink? || path.directory?
      if path.extname == ".la"
        path.unlink
      elsif path.basename.to_s == "perllocal.pod"
        path.unlink
      elsif path.basename.to_s == ".packlist" 
        path.unlink
      else
        perms = if executable_path?(path)
          0555
        else
          0444
        end
        if ARGV.debug?
          old_perms = path.stat.mode & 0777
          if perms != old_perms
            puts "Fixing #{path} permissions from #{old_perms.to_s(8)} to #{perms.to_s(8)}"
          end
        end
        path.chmod perms
      end
    end
  end
def clean_dir ( d ) d . find do | path | path . extend ( ObserverPathnameExtension ) Find . prune if @f . skip_clean? path next if path . symlink? || path . directory? if path . extname == ".la" path . unlink elsif path . basename . to_s == "perllocal.pod" path . unlink elsif path . basename . to_s == ".packlist" path . unlink else perms = if executable_path? ( path ) 0555 else 0444 end if ARGV . debug? old_perms = path . stat . mode & 0777 if perms != old_perms puts "Fixing #{path} permissions from #{old_perms.to_s(8)} to #{perms.to_s(8)}" end end path . chmod perms end end end
Clean a top-level (bin, sbin, lib) directory, recursively, by fixing file
permissions and removing .la files, unless the files (or parent
directories) are protected by skip_clean.
Clean a top - level ( bin sbin lib ) directory recursively by fixing file permissions and removing . la files unless the files ( or parent directories ) are protected by skip_clean .
# Both this file & the .packlist one below are completely unnecessary # to package & causes pointless conflict with other formulae. They are # removed by Debian, Arch & MacPorts amongst other packagers as well. # The files are created as part of installing any Perl module. # Hidden file, not file extension! # Set permissions for executables and non-executables
d