coreutils.patch 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. --- src/stat.c.orig Sun Dec 1 10:48:21 2002
  2. +++ src/stat.c Sun Jan 12 11:30:01 2003
  3. @@ -43,6 +43,12 @@
  4. # endif
  5. #endif
  6. +/* FreeBSD 5.0 need this for struct statfs */
  7. +#if HAVE_SYS_MOUNT_H
  8. +# include <sys/param.h>
  9. +# include <sys/mount.h>
  10. +#endif
  11. +
  12. #include "system.h"
  13. #include "closeout.h"
  14. --- src/test.c.orig Mon Feb 10 10:19:09 2003
  15. +++ src/test.c Sun Feb 23 20:44:50 2003
  16. @@ -139,7 +139,7 @@
  17. /* Do the same thing access(2) does, but use the effective uid and gid. */
  18. static int
  19. -eaccess (char const *file, int mode)
  20. +my_eaccess (char const *file, int mode)
  21. {
  22. static int have_ids;
  23. static uid_t uid, euid;
  24. @@ -172,7 +172,7 @@
  25. return result;
  26. }
  27. #else
  28. -# define eaccess(F, M) euidaccess (F, M)
  29. +# define my_eaccess(F, M) euidaccess (F, M)
  30. #endif
  31. /* Increment our position in the argument list. Check that we're not
  32. @@ -635,17 +635,17 @@
  33. case 'r': /* file is readable? */
  34. unary_advance ();
  35. - value = -1 != eaccess (argv[pos - 1], R_OK);
  36. + value = -1 != my_eaccess (argv[pos - 1], R_OK);
  37. return (TRUE == value);
  38. case 'w': /* File is writable? */
  39. unary_advance ();
  40. - value = -1 != eaccess (argv[pos - 1], W_OK);
  41. + value = -1 != my_eaccess (argv[pos - 1], W_OK);
  42. return (TRUE == value);
  43. case 'x': /* File is executable? */
  44. unary_advance ();
  45. - value = -1 != eaccess (argv[pos - 1], X_OK);
  46. + value = -1 != my_eaccess (argv[pos - 1], X_OK);
  47. return (TRUE == value);
  48. case 'O': /* File is owned by you? */
  49. --- src/nice.c.orig 2003-08-10 19:43:35.000000000 +0200
  50. +++ src/nice.c 2003-09-10 20:03:27.000000000 +0200
  51. @@ -23,6 +23,7 @@
  52. #include <assert.h>
  53. #include <getopt.h>
  54. +#include <sys/time.h>
  55. #include <sys/types.h>
  56. #include "system.h"
  57. --- src/date.c.orig 2004-02-05 10:36:07.000000000 +0100
  58. +++ src/date.c 2004-03-24 15:22:04.000000000 +0100
  59. @@ -299,7 +299,8 @@
  60. int n_args;
  61. int status;
  62. int option_specified_date;
  63. - char const *short_options = (posix2_version () < 200112
  64. + char const *short_options = (posix2_version () < 200112 ||
  65. + !getenv ("POSIXLY_CORRECT")
  66. ? COMMON_SHORT_OPTIONS "I::"
  67. : COMMON_SHORT_OPTIONS "I:");
  68. --- src/expand.c.orig 2004-01-21 23:27:02.000000000 +0100
  69. +++ src/expand.c 2004-03-24 15:23:21.000000000 +0100
  70. @@ -406,6 +406,8 @@
  71. }
  72. if (obsolete_tablist && 200112 <= posix2_version ())
  73. + if (obsolete_tablist && 200112 <= posix2_version () &&
  74. + getenv ("POSIXLY_CORRECT"))
  75. {
  76. error (0, 0, _("`-LIST' option is obsolete; use `-t LIST'"));
  77. usage (EXIT_FAILURE);
  78. --- src/fold.c.orig 2004-01-21 23:27:02.000000000 +0100
  79. +++ src/fold.c 2004-03-24 15:26:20.000000000 +0100
  80. @@ -270,6 +270,7 @@
  81. memcpy (s + 2, a + 1, len_a);
  82. argv[i] = s;
  83. if (200112 <= posix2_version ())
  84. + if (200112 <= posix2_version () && getenv ("POSIXLY_CORRECT"))
  85. {
  86. error (0, 0, _("`%s' option is obsolete; use `%s'"), a, s);
  87. usage (EXIT_FAILURE);
  88. --- src/head.c.orig 2004-01-21 23:27:02.000000000 +0100
  89. +++ src/head.c 2004-03-24 15:27:04.000000000 +0100
  90. @@ -996,6 +996,7 @@
  91. }
  92. if (200112 <= posix2_version ())
  93. + if (200112 <= posix2_version () && getenv ("POSIXLY_CORRECT"))
  94. {
  95. error (0, 0, _("`-%s' option is obsolete; use `-%c %.*s%.*s%s'"),
  96. n_string, count_lines ? 'n' : 'c',
  97. --- src/nice.c.orig 2004-01-22 00:23:24.000000000 +0100
  98. +++ src/nice.c 2004-03-24 15:28:51.000000000 +0100
  99. @@ -107,7 +107,7 @@
  100. char *s = argv[i];
  101. if (s[0] == '-' && s[1] == '-' && ISDIGIT (s[2])
  102. - && posix2_version () < 200112)
  103. + && (posix2_version () < 200112 || !getenv ("POSIXLY_CORRECT")))
  104. {
  105. if (xstrtol (&s[2], NULL, 10, &adjustment, "") != LONGINT_OK)
  106. error (EXIT_FAIL, 0, _("invalid option `%s'"), s);
  107. @@ -118,7 +118,7 @@
  108. }
  109. else if (s[0] == '-'
  110. && (ISDIGIT (s[1]) || (s[1] == '+' && ISDIGIT (s[2])))
  111. - && posix2_version () < 200112)
  112. + && (posix2_version () < 200112 || !getenv ("POSIXLY_CORRECT")))
  113. {
  114. if (s[1] == '+')
  115. ++s;
  116. --- src/od.c.orig 2004-01-21 23:27:02.000000000 +0100
  117. +++ src/od.c 2004-03-24 15:29:59.000000000 +0100
  118. @@ -1621,7 +1621,8 @@
  119. int width_specified = 0;
  120. int n_failed_decodes = 0;
  121. int err;
  122. - char const *short_options = (posix2_version () < 200112
  123. + char const *short_options = (posix2_version () < 200112 ||
  124. + !getenv ("POSIXLY_CORRECT")
  125. ? COMMON_SHORT_OPTIONS "s::w::"
  126. : COMMON_SHORT_OPTIONS "s:w:");
  127. --- src/pr.c.orig 2004-01-21 23:27:02.000000000 +0100
  128. +++ src/pr.c 2004-03-24 15:30:48.000000000 +0100
  129. @@ -854,7 +854,8 @@
  130. int old_w = FALSE;
  131. int old_s = FALSE;
  132. char **file_names;
  133. - char const *short_options = (posix2_version () < 200112
  134. + char const *short_options = (posix2_version () < 200112 ||
  135. + !getenv ("POSIXLY_CORRECT")
  136. ? COMMON_SHORT_OPTIONS "S::"
  137. : COMMON_SHORT_OPTIONS "S:");
  138. --- src/sort.c.orig 2004-02-17 11:47:35.000000000 +0100
  139. +++ src/sort.c 2004-03-24 15:31:54.000000000 +0100
  140. @@ -2219,7 +2219,7 @@
  141. bool mergeonly = false;
  142. int nfiles = 0;
  143. bool posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL);
  144. - bool obsolete_usage = (posix2_version () < 200112);
  145. + bool obsolete_usage = (posix2_version () < 200112) || !posixly_correct;
  146. char const *short_options = (obsolete_usage
  147. ? COMMON_SHORT_OPTIONS "y::"
  148. : COMMON_SHORT_OPTIONS "y:");
  149. --- src/split.c.orig 2004-01-21 23:27:02.000000000 +0100
  150. +++ src/split.c 2004-03-24 15:32:48.000000000 +0100
  151. @@ -498,6 +498,8 @@
  152. }
  153. if (digits_optind && 200112 <= posix2_version ())
  154. + if (digits_optind && 200112 <= posix2_version ()
  155. + && getenv ("POSIXLY_CORRECT"))
  156. {
  157. char buffer[INT_BUFSIZE_BOUND (uintmax_t)];
  158. char const *a = umaxtostr (n_units, buffer);
  159. --- src/tail.c.orig 2004-01-21 23:27:02.000000000 +0100
  160. +++ src/tail.c 2004-03-24 15:33:32.000000000 +0100
  161. @@ -1364,7 +1364,7 @@
  162. if (argc < 2)
  163. return 0;
  164. - obsolete_usage = (posix2_version () < 200112);
  165. + obsolete_usage = (posix2_version () < 200112) || !getenv ("POSIXLY_CORRECT");
  166. /* If P starts with `+' and the POSIX version predates 1003.1-2001,
  167. or if P starts with `-N' (where N is a digit), or `-l', then it
  168. --- src/touch.c.orig 2004-01-21 23:27:02.000000000 +0100
  169. +++ src/touch.c 2004-03-24 15:34:28.000000000 +0100
  170. @@ -385,7 +385,7 @@
  171. /* The obsolete `MMDDhhmm[YY]' form is valid IFF there are
  172. two or more non-option arguments. */
  173. if (!date_set && 2 <= argc - optind && !STREQ (argv[optind - 1], "--")
  174. - && posix2_version () < 200112)
  175. + && (posix2_version () < 200112 || !getenv ("POSIXLY_CORRECT")))
  176. {
  177. if (posixtime (&newtime.tv_sec, argv[optind], PDS_TRAILING_YEAR))
  178. {
  179. --- src/unexpand.c.orig 2004-01-21 23:27:02.000000000 +0100
  180. +++ src/unexpand.c 2004-03-24 15:35:09.000000000 +0100
  181. @@ -461,7 +461,8 @@
  182. }
  183. }
  184. - if (obsolete_tablist && 200112 <= posix2_version ())
  185. + if (obsolete_tablist && 200112 <= posix2_version ()
  186. + && getenv ("POSIXLY_CORRECT"))
  187. {
  188. error (0, 0,
  189. _("`-LIST' option is obsolete; use `--first-only -t LIST'"));
  190. --- src/uniq.c.orig 2004-01-21 23:27:02.000000000 +0100
  191. +++ src/uniq.c 2004-03-24 15:36:59.000000000 +0100
  192. @@ -446,7 +446,7 @@
  193. {
  194. unsigned long int size;
  195. if (optarg[0] == '+'
  196. - && posix2_version () < 200112
  197. + && (posix2_version () < 200112 || !getenv ("POSIXLY_CORRECT"))
  198. && xstrtoul (optarg, NULL, 10, &size, "") == LONGINT_OK
  199. && size <= SIZE_MAX)
  200. skip_chars = size;
  201. @@ -531,7 +531,8 @@
  202. }
  203. }
  204. - if (obsolete_skip_fields && 200112 <= posix2_version ())
  205. + if (obsolete_skip_fields && 200112 <= posix2_version ()
  206. + && getenv ("POSIXLY_CORRECT"))
  207. {
  208. error (0, 0, _("`-%lu' option is obsolete; use `-f %lu'"),
  209. (unsigned long) skip_fields, (unsigned long) skip_fields);
  210. Index: doc/Makefile.in
  211. --- doc/Makefile.in.orig 2004-03-11 09:57:59.000000000 +0100
  212. +++ doc/Makefile.in 2004-04-21 15:11:16.000000000 +0200
  213. @@ -319,29 +319,6 @@
  214. cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
  215. .texi.info:
  216. - restore=: && \
  217. - backupdir="$(am__leading_dot)am$$$$" && \
  218. - am__cwd=`pwd` && cd $(srcdir) && \
  219. - rm -rf $$backupdir && mkdir $$backupdir && \
  220. - for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
  221. - if test -f $$f; then \
  222. - mv $$f $$backupdir; \
  223. - restore=mv; \
  224. - fi; \
  225. - done; \
  226. - cd "$$am__cwd"; \
  227. - if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
  228. - -o $@ $<; \
  229. - then \
  230. - rc=0; \
  231. - cd $(srcdir); \
  232. - else \
  233. - rc=$$?; \
  234. - cd $(srcdir) && \
  235. - $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
  236. - fi; \
  237. - rm -rf $$backupdir; \
  238. - exit $$rc
  239. .texi.dvi:
  240. TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \