This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Remove stale symlinks in ldconfig


Hi!

Pre-glibc ldconfig used to remove stale symlinks with .so. substring in
their names, current one does not.
This can result in /usr/lib and other directories cluttered with stale
symlinks after some upgrades. Many packages own the symlinks to libs and
package management removes them on upgrades, but many don't, especially
those coming from non-distro sources.
The point is when ldconfig is creating those symlinks, it should be
responsible for cleaning them up too I think.

2001-08-23  Jakub Jelinek  <jakub@redhat.com>

	* elf/ldconfig.c (search_dir): Remove stale symlinks.

--- libc/elf/ldconfig.c.jj	Thu Aug 23 18:47:05 2001
+++ libc/elf/ldconfig.c	Thu Aug 23 20:13:11 2001
@@ -699,6 +699,10 @@ search_dir (const struct dir_entry *entr
 	    {
 	      if (opt_verbose)
 		error (0, errno, _("Cannot stat %s"), file_name);
+
+	      /* Remove stale symlinks.  */
+	      if (strstr(direntry->d_name, ".so."))
+		unlink(real_file_name);
 	      continue;
 	    }
 	  is_dir = S_ISDIR (stat_buf.st_mode);

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]