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.

141 lines
4.7 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../make/make-3.82-0003-archives-many-objects.patch
  5. # Copyright (C) 2012 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. From d3df5370acf8000b7319417f885a584230658ddc Mon Sep 17 00:00:00 2001
  17. From: Christian Wiese <chris@opensde.org>
  18. Date: Mon, 22 Oct 2012 17:50:44 +0200
  19. Subject: [PATCH] archives many objects
  20. ChangeLog:
  21. 2010-08-13 Paul Smith <psmith@gnu.org>
  22. * read.c (parse_file_seq): Fix various errors parsing archives
  23. with multiple objects in the parenthesis, as well as wildcards.
  24. Fixes Savannah bug #30612.
  25. tests/ChangeLog:
  26. 2010-08-13 Paul Smith <psmith@gnu.org>
  27. * scripts/features/archives: New regression tests for archive
  28. support. Test for fix to Savannah bug #30612.
  29. ---
  30. read.c | 15 ++++++++-----
  31. tests/scripts/features/archives | 42 +++++++++++++++++++++++++++++++++++++++
  32. 2 files changed, 51 insertions(+), 6 deletions(-)
  33. create mode 100644 tests/scripts/features/archives
  34. diff --git a/read.c b/read.c
  35. index a3ad88e..9dfd4ea 100644
  36. --- a/read.c
  37. +++ b/read.c
  38. @@ -3028,7 +3028,7 @@ parse_file_seq (char **stringp, unsigned int size, int stopchar,
  39. {
  40. /* This looks like the first element in an open archive group.
  41. A valid group MUST have ')' as the last character. */
  42. - const char *e = p + nlen;
  43. + const char *e = p;
  44. do
  45. {
  46. e = next_token (e);
  47. @@ -3084,19 +3084,19 @@ parse_file_seq (char **stringp, unsigned int size, int stopchar,
  48. Go to the next item in the string. */
  49. if (flags & PARSEFS_NOGLOB)
  50. {
  51. - NEWELT (concat (2, prefix, tp));
  52. + NEWELT (concat (2, prefix, tmpbuf));
  53. continue;
  54. }
  55. /* If we get here we know we're doing glob expansion.
  56. TP is a string in tmpbuf. NLEN is no longer used.
  57. We may need to do more work: after this NAME will be set. */
  58. - name = tp;
  59. + name = tmpbuf;
  60. /* Expand tilde if applicable. */
  61. - if (tp[0] == '~')
  62. + if (tmpbuf[0] == '~')
  63. {
  64. - tildep = tilde_expand (tp);
  65. + tildep = tilde_expand (tmpbuf);
  66. if (tildep != 0)
  67. name = tildep;
  68. }
  69. @@ -3152,7 +3152,10 @@ parse_file_seq (char **stringp, unsigned int size, int stopchar,
  70. else
  71. {
  72. /* We got a chain of items. Attach them. */
  73. - (*newp)->next = found;
  74. + if (*newp)
  75. + (*newp)->next = found;
  76. + else
  77. + *newp = found;
  78. /* Find and set the new end. Massage names if necessary. */
  79. while (1)
  80. diff --git a/tests/scripts/features/archives b/tests/scripts/features/archives
  81. new file mode 100644
  82. index 0000000..00aa1af
  83. --- /dev/null
  84. +++ b/tests/scripts/features/archives
  85. @@ -0,0 +1,42 @@
  86. +# -*-mode: perl-*-
  87. +
  88. +$description = "Test GNU make's archive management features.";
  89. +
  90. +$details = "\
  91. +This only works on systems that support it.";
  92. +
  93. +# If this instance of make doesn't support archives, skip it
  94. +exists $FEATURES{archives} or return -1;
  95. +
  96. +# Create some .o files to work with
  97. +utouch(-60, qw(a1.o a2.o a3.o));
  98. +
  99. +# Very simple
  100. +run_make_test('all: libxx.a(a1.o)',
  101. + '', "ar rv libxx.a a1.o\nar: creating libxx.a\na - a1.o\n");
  102. +
  103. +# Multiple .o's. Add a new one to the existing library
  104. +run_make_test('all: libxx.a(a1.o a2.o)',
  105. + '', "ar rv libxx.a a2.o\na - a2.o\n");
  106. +
  107. +# Touch one of the .o's so it's rebuilt
  108. +utouch(-40, 'a1.o');
  109. +run_make_test(undef, '', "ar rv libxx.a a1.o\nr - a1.o\n");
  110. +
  111. +# Use wildcards
  112. +run_make_test('all: libxx.a(*.o)',
  113. + '', "#MAKE#: Nothing to be done for `all'.\n");
  114. +
  115. +# Touch one of the .o's so it's rebuilt
  116. +utouch(-30, 'a1.o');
  117. +run_make_test(undef, '', "ar rv libxx.a a1.o\nr - a1.o\n");
  118. +
  119. +# Use both wildcards and simple names
  120. +utouch(-50, 'a2.o');
  121. +run_make_test('all: libxx.a(a3.o *.o)', '',
  122. + "ar rv libxx.a a3.o\na - a3.o\nar rv libxx.a a2.o\nr - a2.o\n");
  123. +
  124. +rmfiles(qw(a1.o a2.o a3.o libxx.a));
  125. +
  126. +# This tells the test driver that the perl test script executed properly.
  127. +1;
  128. --
  129. 1.7.2.3