talideon.com

I don’t mind kissin’ but I hate that...

April 23, 2008 at 1:20PM Patch: libchk symlink resolution

This patch for libchk fixes a longstanding bugbear of mine with it: it doesn’t resolve symlinked directories before scanning.

I wrote an email to Akinori Musha, the author, a while back outlining the changes made in this patch, but after resending it several times, it kept on bouncing. That’s why I’m posting it up here.

I’d forgotten to save the patch when I upgraded, so I lost it. I needed to use libchk again last night, as as I still remembered what I’d done the first time around, I made the same patch and installed a local copy of libchk rather than installing it from the ports tree. Somebody out there might find it useful.

--- libchk.orig	2008-04-22 23:51:14.000000000 +0100
+++ libchk	2008-04-22 23:48:04.000000000 +0100
@@ -33,6 +33,7 @@

 require 'optparse'
 require 'find'
+require 'pathname'

 LDCONFIG_CMD = '/sbin/ldconfig -elf'
 OBJDUMP_CMD = '/usr/bin/objdump'
@@ -335,6 +336,7 @@

 def compact_dirs!(dirs)
   normalize_dirs!(dirs)
+  dirs.map! { |dir| Pathname.new(dir).realpath().to_s }
   dirs.sort!

   prev = nil
Technorati Search Technorati Search Irish Bloggers

Comments

No comments.

Post a comment

All form information is optional, but it’s a good idea to fill in your name and email address if you want me to take your comment seriously.

Spammers, don’t bother posting crap down here. The site is set up so that legitimate search engines (Google, for instance) won’t index pages with comments on them. Posting crud here only means you’re wasting my time and patience. Shoo!

Real names, please. Please include!
Won’t be displayed. Please include!
Displayed, if present.