From d0be4d692b557056220514b743841b55ef180b80 Mon Sep 17 00:00:00 2001 From: Nicolas Despres Date: Sat, 21 Jan 2012 00:51:20 +0100 Subject: 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 --- Library/Homebrew/extend/pathname.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Library/Homebrew/extend') diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 4ab94a502..1562bfbcd 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -262,6 +262,20 @@ class Pathname ensure chmod saved_perms if saved_perms end + + def install_info + unless self.symlink? + raise "Cannot install info entry for unbrewed info file '#{self}'" + end + system '/usr/bin/install-info', self.to_s, (self.dirname+'dir').to_s + end + + def uninstall_info + unless self.symlink? + raise "Cannot uninstall info entry for unbrewed info file '#{self}'" + end + system '/usr/bin/install-info', '--delete', '--quiet', self.to_s, (self.dirname+'dir').to_s + end end # sets $n and $d so you can observe creation of stuff @@ -286,6 +300,14 @@ module ObserverPathnameExtension puts "ln #{to_s}" if ARGV.verbose? $n+=1 end + def install_info + super + puts "info #{to_s}" if ARGV.verbose? + end + def uninstall_info + super + puts "uninfo #{to_s}" if ARGV.verbose? + end end $n=0 -- cgit v1.2.3