 f8a88b5f28
			
		
	
	
		f8a88b5f28
		
	
	
	
	
		
			
			* Added `pin` et. al. to manpage. * Added `brew pin` to `brew.1` * Added `brew unpin` to `brew.1` * Added `brew list --pinned` to `brew.1` * Added information about frozen formulae to `brew upgrade` in `brew.1` * Added `pin` et.al. to completion scripts. * Unpin formulae when uninstalling them * Unpin and re-pin formulae when upgrading (avoids stale symlink) References Homebrew/homebrew#18386. Closes Homebrew/homebrew#18515. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
		
			
				
	
	
		
			17 lines
		
	
	
		
			519 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			519 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| require 'formula'
 | |
| 
 | |
| module Homebrew extend self
 | |
|   def pin
 | |
|     if Process.uid.zero? and not File.stat(HOMEBREW_BREW_FILE).uid.zero?
 | |
|       abort "Cowardly refusing to `sudo pin'"
 | |
|     end
 | |
|     raise FormulaUnspecifiedError if ARGV.named.empty?
 | |
|     ARGV.formulae.each do |fmla|
 | |
|       f = Formula.factory(fmla.to_s)
 | |
|       onoe "Cannot pin uninstalled formula #{f.name}!" unless f.pinable?
 | |
|       opoo "Formula #{f.name} already pinned!" if f.pinable? and f.pinned?
 | |
|       f.pin if f.pinable? and not f.pinned?
 | |
|     end
 | |
|   end
 | |
| end
 |