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.

78 lines
2.1 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) 2006 The OpenSDE Project
  6. # Copyright (C) 2004 - 2006 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. diff -ur uClibc-r11027/utils/ldconfig.c uClibc-r11027.work/utils/ldconfig.c
  20. --- uClibc-r11027/utils/ldconfig.c 2000-01-01 00:00:00.000000000 +0100
  21. +++ uClibc-r11027.work/utils/ldconfig.c 2005-10-14 18:14:31.000000000 +0200
  22. @@ -34,6 +34,7 @@
  23. #include <unistd.h>
  24. #include <link.h>
  25. #include <fcntl.h>
  26. +#include <glob.h>
  27. #include <errno.h>
  28. #include <sys/stat.h>
  29. #include <sys/mman.h>
  30. @@ -977,7 +978,45 @@
  31. warnx("Remove `%s' from `%s'\n", cp, LDSO_CONF);
  32. continue;
  33. }
  34. - scan_dir(cp);
  35. +
  36. + /* ******************************* */
  37. +
  38. + glob_t result;
  39. + int j;
  40. + char *realpath;
  41. + struct stat64 stat_buf;
  42. + if (glob(cp, 0, NULL, &result) == 0) {
  43. +
  44. + for (j = 0; j < result.gl_pathc; j++) {
  45. +
  46. + /* create a copy entry with expanded path */
  47. + realpath = xstrdup (result.gl_pathv[j]);
  48. +
  49. + if (realpath == NULL || stat64 (realpath, &stat_buf)) {
  50. + if (verbose >= 0)
  51. + warnx ("Can't stat %s [%i]", realpath, errno);
  52. + }
  53. + else {
  54. + scan_dir(realpath);
  55. + }
  56. + free(realpath);
  57. + }
  58. +
  59. + }
  60. + else {
  61. + if (stat64 (cp, &stat_buf)) {
  62. + if (verbose >= 0)
  63. + warnx ("Can't stat %s [%i]", cp, errno);
  64. + }
  65. + else {
  66. + scan_dir(cp);
  67. + }
  68. + }
  69. + globfree (&result);
  70. +
  71. + /* ******************************* */
  72. +
  73. +
  74. }
  75. free(extpath);
  76. }