OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.0 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../uclibc/ldconfig-glob.patch
  5. # Copyright (C) 2009 The OpenSDE Project
  6. # Copyright (C) 2004 - 2007 The T2 SDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This patch file is dual-licensed. It is available under the license the
  11. # patched project is licensed under, as long as it is an OpenSource license
  12. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  13. # of the GNU General Public License as published by the Free Software
  14. # Foundation; either version 2 of the License, or (at your option) any later
  15. # version.
  16. # --- SDE-COPYRIGHT-NOTE-END ---
  17. Add pathname pattern matching to ldconfig
  18. -- Michael Tross
  19. --- ./utils/ldconfig.c.orig 2007-04-18 01:08:20.000000000 +0200
  20. +++ ./utils/ldconfig.c 2007-05-08 05:37:25.000000000 +0200
  21. @@ -36,6 +36,7 @@
  22. #include <unistd.h>
  23. #include <link.h>
  24. #include <fcntl.h>
  25. +#include <glob.h>
  26. #include <errno.h>
  27. #include <sys/stat.h>
  28. #include <sys/mman.h>
  29. @@ -995,8 +996,45 @@
  30. warnx("You should remove `%s' from `%s'", cp, LDSO_CONF);
  31. continue;
  32. }
  33. +
  34. + /* ******************************* */
  35. +
  36. + glob_t result;
  37. + int j;
  38. + char *realpath;
  39. + struct stat64 stat_buf;
  40. + if (glob(cp, GLOB_ONLYDIR, NULL, &result) == 0) {
  41. +
  42. + for (j = 0; j < result.gl_pathc; j++) {
  43. +
  44. + /* create a copy entry with expanded path */
  45. + realpath = xstrdup (result.gl_pathv[j]);
  46. +
  47. + if (realpath == NULL || stat64 (realpath, &stat_buf)) {
  48. + if (verbose >= 0)
  49. + warnx ("Can't stat %s [%i]", realpath, errno);
  50. + }
  51. + else {
  52. + scan_dir(realpath);
  53. + }
  54. + free(realpath);
  55. + }
  56. +
  57. + }
  58. + else {
  59. + if (stat64 (cp, &stat_buf)) {
  60. + if (verbose >= 0)
  61. + warnx ("Can't stat %s [%i]", cp, errno);
  62. + }
  63. + else {
  64. scan_dir(cp);
  65. }
  66. + }
  67. + globfree (&result);
  68. +
  69. + /* ******************************* */
  70. +
  71. + }
  72. free(extpath);
  73. }
  74. #endif