This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 3.x development tree".
The branch, master has been updated via 6318444799504c6947e574bc88141b35e9106fd5 (commit) via de95f2aeb586c973a78e758deed86efff4d8d498 (commit) via 7cf8ca9c3cfe03bf87300216e253c01e2469713e (commit) via 8f32f7d3e48613d872d24c717daac73b4ea231d1 (commit) via 93c5257574bcb41b989bbe9953ca339c95514e50 (commit) via 0c3143d866bb686e6f2b7ef4d5516c6ead6ad587 (commit) via 61f6dae18bde9414f2f7be2da0c887fd2be6ee69 (commit) via fbb9790bc224f573c5e492fea4d49456a8b92bb5 (commit) via 26bbae115c37fe550da1a68257d293086cfdef95 (commit) via dec0b58bf63b98a7ae0d329410c828d87edf9ad8 (commit) via 7e97512ab58ee56e0ff712a06893b612f3260329 (commit) via 0a32577faccf8ec08914366780a9afba8464ad4e (commit) from 1cfd21d76e5044f821e5abb8e0c1950ee7b5b413 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 6318444799504c6947e574bc88141b35e9106fd5 Merge: de95f2a 61f6dae Author: Michael Tremer michael.tremer@ipfire.org Date: Wed Jan 28 23:02:51 2015 +0100
Merge remote-tracking branch 'stevee/sysvinit'
commit de95f2aeb586c973a78e758deed86efff4d8d498 Merge: 7cf8ca9 7e97512 Author: Michael Tremer michael.tremer@ipfire.org Date: Wed Jan 28 23:02:20 2015 +0100
Merge remote-tracking branch 'stevee/systemd-215'
Conflicts: kmod/kmod.nm
commit 7cf8ca9c3cfe03bf87300216e253c01e2469713e Merge: 8f32f7d 0c3143d Author: Michael Tremer michael.tremer@ipfire.org Date: Wed Jan 28 23:00:28 2015 +0100
Merge remote-tracking branch 'stevee/util-linux-update'
commit 8f32f7d3e48613d872d24c717daac73b4ea231d1 Merge: 93c5257 fbb9790 Author: Michael Tremer michael.tremer@ipfire.org Date: Wed Jan 28 22:59:57 2015 +0100
Merge remote-tracking branch 'stevee/coreutils-update'
commit 93c5257574bcb41b989bbe9953ca339c95514e50 Merge: 1cfd21d dec0b58 Author: Michael Tremer michael.tremer@ipfire.org Date: Wed Jan 28 22:59:21 2015 +0100
Merge remote-tracking branch 'stevee/dracut-update'
commit 0c3143d866bb686e6f2b7ef4d5516c6ead6ad587 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Thu Jan 22 21:53:16 2015 +0100
util-linux: Update to version 2.25.2.
This is a major update to the latest stable version of the util-linux software suite.
* Update project URL. * Enable the "runuser" binary and add pam files. * Force libmount python bindings to be build for python3. * Add new subpackages for libsmartcols and libsmartcols-devel and python3-libmount.
commit 61f6dae18bde9414f2f7be2da0c887fd2be6ee69 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Jan 24 21:09:20 2015 +0100
sysvinit: Remove last lasb and mesg.
These binaries are provided and maintained by util-linux since version 2.25.2.
commit fbb9790bc224f573c5e492fea4d49456a8b92bb5 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Jan 24 12:03:11 2015 +0100
coreutils: Update to 8.23.
commit 26bbae115c37fe550da1a68257d293086cfdef95 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Thu Jan 22 22:27:42 2015 +0100
help2man: Update to 1.46.4.
* Move package arch to "noarch". * Add download URL. * Drop debuginfo package.
commit dec0b58bf63b98a7ae0d329410c828d87edf9ad8 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Dec 27 13:11:46 2014 +0100
dracut: Update to version 40.
commit 7e97512ab58ee56e0ff712a06893b612f3260329 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Sep 6 15:19:37 2014 +0200
systemd: Update to 215.
commit 0a32577faccf8ec08914366780a9afba8464ad4e Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Sep 6 15:07:17 2014 +0200
kmod: Update to version 19.
This is an update to the latest stable version and a requirenment for never versions of systemd.
-----------------------------------------------------------------------
Summary of changes: coreutils/coreutils.nm | 10 +- coreutils/patches/coreutils-i18n.patch | 1248 ++++++++++++++------ .../patches/coreutils-ipfire-disabled-tests.patch | 95 +- coreutils/patches/coreutils-selinux.patch | 656 ---------- coreutils/patches/coreutils-selinuxmanpages.patch | 15 - dracut/dracut.nm | 4 +- help2man/help2man.nm | 20 +- ...emctl-is-enabled-work-for-templated-units.patch | 72 -- systemd/systemd.nm | 10 +- .../patches/sysvinit-2.86-remove-utils-1.patch | 34 +- sysvinit/sysvinit.nm | 33 +- util-linux/pam.d/runuser | 5 + util-linux/pam.d/runuser-l | 5 + util-linux/util-linux.nm | 55 +- 14 files changed, 1040 insertions(+), 1222 deletions(-) delete mode 100644 coreutils/patches/coreutils-selinux.patch delete mode 100644 coreutils/patches/coreutils-selinuxmanpages.patch delete mode 100644 systemd/patches/0001-Make-systemctl-is-enabled-work-for-templated-units.patch create mode 100644 util-linux/pam.d/runuser create mode 100644 util-linux/pam.d/runuser-l
Difference in files: diff --git a/coreutils/coreutils.nm b/coreutils/coreutils.nm index f377aae..af1dae7 100644 --- a/coreutils/coreutils.nm +++ b/coreutils/coreutils.nm @@ -4,7 +4,7 @@ ###############################################################################
name = coreutils -version = 8.21 +version = 8.23 release = 1
groups = System/Base @@ -37,18 +37,18 @@ build
CFLAGS += \ -D_GNU_SOURCE=1 \ - -fno-strict-aliasing + -fno-strict-aliasing \ + -fpic
configure_options += \ + FORCE_UNSAFE_CONFIGURE=1 \ + --enable-dependency-tracking \ --libexecdir=%{libdir} \ - --enable-selinux \ --enable-largefile \ --disable-rpath \ --enable-install-program=arch \ --enable-no-install-program=hostname,kill,uptime \ --with-tty-group \ - \ - gl_cv_func_mknod_works=yes
prepare_cmds autoreconf -vfi diff --git a/coreutils/patches/coreutils-i18n.patch b/coreutils/patches/coreutils-i18n.patch index 0e25f49..eda68eb 100644 --- a/coreutils/patches/coreutils-i18n.patch +++ b/coreutils/patches/coreutils-i18n.patch @@ -1,6 +1,26 @@ -diff -urNp coreutils-8.21-orig/lib/linebuffer.h coreutils-8.21/lib/linebuffer.h ---- coreutils-8.21-orig/lib/linebuffer.h 2013-01-02 13:34:46.000000000 +0100 -+++ coreutils-8.21/lib/linebuffer.h 2013-02-15 14:25:07.758469108 +0100 +Submitted by: Matt Burgess (matthew_at_linuxfromscratch_dot_org) +Date: 2013-12-16 +Initial Package Version: 8.22 (Rebased for version 8.23 by bdubbs@linuxfromscratch.org)) +Upstream Status: Rejected +Origin: Based on Fedora's i18n patch at + http://pkgs.fedoraproject.org/cgit/coreutils.git/plain/coreutils-i18n.patch +Description: Fixes several i18n issues with various Coreutils programs + + +diff -Naur coreutils-8.23.orig/Makefile.in coreutils-8.23/Makefile.in +--- coreutils-8.23.orig/Makefile.in 2014-07-18 17:22:24.000000000 -0500 ++++ coreutils-8.23/Makefile.in 2014-07-18 22:36:17.404066931 -0500 +@@ -5057,6 +5057,7 @@ + tests/misc/chcon.sh \ + tests/misc/chroot-credentials.sh \ + tests/misc/selinux.sh \ ++ tests/misc/sort-mb-tests.sh \ + tests/misc/truncate-owned-by-other.sh \ + tests/mkdir/writable-under-readonly.sh \ + tests/mkdir/smack-root.sh \ +diff -Naur coreutils-8.23.orig/lib/linebuffer.h coreutils-8.23/lib/linebuffer.h +--- coreutils-8.23.orig/lib/linebuffer.h 2014-05-29 07:05:50.000000000 -0500 ++++ coreutils-8.23/lib/linebuffer.h 2014-07-18 22:36:17.392067256 -0500 @@ -21,6 +21,11 @@
# include <stdio.h> @@ -13,7 +33,7 @@ diff -urNp coreutils-8.21-orig/lib/linebuffer.h coreutils-8.21/lib/linebuffer.h /* A 'struct linebuffer' holds a line of text. */
struct linebuffer -@@ -28,6 +33,9 @@ struct linebuffer +@@ -28,6 +33,9 @@ size_t size; /* Allocated. */ size_t length; /* Used. */ char *buffer; @@ -23,9 +43,9 @@ diff -urNp coreutils-8.21-orig/lib/linebuffer.h coreutils-8.21/lib/linebuffer.h };
/* Initialize linebuffer LINEBUFFER for use. */ -diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c ---- coreutils-8.21-orig/src/cut.c 2013-02-05 00:40:31.000000000 +0100 -+++ coreutils-8.21/src/cut.c 2013-02-15 14:25:07.760467982 +0100 +diff -Naur coreutils-8.23.orig/src/cut.c coreutils-8.23/src/cut.c +--- coreutils-8.23.orig/src/cut.c 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/src/cut.c 2014-07-18 22:44:56.489482312 -0500 @@ -28,6 +28,11 @@ #include <assert.h> #include <getopt.h> @@ -57,8 +77,8 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "cut"
-@@ -72,6 +89,52 @@ - } \ +@@ -53,6 +70,52 @@ + } \ while (0)
+/* Refill the buffer BUF to get a multibyte character. */ @@ -75,7 +95,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + while (0) + +/* Get wide character on BUFPOS. BUFPOS is not included after that. -+ If byte sequence is not valid as a character, CONVFAIL is 1. Otherwise 0. */ ++ If byte sequence is not valid as a character, CONVFAIL is true. Otherwise false. */ +#define GET_NEXT_WC_FROM_BUFFER(WC, BUFPOS, BUFLEN, MBLENGTH, STATE, CONVFAIL) \ + do \ + { \ @@ -88,7 +108,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + } \ + \ + /* Get a wide character. */ \ -+ CONVFAIL = 0; \ ++ CONVFAIL = false; \ + state_bak = STATE; \ + MBLENGTH = mbrtowc ((wchar_t *)&WC, BUFPOS, BUFLEN, &STATE); \ + \ @@ -96,7 +116,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + { \ + case (size_t)-1: \ + case (size_t)-2: \ -+ CONVFAIL++; \ ++ CONVFAIL = true; \ + STATE = state_bak; \ + /* Fall througn. */ \ + \ @@ -107,33 +127,19 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + } \ + while (0) + + struct range_pair { - size_t lo; -@@ -90,7 +153,7 @@ static char *field_1_buffer; - /* The number of bytes allocated for FIELD_1_BUFFER. */ - static size_t field_1_bufsize; - --/* The largest field or byte index used as an endpoint of a closed -+/* The largest byte, character or field index used as an endpoint of a closed - or degenerate range specification; this doesn't include the starting - index of right-open-ended ranges. For example, with either range spec - '2-5,9-', '2-3,5,9-' this variable would be set to 5. */ -@@ -102,10 +165,11 @@ static size_t eol_range_start; - - /* This is a bit vector. - In byte mode, which bytes to output. -+ In character mode, which characters to output. - In field mode, which DELIM-separated fields to output. -- Both bytes and fields are numbered starting with 1, -+ Bytes, characters and fields are numbered starting with 1, - so the zeroth bit of this array is unused. -- A field or byte K has been selected if -+ A byte, character or field K has been selected if - (K <= MAX_RANGE_ENDPOINT and is_printable_field(K)) - || (EOL_RANGE_START > 0 && K >= EOL_RANGE_START). */ - static unsigned char *printable_field; -@@ -114,15 +178,25 @@ enum operating_mode +@@ -75,6 +138,8 @@ + /* Number of `struct range_pair's allocated. */ + static size_t n_rp_allocated; + ++/* Length of the delimiter given as argument to -d. */ ++size_t delimlen; + + /* Append LOW, HIGH to the list RP of range pairs, allocating additional + space if necessary. Update global variable N_RP. When allocating, +@@ -106,15 +171,25 @@ { undefined_mode,
@@ -144,7 +150,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + /* Output characters that are at the given positions. */ + character_mode, + - /* Output the given delimeter-separated fields. */ + /* Output the given delimiter-separated fields. */ field_mode };
@@ -157,12 +163,12 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + if this program runs on multibyte locale. */ +static int force_singlebyte_mode; + - /* If true do not output lines containing no delimeter characters. + /* If true do not output lines containing no delimiter characters. Otherwise, all such lines are printed. This option is valid only with field mode. */ -@@ -134,6 +208,9 @@ static bool complement; +@@ -126,6 +201,9 @@
- /* The delimeter character for field mode. */ + /* The delimiter character for field mode. */ static unsigned char delim; +#if HAVE_WCHAR_H +static wchar_t wcdelim; @@ -170,7 +176,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c
/* True if the --output-delimiter=STRING option was specified. */ static bool output_delimiter_specified; -@@ -205,7 +282,7 @@ Print selected parts of lines from each +@@ -188,7 +266,7 @@ -f, --fields=LIST select only these fields; also print any line\n\ that contains no delimiter character, unless\n\ the -s option is specified\n\ @@ -179,7 +185,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c "), stdout); fputs (_("\ --complement complement the set of selected bytes, characters\n\ -@@ -480,6 +557,9 @@ set_fields (const char *fieldstr) +@@ -381,6 +459,9 @@ if (operating_mode == byte_mode) error (0, 0, _("byte offset %s is too large"), quote (bad_num)); @@ -189,7 +195,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c else error (0, 0, _("field number %s is too large"), quote (bad_num)); -@@ -588,6 +668,77 @@ cut_bytes (FILE *stream) +@@ -505,6 +586,82 @@ } }
@@ -205,7 +211,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c +static void +cut_characters_or_cut_bytes_no_split (FILE *stream) +{ -+ int idx; /* number of bytes or characters in the line so far. */ ++ size_t idx; /* number of bytes or characters in the line so far. */ + char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */ + char *bufpos; /* Next read position of BUF. */ + size_t buflen; /* The length of the byte sequence in buf. */ @@ -213,7 +219,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + size_t mblength; /* The byte size of a multibyte character which shows + as same character as WC. */ + mbstate_t state; /* State of the stream. */ -+ int convfail = 0; /* 1, when conversion is failed. Otherwise 0. */ ++ bool convfail = false; /* true, when conversion failed. Otherwise false. */ + /* Whether to begin printing delimiters between ranges for the current line. + Set after we've begun printing data corresponding to the first range. */ + bool print_delimiter = false; @@ -223,11 +229,14 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + bufpos = buf; + memset (&state, '\0', sizeof(mbstate_t)); + ++ current_rp = rp; ++ + while (1) + { + REFILL_BUFFER (buf, bufpos, buflen, stream); + + GET_NEXT_WC_FROM_BUFFER (wc, bufpos, buflen, mblength, state, convfail); ++ (void) convfail; /* ignore unused */ + + if (wc == WEOF) + { @@ -240,20 +249,22 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + putchar ('\n'); + idx = 0; + print_delimiter = false; ++ current_rp = rp; + } + else + { -+ bool range_start; -+ bool *rs = output_delimiter_specified ? &range_start : NULL; -+ idx += (operating_mode == byte_mode) ? mblength : 1; -+ if (print_kth (idx, rs)) ++ next_item (&idx); ++ if (print_kth (idx)) + { -+ if (rs && *rs && print_delimiter) ++ if (output_delimiter_specified) + { -+ fwrite (output_delimiter_string, sizeof (char), -+ output_delimiter_length, stdout); -+ } -+ print_delimiter = true; ++ if (print_delimiter && is_range_start_index (idx)) ++ { ++ fwrite (output_delimiter_string, sizeof (char), ++ output_delimiter_length, stdout); ++ } ++ print_delimiter = true; ++ } + fwrite (bufpos, mblength, sizeof(char), stdout); + } + } @@ -267,7 +278,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c /* Read from stream STREAM, printing to standard output any selected fields. */
static void -@@ -709,13 +860,195 @@ cut_fields (FILE *stream) +@@ -649,13 +806,211 @@ } }
@@ -276,7 +287,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c +cut_fields_mb (FILE *stream) +{ + int c; -+ unsigned int field_idx; ++ size_t field_idx; + int found_any_selected_field; + int buffer_first_field; + int empty_input; @@ -287,7 +298,9 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + size_t mblength; /* The byte size of a multibyte character which shows + as same character as WC. */ + mbstate_t state; /* State of the stream. */ -+ int convfail = 0; /* 1, when conversion is failed. Otherwise 0. */ ++ bool convfail = false; /* true, when conversion failed. Otherwise false. */ ++ ++ current_rp = rp; + + found_any_selected_field = 0; + field_idx = 1; @@ -311,7 +324,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + and the first field has been selected, or if non-delimited lines + must be suppressed and the first field has *not* been selected. + That is because a non-delimited line has exactly one field. */ -+ buffer_first_field = (suppress_non_delimited ^ !print_kth (1, NULL)); ++ buffer_first_field = (suppress_non_delimited ^ !print_kth (1)); + + while (1) + { @@ -361,18 +374,18 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + continue; + } + -+ if (print_kth (1, NULL)) ++ if (print_kth (1)) + { + /* Print the field, but not the trailing delimiter. */ + fwrite (field_1_buffer, sizeof (char), len - 1, stdout); + found_any_selected_field = 1; + } -+ ++field_idx; ++ next_item (&field_idx); + } + + if (wc != WEOF) + { -+ if (print_kth (field_idx, NULL)) ++ if (print_kth (field_idx)) + { + if (found_any_selected_field) + { @@ -398,7 +411,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + break; + } + -+ if (print_kth (field_idx, NULL)) ++ if (print_kth (field_idx)) + fwrite (bufpos, mblength, sizeof(char), stdout); + + buflen -= mblength; @@ -410,7 +423,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + wc = WEOF; + + if (!convfail && wc == wcdelim) -+ ++field_idx; ++ next_item (&field_idx); + else if (wc == WEOF || (!convfail && wc == L'\n')) + { + if (found_any_selected_field @@ -419,6 +432,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + if (wc == WEOF) + break; + field_idx = 1; ++ current_rp = rp; + found_any_selected_field = 0; + } + } @@ -447,6 +461,19 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + break; + + case field_mode: ++ if (delimlen == 1) ++ { ++ /* Check if we have utf8 multibyte locale, so we can use this ++ optimization because of uniqueness of characters, which is ++ not true for e.g. SJIS */ ++ char * loc = setlocale(LC_CTYPE, NULL); ++ if (loc && (strstr (loc, "UTF-8") || strstr (loc, "utf-8") || ++ strstr (loc, "UTF8") || strstr (loc, "utf8"))) ++ { ++ cut_fields (stream); ++ break; ++ } ++ } + cut_fields_mb (stream); + break; + @@ -466,16 +493,15 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c }
/* Process file FILE to standard output. -@@ -767,6 +1100,8 @@ main (int argc, char **argv) +@@ -707,6 +1062,7 @@ bool ok; bool delim_specified = false; char *spec_list_string IF_LINT ( = NULL); + char mbdelim[MB_LEN_MAX + 1]; -+ size_t delimlen = 0;
initialize_main (&argc, &argv); set_program_name (argv[0]); -@@ -789,7 +1124,6 @@ main (int argc, char **argv) +@@ -729,7 +1085,6 @@ switch (optc) { case 'b': @@ -483,7 +509,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c /* Build the byte list. */ if (operating_mode != undefined_mode) FATAL_ERROR (_("only one type of list may be specified")); -@@ -797,6 +1131,14 @@ main (int argc, char **argv) +@@ -737,6 +1092,14 @@ spec_list_string = optarg; break;
@@ -498,7 +524,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c case 'f': /* Build the field list. */ if (operating_mode != undefined_mode) -@@ -808,10 +1150,36 @@ main (int argc, char **argv) +@@ -748,10 +1111,38 @@ case 'd': /* New delimiter. */ /* Interpret -d '' to mean 'use the NUL byte as the delimiter.' */ @@ -524,6 +550,8 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c + FATAL_ERROR (_("the delimiter must be a single character")); + memcpy (mbdelim, optarg, delimlen); + mbdelim[delimlen] = '\0'; ++ if (delimlen == 1) ++ delim = *optarg; + } + } + @@ -539,7 +567,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c break;
case OUTPUT_DELIMITER_OPTION: -@@ -824,6 +1191,7 @@ main (int argc, char **argv) +@@ -764,6 +1155,7 @@ break;
case 'n': @@ -547,7 +575,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c break;
case 's': -@@ -873,15 +1241,34 @@ main (int argc, char **argv) +@@ -803,15 +1195,34 @@ }
if (!delim_specified) @@ -588,11 +616,10 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c }
if (optind == argc) -Binary files coreutils-8.21-orig/src/.cut.c.swp and coreutils-8.21/src/.cut.c.swp differ -diff -urNp coreutils-8.21-orig/src/expand.c coreutils-8.21/src/expand.c ---- coreutils-8.21-orig/src/expand.c 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/src/expand.c 2013-02-15 14:25:07.774467536 +0100 -@@ -37,12 +37,29 @@ +diff -Naur coreutils-8.23.orig/src/expand.c coreutils-8.23/src/expand.c +--- coreutils-8.23.orig/src/expand.c 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/src/expand.c 2014-07-18 22:36:17.394067191 -0500 +@@ -37,12 +37,34 @@ #include <stdio.h> #include <getopt.h> #include <sys/types.h> @@ -602,6 +629,11 @@ diff -urNp coreutils-8.21-orig/src/expand.c coreutils-8.21/src/expand.c +# include <wchar.h> +#endif + ++/* Get iswblank(). */ ++#if HAVE_WCTYPE_H ++# include <wctype.h> ++#endif ++ #include "system.h" #include "error.h" #include "fadvise.h" @@ -622,7 +654,7 @@ diff -urNp coreutils-8.21-orig/src/expand.c coreutils-8.21/src/expand.c /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "expand"
-@@ -357,6 +374,142 @@ expand (void) +@@ -357,6 +379,142 @@ } }
@@ -765,7 +797,7 @@ diff -urNp coreutils-8.21-orig/src/expand.c coreutils-8.21/src/expand.c int main (int argc, char **argv) { -@@ -421,7 +574,12 @@ main (int argc, char **argv) +@@ -421,7 +579,12 @@
file_list = (optind < argc ? &argv[optind] : stdin_argv);
@@ -779,9 +811,9 @@ diff -urNp coreutils-8.21-orig/src/expand.c coreutils-8.21/src/expand.c
if (have_read_stdin && fclose (stdin) != 0) error (EXIT_FAILURE, errno, "-"); -diff -urNp coreutils-8.21-orig/src/fold.c coreutils-8.21/src/fold.c ---- coreutils-8.21-orig/src/fold.c 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/src/fold.c 2013-02-15 14:25:07.789467891 +0100 +diff -Naur coreutils-8.23.orig/src/fold.c coreutils-8.23/src/fold.c +--- coreutils-8.23.orig/src/fold.c 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/src/fold.c 2014-07-18 22:36:17.394067191 -0500 @@ -22,12 +22,34 @@ #include <getopt.h> #include <sys/types.h> @@ -863,7 +895,7 @@ diff -urNp coreutils-8.21-orig/src/fold.c coreutils-8.21/src/fold.c {"spaces", no_argument, NULL, 's'}, {"width", required_argument, NULL, 'w'}, {GETOPT_HELP_OPTION_DECL}, -@@ -76,6 +119,7 @@ standard output.\n\ +@@ -76,6 +119,7 @@
fputs (_("\ -b, --bytes count bytes rather than columns\n\ @@ -871,7 +903,7 @@ diff -urNp coreutils-8.21-orig/src/fold.c coreutils-8.21/src/fold.c -s, --spaces break at spaces\n\ -w, --width=WIDTH use WIDTH columns instead of 80\n\ "), stdout); -@@ -93,7 +137,7 @@ standard output.\n\ +@@ -93,7 +137,7 @@ static size_t adjust_column (size_t column, char c) { @@ -880,7 +912,7 @@ diff -urNp coreutils-8.21-orig/src/fold.c coreutils-8.21/src/fold.c { if (c == '\b') { -@@ -116,30 +160,14 @@ adjust_column (size_t column, char c) +@@ -116,30 +160,14 @@ to stdout, with maximum line length WIDTH. Return true if successful. */
@@ -913,7 +945,7 @@ diff -urNp coreutils-8.21-orig/src/fold.c coreutils-8.21/src/fold.c
fadvise (istream, FADVISE_SEQUENTIAL);
-@@ -169,6 +197,15 @@ fold_file (char const *filename, size_t +@@ -169,6 +197,15 @@ bool found_blank = false; size_t logical_end = offset_out;
@@ -929,16 +961,16 @@ diff -urNp coreutils-8.21-orig/src/fold.c coreutils-8.21/src/fold.c /* Look for the last blank. */ while (logical_end) { -@@ -215,11 +252,221 @@ fold_file (char const *filename, size_t +@@ -215,11 +252,221 @@ line_out[offset_out++] = c; }
- saved_errno = errno; + *saved_errno = errno; - - if (offset_out) - fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); - ++ ++ if (offset_out) ++ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); ++ +} + +#if HAVE_MBRTOWC @@ -1110,10 +1142,10 @@ diff -urNp coreutils-8.21-orig/src/fold.c coreutils-8.21/src/fold.c + } + + *saved_errno = errno; -+ -+ if (offset_out) -+ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); -+ + + if (offset_out) + fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); + +} +#endif + @@ -1122,7 +1154,7 @@ diff -urNp coreutils-8.21-orig/src/fold.c coreutils-8.21/src/fold.c + Return 0 if successful, 1 if an error occurs. */ + +static bool -+fold_file (char *filename, size_t width) ++fold_file (char const *filename, size_t width) +{ + FILE *istream; + int saved_errno; @@ -1152,7 +1184,7 @@ diff -urNp coreutils-8.21-orig/src/fold.c coreutils-8.21/src/fold.c if (ferror (istream)) { error (0, saved_errno, "%s", filename); -@@ -252,7 +499,8 @@ main (int argc, char **argv) +@@ -252,7 +499,8 @@
atexit (close_stdout);
@@ -1162,7 +1194,7 @@ diff -urNp coreutils-8.21-orig/src/fold.c coreutils-8.21/src/fold.c
while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1) { -@@ -261,7 +509,15 @@ main (int argc, char **argv) +@@ -261,7 +509,15 @@ switch (optc) { case 'b': /* Count bytes rather than columns. */ @@ -1179,9 +1211,9 @@ diff -urNp coreutils-8.21-orig/src/fold.c coreutils-8.21/src/fold.c break;
case 's': /* Break at word boundaries. */ -diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c ---- coreutils-8.21-orig/src/join.c 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/src/join.c 2013-02-15 14:25:07.804467922 +0100 +diff -Naur coreutils-8.23.orig/src/join.c coreutils-8.23/src/join.c +--- coreutils-8.23.orig/src/join.c 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/src/join.c 2014-07-18 22:36:17.394067191 -0500 @@ -22,18 +22,32 @@ #include <sys/types.h> #include <getopt.h> @@ -1216,7 +1248,7 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "join"
-@@ -135,10 +149,12 @@ static struct outlist outlist_head; +@@ -135,10 +149,12 @@ /* Last element in 'outlist', where a new element can be added. */ static struct outlist *outlist_end = &outlist_head;
@@ -1233,7 +1265,7 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c
/* If nonzero, check that the input is correctly ordered. */ static enum -@@ -262,13 +278,14 @@ xfields (struct line *line) +@@ -269,13 +285,14 @@ if (ptr == lim) return;
@@ -1251,7 +1283,7 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c { /* Skip leading blanks before the first field. */ while (isblank (to_uchar (*ptr))) -@@ -292,6 +309,148 @@ xfields (struct line *line) +@@ -299,6 +316,147 @@ extract_field (line, ptr, lim - ptr); }
@@ -1272,7 +1304,6 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c + + if (tab != NULL) + { -+ unsigned char t = tab[0]; + char *sep = ptr; + for (; ptr < lim; ptr = sep + mblength) + { @@ -1400,7 +1431,7 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c static void freeline (struct line *line) { -@@ -313,56 +472,130 @@ keycmp (struct line const *line1, struct +@@ -320,56 +478,133 @@ size_t jf_1, size_t jf_2) { /* Start of field to compare in each file. */ @@ -1472,6 +1503,7 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c + { + mallocd = 1; + copy[i] = xmalloc (len[i] + 1); ++ memset (copy[i], '\0',len[i] + 1); + + for (j = 0; j < MIN (len[0], len[1]);) + { @@ -1494,9 +1526,11 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c + if (uwc != wc) + { + mbstate_t state_wc; ++ size_t mblen; + + memset (&state_wc, '\0', sizeof (mbstate_t)); -+ wcrtomb (copy[i] + j, uwc, &state_wc); ++ mblen = wcrtomb (copy[i] + j, uwc, &state_wc); ++ assert (mblen != (size_t)-1); + } + else + memcpy (copy[i] + j, beg[i] + j, mblength); @@ -1526,10 +1560,10 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c - if (hard_LC_COLLATE) - return xmemcoll (beg1, len1, beg2, len2); - diff = memcmp (beg1, beg2, MIN (len1, len2)); -+ copy[0] = (unsigned char *) beg[0]; -+ copy[1] = (unsigned char *) beg[1]; - } - ++ copy[0] = beg[0]; ++ copy[1] = beg[1]; ++ } ++ + if (hard_LC_COLLATE) + { + diff = xmemcoll ((char *) copy[0], len[0], (char *) copy[1], len[1]); @@ -1539,14 +1573,14 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c + free (copy[i]); + + return diff; -+ } + } + diff = memcmp (copy[0], copy[1], MIN (len[0], len[1])); + + if (mallocd) + for (i = 0; i < 2; i++) + free (copy[i]); + -+ + if (diff) return diff; - return len1 < len2 ? -1 : len1 != len2; @@ -1554,7 +1588,7 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c }
/* Check that successive input lines PREV and CURRENT from input file -@@ -454,6 +687,11 @@ get_line (FILE *fp, struct line **linep, +@@ -461,6 +696,11 @@ } ++line_no[which - 1];
@@ -1566,7 +1600,7 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c xfields (line);
if (prevline[which - 1]) -@@ -553,21 +791,28 @@ prfield (size_t n, struct line const *li +@@ -560,21 +800,28 @@
/* Output all the fields in line, other than the join field. */
@@ -1598,7 +1632,7 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c prfield (i, line); } } -@@ -578,7 +823,6 @@ static void +@@ -585,7 +832,6 @@ prjoin (struct line const *line1, struct line const *line2) { const struct outlist *outlist; @@ -1606,16 +1640,16 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c size_t field; struct line const *line;
-@@ -612,7 +856,7 @@ prjoin (struct line const *line1, struct +@@ -619,7 +865,7 @@ o = o->next; if (o == NULL) break; - putchar (output_separator); + PUT_TAB_CHAR; } - putchar ('\n'); + putchar (eolchar); } -@@ -1090,21 +1334,46 @@ main (int argc, char **argv) +@@ -1097,21 +1343,46 @@
case 't': { @@ -1643,7 +1677,7 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c if (! newtab) - newtab = '\n'; /* '' => process the whole line. */ + { -+ newtab = "\n"; /* '' => process the whole line. */ ++ newtab = (char*)"\n"; /* '' => process the whole line. */ + } else if (optarg[1]) { @@ -1671,11 +1705,11 @@ diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c + } break;
- case NOCHECK_ORDER_OPTION: -diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c ---- coreutils-8.21-orig/src/pr.c 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/src/pr.c 2013-02-15 14:25:07.819467936 +0100 -@@ -312,6 +312,32 @@ + case 'z': +diff -Naur coreutils-8.23.orig/src/pr.c coreutils-8.23/src/pr.c +--- coreutils-8.23.orig/src/pr.c 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/src/pr.c 2014-07-18 22:36:17.395067159 -0500 +@@ -312,6 +312,24 @@
#include <getopt.h> #include <sys/types.h> @@ -1697,18 +1731,10 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c +# include <wchar.h> +#endif + -+/* Get iswprint(). -- for wcwidth(). */ -+#if HAVE_WCTYPE_H -+# include <wctype.h> -+#endif -+#if !defined iswprint && !HAVE_ISWPRINT -+# define iswprint(wc) 1 -+#endif -+ #include "system.h" #include "error.h" #include "fadvise.h" -@@ -323,6 +349,18 @@ +@@ -323,6 +341,18 @@ #include "strftime.h" #include "xstrtol.h"
@@ -1727,7 +1753,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "pr"
-@@ -415,7 +453,20 @@ struct COLUMN +@@ -415,7 +445,20 @@
typedef struct COLUMN COLUMN;
@@ -1749,7 +1775,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c static bool read_line (COLUMN *p); static bool print_page (void); static bool print_stored (COLUMN *p); -@@ -425,6 +476,7 @@ static void print_header (void); +@@ -425,6 +468,7 @@ static void pad_across_to (int position); static void add_line_number (COLUMN *p); static void getoptarg (char *arg, char switch_char, char *character, @@ -1757,7 +1783,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c int *number); static void print_files (int number_of_files, char **av); static void init_parameters (int number_of_files); -@@ -438,7 +490,6 @@ static void store_char (char c); +@@ -438,7 +482,6 @@ static void pad_down (int lines); static void read_rest_of_line (COLUMN *p); static void skip_read (COLUMN *p, int column_number); @@ -1765,7 +1791,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c static void cleanup (void); static void print_sep_string (void); static void separator_string (const char *optarg_S); -@@ -450,7 +501,7 @@ static COLUMN *column_vector; +@@ -450,7 +493,7 @@ we store the leftmost columns contiguously in buff. To print a line from buff, get the index of the first character from line_vector[i], and print up to line_vector[i + 1]. */ @@ -1774,7 +1800,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c
/* Index of the position in buff where the next character will be stored. */ -@@ -554,7 +605,7 @@ static int chars_per_column; +@@ -554,7 +597,7 @@ static bool untabify_input = false;
/* (-e) The input tab character. */ @@ -1783,7 +1809,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c
/* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ... where the leftmost column is 1. */ -@@ -564,7 +615,10 @@ static int chars_per_input_tab = 8; +@@ -564,7 +607,10 @@ static bool tabify_output = false;
/* (-i) The output tab character. */ @@ -1795,7 +1821,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c
/* (-i) The width of the output tab. */ static int chars_per_output_tab = 8; -@@ -634,7 +688,13 @@ static int line_number; +@@ -634,7 +680,13 @@ static bool numbered_lines = false;
/* (-n) Character which follows each line number. */ @@ -1810,7 +1836,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c
/* (-n) line counting starts with 1st line of input file (not with 1st line of 1st page printed). */ -@@ -687,6 +747,7 @@ static bool use_col_separator = false; +@@ -687,6 +739,7 @@ -a|COLUMN|-m is a 'space' and with the -J option a 'tab'. */ static char *col_sep_string = (char *) ""; static int col_sep_length = 0; @@ -1818,7 +1844,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c static char *column_separator = (char *) " "; static char *line_separator = (char *) "\t";
-@@ -843,6 +904,13 @@ separator_string (const char *optarg_S) +@@ -843,6 +896,13 @@ col_sep_length = (int) strlen (optarg_S); col_sep_string = xmalloc (col_sep_length + 1); strcpy (col_sep_string, optarg_S); @@ -1832,7 +1858,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c }
int -@@ -867,6 +935,21 @@ main (int argc, char **argv) +@@ -867,6 +927,21 @@
atexit (close_stdout);
@@ -1854,7 +1880,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c n_files = 0; file_names = (argc > 1 ? xmalloc ((argc - 1) * sizeof (char *)) -@@ -943,8 +1026,12 @@ main (int argc, char **argv) +@@ -943,8 +1018,12 @@ break; case 'e': if (optarg) @@ -1869,7 +1895,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c /* Could check tab width > 0. */ untabify_input = true; break; -@@ -957,8 +1044,12 @@ main (int argc, char **argv) +@@ -957,8 +1036,12 @@ break; case 'i': if (optarg) @@ -1884,7 +1910,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c /* Could check tab width > 0. */ tabify_output = true; break; -@@ -985,8 +1076,8 @@ main (int argc, char **argv) +@@ -985,8 +1068,8 @@ case 'n': numbered_lines = true; if (optarg) @@ -1895,7 +1921,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c break; case 'N': skip_count = false; -@@ -1025,7 +1116,7 @@ main (int argc, char **argv) +@@ -1025,7 +1108,7 @@ old_s = false; /* Reset an additional input of -s, -S dominates -s */ col_sep_string = bad_cast (""); @@ -1904,7 +1930,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c use_col_separator = true; if (optarg) separator_string (optarg); -@@ -1182,10 +1273,45 @@ main (int argc, char **argv) +@@ -1182,10 +1265,45 @@ a number. */
static void @@ -1952,7 +1978,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c if (*arg) { long int tmp_long; -@@ -1207,6 +1333,11 @@ static void +@@ -1207,6 +1325,11 @@ init_parameters (int number_of_files) { int chars_used_by_number = 0; @@ -1964,7 +1990,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c
lines_per_body = lines_per_page - lines_per_header - lines_per_footer; if (lines_per_body <= 0) -@@ -1244,7 +1375,7 @@ init_parameters (int number_of_files) +@@ -1244,7 +1367,7 @@ else col_sep_string = column_separator;
@@ -1973,7 +1999,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c use_col_separator = true; } /* It's rather pointless to define a TAB separator with column -@@ -1274,11 +1405,11 @@ init_parameters (int number_of_files) +@@ -1274,11 +1397,11 @@ + TAB_WIDTH (chars_per_input_tab, chars_per_number); */
/* Estimate chars_per_text without any margin and keep it constant. */ @@ -1987,7 +2013,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c
/* The number is part of the column width unless we are printing files in parallel. */ -@@ -1287,7 +1418,7 @@ init_parameters (int number_of_files) +@@ -1287,7 +1410,7 @@ }
chars_per_column = (chars_per_line - chars_used_by_number @@ -1996,7 +2022,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c
if (chars_per_column < 1) error (EXIT_FAILURE, 0, _("page width too narrow")); -@@ -1305,7 +1436,7 @@ init_parameters (int number_of_files) +@@ -1305,7 +1428,7 @@ We've to use 8 as the lower limit, if we use chars_per_default_tab = 8 to expand a tab which is not an input_tab-char. */ free (clump_buff); @@ -2005,7 +2031,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c } /* Open the necessary files, -@@ -1413,7 +1544,7 @@ init_funcs (void) +@@ -1413,7 +1536,7 @@
/* Enlarge p->start_position of first column to use the same form of padding_not_printed with all columns. */ @@ -2014,7 +2040,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c
/* This loop takes care of all but the rightmost column. */
-@@ -1447,7 +1578,7 @@ init_funcs (void) +@@ -1447,7 +1570,7 @@ } else { @@ -2023,7 +2049,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c h_next = h + chars_per_column; } } -@@ -1738,9 +1869,9 @@ static void +@@ -1738,9 +1861,9 @@ align_column (COLUMN *p) { padding_not_printed = p->start_position; @@ -2035,7 +2061,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c padding_not_printed = ANYWHERE; }
-@@ -2011,13 +2142,13 @@ store_char (char c) +@@ -2011,13 +2134,13 @@ /* May be too generous. */ buff = X2REALLOC (buff, &buff_allocated); } @@ -2051,7 +2077,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c char *s; int num_width;
-@@ -2034,22 +2165,24 @@ add_line_number (COLUMN *p) +@@ -2034,22 +2157,24 @@ /* Tabification is assumed for multiple columns, also for n-separators, but 'default n-separator = TAB' hasn't been given priority over equal column_width also specified by POSIX. */ @@ -2080,7 +2106,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c output_position = POS_AFTER_TAB (chars_per_output_tab, output_position); } -@@ -2210,7 +2343,7 @@ print_white_space (void) +@@ -2210,7 +2335,7 @@ while (goal - h_old > 1 && (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal) { @@ -2089,7 +2115,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c h_old = h_new; } while (++h_old <= goal) -@@ -2230,6 +2363,7 @@ print_sep_string (void) +@@ -2230,6 +2355,7 @@ { char *s; int l = col_sep_length; @@ -2097,7 +2123,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c
s = col_sep_string;
-@@ -2243,6 +2377,7 @@ print_sep_string (void) +@@ -2243,6 +2369,7 @@ { for (; separators_not_printed > 0; --separators_not_printed) { @@ -2105,7 +2131,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c while (l-- > 0) { /* 3 types of sep_strings: spaces only, spaces and chars, -@@ -2256,12 +2391,15 @@ print_sep_string (void) +@@ -2256,12 +2383,15 @@ } else { @@ -2122,7 +2148,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c /* sep_string ends with some spaces */ if (spaces_not_printed > 0) print_white_space (); -@@ -2289,7 +2427,7 @@ print_clump (COLUMN *p, int n, char *clu +@@ -2289,7 +2419,7 @@ required number of tabs and spaces. */
static void @@ -2131,7 +2157,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c { if (tabify_output) { -@@ -2313,6 +2451,74 @@ print_char (char c) +@@ -2313,6 +2443,74 @@ putchar (c); }
@@ -2206,7 +2232,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c /* Skip to page PAGE before printing. PAGE may be larger than total number of pages. */
-@@ -2492,9 +2698,9 @@ read_line (COLUMN *p) +@@ -2492,9 +2690,9 @@ align_empty_cols = false; }
@@ -2218,7 +2244,25 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c padding_not_printed = ANYWHERE; }
-@@ -2595,9 +2801,9 @@ print_stored (COLUMN *p) +@@ -2564,7 +2762,7 @@ + int i; + + int line = p->current_line++; +- char *first = &buff[line_vector[line]]; ++ unsigned char *first = &buff[line_vector[line]]; + /* FIXME + UMR: Uninitialized memory read: + * This is occurring while in: +@@ -2576,7 +2774,7 @@ + xmalloc [xmalloc.c:94] + init_store_cols [pr.c:1648] + */ +- char *last = &buff[line_vector[line + 1]]; ++ unsigned char *last = &buff[line_vector[line + 1]]; + + pad_vertically = true; + +@@ -2595,9 +2793,9 @@ } }
@@ -2230,7 +2274,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c padding_not_printed = ANYWHERE; }
-@@ -2610,8 +2816,8 @@ print_stored (COLUMN *p) +@@ -2610,8 +2808,8 @@ if (spaces_not_printed == 0) { output_position = p->start_position + end_vector[line]; @@ -2241,7 +2285,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c }
return true; -@@ -2630,7 +2836,7 @@ print_stored (COLUMN *p) +@@ -2630,7 +2828,7 @@ number of characters is 1.) */
static int @@ -2250,7 +2294,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c { unsigned char uc = c; char *s = clump_buff; -@@ -2640,10 +2846,10 @@ char_to_clump (char c) +@@ -2640,10 +2838,10 @@ int chars; int chars_per_c = 8;
@@ -2263,7 +2307,7 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c { width = TAB_WIDTH (chars_per_c, input_position);
-@@ -2724,6 +2930,154 @@ char_to_clump (char c) +@@ -2724,6 +2922,164 @@ return chars; }
@@ -2410,7 +2454,17 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c + mbc_pos -= mblength; + } + -+ input_position += width; ++ /* Too many backspaces must put us in position 0 -- never negative. */ ++ if (width < 0 && input_position == 0) ++ { ++ chars = 0; ++ input_position = 0; ++ } ++ else if (width < 0 && input_position <= -width) ++ input_position = 0; ++ else ++ input_position += width; ++ + return chars; +} +#endif @@ -2418,9 +2472,9 @@ diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c /* We've just printed some files and need to clean up things before looking for more options and printing the next batch of files.
-diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c ---- coreutils-8.21-orig/src/sort.c 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/src/sort.c 2013-02-15 14:25:07.828467769 +0100 +diff -Naur coreutils-8.23.orig/src/sort.c coreutils-8.23/src/sort.c +--- coreutils-8.23.orig/src/sort.c 2014-07-13 17:09:52.000000000 -0500 ++++ coreutils-8.23/src/sort.c 2014-07-18 22:36:17.397067101 -0500 @@ -29,6 +29,14 @@ #include <sys/wait.h> #include <signal.h> @@ -2436,8 +2490,13 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c #include "system.h" #include "argmatch.h" #include "error.h" -@@ -166,12 +174,34 @@ static int thousands_sep; +@@ -164,14 +172,39 @@ + /* Thousands separator; if -1, then there isn't one. */ + static int thousands_sep;
++/* True if -f is specified. */ ++static bool folding; ++ /* Nonzero if the corresponding locales are hard. */ static bool hard_LC_COLLATE; -#if HAVE_NL_LANGINFO @@ -2472,7 +2531,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c /* The kind of blanks for '-b' to skip in various options. */ enum blanktype { bl_start, bl_end, bl_both };
-@@ -345,13 +375,11 @@ static bool reverse; +@@ -345,13 +378,11 @@ they were read if all keys compare equal. */ static bool stable;
@@ -2489,7 +2548,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c
/* Flag to remove consecutive duplicate lines from the output. Only the last of a sequence of equal lines will be output. */ -@@ -783,6 +811,46 @@ reap_all (void) +@@ -811,6 +842,46 @@ reap (-1); }
@@ -2536,7 +2595,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c /* Clean up any remaining temporary files. */
static void -@@ -1223,7 +1291,7 @@ zaptemp (char const *name) +@@ -1255,7 +1326,7 @@ free (node); }
@@ -2545,7 +2604,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c
static int struct_month_cmp (void const *m1, void const *m2) -@@ -1238,7 +1306,7 @@ struct_month_cmp (void const *m1, void c +@@ -1270,7 +1341,7 @@ /* Initialize the character class tables. */
static void @@ -2554,7 +2613,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c { size_t i;
-@@ -1250,7 +1318,7 @@ inittables (void) +@@ -1282,7 +1353,7 @@ fold_toupper[i] = toupper (i); }
@@ -2563,7 +2622,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c /* If we're not in the "C" locale, read different names for months. */ if (hard_LC_TIME) { -@@ -1332,6 +1400,84 @@ specify_nmerge (int oi, char c, char con +@@ -1364,6 +1435,84 @@ xstrtol_fatal (e, oi, c, long_options, s); }
@@ -2648,7 +2707,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c /* Specify the amount of main memory to use when sorting. */ static void specify_sort_size (int oi, char c, char const *s) -@@ -1564,7 +1710,7 @@ buffer_linelim (struct buffer const *buf +@@ -1597,7 +1746,7 @@ by KEY in LINE. */
static char * @@ -2657,7 +2716,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c { char *ptr = line->text, *lim = ptr + line->length - 1; size_t sword = key->sword; -@@ -1573,10 +1719,10 @@ begfield (struct line const *line, struc +@@ -1606,10 +1755,10 @@ /* The leading field separator itself is included in a field when -t is absent. */
@@ -2670,7 +2729,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c ++ptr; if (ptr < lim) ++ptr; -@@ -1602,11 +1748,70 @@ begfield (struct line const *line, struc +@@ -1635,11 +1784,70 @@ return ptr; }
@@ -2742,7 +2801,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c { char *ptr = line->text, *lim = ptr + line->length - 1; size_t eword = key->eword, echar = key->echar; -@@ -1621,10 +1826,10 @@ limfield (struct line const *line, struc +@@ -1654,10 +1862,10 @@ 'beginning' is the first character following the delimiting TAB. Otherwise, leave PTR pointing at the first 'blank' character after the preceding field. */ @@ -2755,7 +2814,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c ++ptr; if (ptr < lim && (eword || echar)) ++ptr; -@@ -1670,10 +1875,10 @@ limfield (struct line const *line, struc +@@ -1703,10 +1911,10 @@ */
/* Make LIM point to the end of (one byte past) the current field. */ @@ -2768,7 +2827,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c if (newlim) lim = newlim; } -@@ -1704,6 +1909,130 @@ limfield (struct line const *line, struc +@@ -1737,6 +1945,130 @@ return ptr; }
@@ -2857,7 +2916,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c + { + /* If we're skipping leading blanks, don't start counting characters + * until after skipping past any leading blanks. */ -+ if (key->skipsblanks) ++ if (key->skipeblanks) + while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength)) + ptr += mblength; + @@ -2899,7 +2958,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c /* Fill BUF reading from FP, moving buf->left bytes from the end of buf->buf to the beginning first. If EOF is reached and the file wasn't terminated by a newline, supply one. Set up BUF's line -@@ -1790,8 +2119,22 @@ fillbuf (struct buffer *buf, FILE *fp, c +@@ -1823,8 +2155,22 @@ else { if (key->skipsblanks) @@ -2924,7 +2983,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c line->keybeg = line_start; } } -@@ -1912,7 +2255,7 @@ human_numcompare (char const *a, char co +@@ -1945,7 +2291,7 @@ hideously fast. */
static int @@ -2933,7 +2992,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c { while (blanks[to_uchar (*a)]) a++; -@@ -1922,6 +2265,25 @@ numcompare (char const *a, char const *b +@@ -1955,6 +2301,25 @@ return strnumcmp (a, b, decimal_point, thousands_sep); }
@@ -2959,7 +3018,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c /* Work around a problem whereby the long double value returned by glibc's strtold ("NaN", ...) contains uninitialized bits: clear all bytes of A and B before calling strtold. FIXME: remove this function once -@@ -1972,7 +2334,7 @@ general_numcompare (char const *sa, char +@@ -2005,7 +2370,7 @@ Return 0 if the name in S is not recognized. */
static int @@ -2968,7 +3027,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c { size_t lo = 0; size_t hi = MONTHS_PER_YEAR; -@@ -2247,15 +2609,14 @@ debug_key (struct line const *line, stru +@@ -2280,15 +2645,14 @@ char saved = *lim; *lim = '\0';
@@ -2986,7 +3045,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c else if (key->general_numeric) ignore_value (strtold (beg, &tighter_lim)); else if (key->numeric || key->human_numeric) -@@ -2399,7 +2760,7 @@ key_warnings (struct keyfield const *gke +@@ -2432,7 +2796,7 @@ bool maybe_space_aligned = !hard_LC_COLLATE && default_key_compare (key) && !(key->schar || key->echar); bool line_offset = key->eword == 0 && key->echar != 0; /* -k1.x,1.y */ @@ -2995,7 +3054,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c && ((!key->skipsblanks && !(implicit_skip || maybe_space_aligned)) || (!key->skipsblanks && key->schar) || (!key->skipeblanks && key->echar))) -@@ -2457,11 +2818,87 @@ key_warnings (struct keyfield const *gke +@@ -2490,11 +2854,87 @@ error (0, 0, _("option '-r' only applies to last-resort comparison")); }
@@ -3065,7 +3124,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c + ? monthtab[lo].val : 0); + + if (ea && result) -+ *ea = s + strlen (monthtab[lo].name); ++ *ea = (char*) s + strlen (monthtab[lo].name); + + free (month); + free (tmp); @@ -3084,7 +3143,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c { struct keyfield *key = keylist;
-@@ -2546,7 +2983,7 @@ keycompare (struct line const *a, struct +@@ -2579,7 +3019,7 @@ else if (key->human_numeric) diff = human_numcompare (ta, tb); else if (key->month) @@ -3093,7 +3152,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c else if (key->random) diff = compare_random (ta, tlena, tb, tlenb); else if (key->version) -@@ -2662,6 +3099,181 @@ keycompare (struct line const *a, struct +@@ -2695,6 +3135,191 @@ return key->reverse ? -diff : diff; }
@@ -3114,45 +3173,14 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c + wchar_t wc_a, wc_b; + mbstate_t state_a, state_b; + -+ int diff; ++ int diff = 0; + + memset (&state_a, '\0', sizeof(mbstate_t)); + memset (&state_b, '\0', sizeof(mbstate_t)); ++ /* Ignore keys with start after end. */ ++ if (a->keybeg - a->keylim > 0) ++ return 0; + -+ for (;;) -+ { -+ char const *translate = key->translate; -+ bool const *ignore = key->ignore; -+ -+ /* Find the lengths. */ -+ size_t lena = lima <= texta ? 0 : lima - texta; -+ size_t lenb = limb <= textb ? 0 : limb - textb; -+ -+ /* Actually compare the fields. */ -+ if (key->random) -+ diff = compare_random (texta, lena, textb, lenb); -+ else if (key->numeric | key->general_numeric | key->human_numeric) -+ { -+ char savea = *lima, saveb = *limb; -+ -+ *lima = *limb = '\0'; -+ diff = (key->numeric ? numcompare (texta, textb) -+ : key->general_numeric ? general_numcompare (texta, textb) -+ : human_numcompare (texta, textb)); -+ *lima = savea, *limb = saveb; -+ } -+ else if (key->version) -+ diff = filevercmp (texta, textb); -+ else if (key->month) -+ diff = getmonth (texta, lena, NULL) - getmonth (textb, lenb, NULL); -+ else -+ { -+ if (ignore || translate) -+ { -+ char *copy_a = (char *) xmalloc (lena + 1 + lenb + 1); -+ char *copy_b = copy_a + lena + 1; -+ size_t new_len_a, new_len_b; -+ size_t i, j; + + /* Ignore and/or translate chars before comparing. */ +# define IGNORE_CHARS(NEW_LEN, LEN, TEXT, COPY, WC, MBLENGTH, STATE) \ @@ -3220,21 +3248,63 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c + COPY[NEW_LEN] = '\0'; \ + } \ + while (0) -+ IGNORE_CHARS (new_len_a, lena, texta, copy_a, -+ wc_a, mblength_a, state_a); -+ IGNORE_CHARS (new_len_b, lenb, textb, copy_b, -+ wc_b, mblength_b, state_b); -+ diff = xmemcoll (copy_a, new_len_a, copy_b, new_len_b); -+ free(copy_a); -+ } -+ else if (lena == 0) -+ diff = - NONZERO (lenb); -+ else if (lenb == 0) -+ goto greater; -+ else -+ diff = xmemcoll (texta, lena, textb, lenb); ++ ++ /* Actually compare the fields. */ ++ ++ for (;;) ++ { ++ /* Find the lengths. */ ++ size_t lena = lima <= texta ? 0 : lima - texta; ++ size_t lenb = limb <= textb ? 0 : limb - textb; ++ ++ char const *translate = key->translate; ++ bool const *ignore = key->ignore; ++ ++ if (ignore || translate) ++ { ++ char *copy_a = (char *) xmalloc (lena + 1 + lenb + 1); ++ char *copy_b = copy_a + lena + 1; ++ size_t new_len_a, new_len_b; ++ size_t i, j; ++ ++ IGNORE_CHARS (new_len_a, lena, texta, copy_a, ++ wc_a, mblength_a, state_a); ++ IGNORE_CHARS (new_len_b, lenb, textb, copy_b, ++ wc_b, mblength_b, state_b); ++ texta = copy_a; textb = copy_b; ++ lena = new_len_a; lenb = new_len_b; + } + ++ if (key->random) ++ diff = compare_random (texta, lena, textb, lenb); ++ else if (key->numeric | key->general_numeric | key->human_numeric) ++ { ++ char savea = *lima, saveb = *limb; ++ ++ *lima = *limb = '\0'; ++ diff = (key->numeric ? numcompare (texta, textb) ++ : key->general_numeric ? general_numcompare (texta, textb) ++ : human_numcompare (texta, textb)); ++ *lima = savea, *limb = saveb; ++ } ++ else if (key->version) ++ diff = filevercmp (texta, textb); ++ else if (key->month) ++ diff = getmonth (texta, lena, NULL) - getmonth (textb, lenb, NULL); ++ else if (lena == 0) ++ diff = - NONZERO (lenb); ++ else if (lenb == 0) ++ diff = 1; ++ else if (hard_LC_COLLATE && !folding) ++ { ++ diff = xmemcoll0 (texta, lena, textb, lenb); ++ } ++ else ++ diff = memcmp (texta, textb, MIN (lena + 1,lenb + 1)); ++ ++ if (ignore || translate) ++ free (texta); ++ + if (diff) + goto not_equal; + @@ -3263,19 +3333,35 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c + } + } + -+ return 0; -+ -+greater: -+ diff = 1; +not_equal: -+ return key->reverse ? -diff : diff; ++ if (key && key->reverse) ++ return -diff; ++ else ++ return diff; +} +#endif + /* Compare two lines A and B, returning negative, zero, or positive depending on whether A compares less than, equal to, or greater than B. */
-@@ -4157,7 +4769,7 @@ main (int argc, char **argv) +@@ -2722,7 +3347,7 @@ + diff = - NONZERO (blen); + else if (blen == 0) + diff = 1; +- else if (hard_LC_COLLATE) ++ else if (hard_LC_COLLATE && !folding) + { + /* Note xmemcoll0 is a performance enhancement as + it will not unconditionally write '\0' after the +@@ -4121,6 +4746,7 @@ + break; + case 'f': + key->translate = fold_toupper; ++ folding = true; + break; + case 'g': + key->general_numeric = true; +@@ -4198,7 +4824,7 @@ initialize_exit_failure (SORT_FAILURE);
hard_LC_COLLATE = hard_locale (LC_COLLATE); @@ -3284,7 +3370,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c hard_LC_TIME = hard_locale (LC_TIME); #endif
-@@ -4178,6 +4790,29 @@ main (int argc, char **argv) +@@ -4219,6 +4845,29 @@ thousands_sep = -1; }
@@ -3314,7 +3400,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c have_read_stdin = false; inittables ();
-@@ -4452,13 +5087,34 @@ main (int argc, char **argv) +@@ -4493,13 +5142,34 @@
case 't': { @@ -3353,7 +3439,7 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c else { /* Provoke with 'sort -txx'. Complain about -@@ -4469,9 +5125,12 @@ main (int argc, char **argv) +@@ -4510,9 +5180,12 @@ quote (optarg)); } } @@ -3368,9 +3454,9 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c } break;
-diff -urNp coreutils-8.21-orig/src/unexpand.c coreutils-8.21/src/unexpand.c ---- coreutils-8.21-orig/src/unexpand.c 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/src/unexpand.c 2013-02-15 14:25:07.834467715 +0100 +diff -Naur coreutils-8.23.orig/src/unexpand.c coreutils-8.23/src/unexpand.c +--- coreutils-8.23.orig/src/unexpand.c 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/src/unexpand.c 2014-07-18 22:36:17.397067101 -0500 @@ -38,12 +38,29 @@ #include <stdio.h> #include <getopt.h> @@ -3401,7 +3487,7 @@ diff -urNp coreutils-8.21-orig/src/unexpand.c coreutils-8.21/src/unexpand.c /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "unexpand"
-@@ -103,6 +120,210 @@ static struct option const longopts[] = +@@ -103,6 +120,210 @@ {NULL, 0, NULL, 0} };
@@ -3612,7 +3698,7 @@ diff -urNp coreutils-8.21-orig/src/unexpand.c coreutils-8.21/src/unexpand.c void usage (int status) { -@@ -523,7 +742,12 @@ main (int argc, char **argv) +@@ -523,7 +744,12 @@
file_list = (optind < argc ? &argv[optind] : stdin_argv);
@@ -3626,10 +3712,10 @@ diff -urNp coreutils-8.21-orig/src/unexpand.c coreutils-8.21/src/unexpand.c
if (have_read_stdin && fclose (stdin) != 0) error (EXIT_FAILURE, errno, "-"); -diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c ---- coreutils-8.21-orig/src/uniq.c 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/src/uniq.c 2013-02-15 14:25:07.839467991 +0100 -@@ -21,6 +21,16 @@ +diff -Naur coreutils-8.23.orig/src/uniq.c coreutils-8.23/src/uniq.c +--- coreutils-8.23.orig/src/uniq.c 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/src/uniq.c 2014-07-18 22:36:17.398067074 -0500 +@@ -21,6 +21,17 @@ #include <getopt.h> #include <sys/types.h>
@@ -3642,11 +3728,12 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c +#if HAVE_WCTYPE_H +# include <wctype.h> +#endif ++#include <assert.h> + #include "system.h" #include "argmatch.h" #include "linebuffer.h" -@@ -32,7 +42,19 @@ +@@ -32,7 +43,19 @@ #include "stdio--.h" #include "xmemcoll.h" #include "xstrtol.h" @@ -3667,9 +3754,9 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c
/* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "uniq" -@@ -108,6 +130,10 @@ static enum delimit_method const delimit - /* Select whether/how to delimit groups of duplicate lines. */ - static enum delimit_method delimit_groups; +@@ -143,6 +166,10 @@ + GROUP_OPTION = CHAR_MAX + 1 + };
+/* Function pointers. */ +static char * @@ -3678,7 +3765,7 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c static struct option const longopts[] = { {"count", no_argument, NULL, 'c'}, -@@ -205,7 +231,7 @@ size_opt (char const *opt, char const *m +@@ -251,7 +278,7 @@ return a pointer to the beginning of the line's field to be compared. */
static char * _GL_ATTRIBUTE_PURE @@ -3687,7 +3774,7 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c { size_t count; char const *lp = line->buffer; -@@ -225,6 +251,83 @@ find_field (struct linebuffer const *lin +@@ -271,6 +298,83 @@ return line->buffer + i; }
@@ -3771,7 +3858,7 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c /* Return false if two strings OLD and NEW match, true if not. OLD and NEW point not to the beginnings of the lines but rather to the beginnings of the fields to compare. -@@ -233,6 +336,8 @@ find_field (struct linebuffer const *lin +@@ -279,6 +383,8 @@ static bool different (char *old, char *new, size_t oldlen, size_t newlen) { @@ -3780,7 +3867,7 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c if (check_chars < oldlen) oldlen = check_chars; if (check_chars < newlen) -@@ -240,14 +345,100 @@ different (char *old, char *new, size_t +@@ -286,15 +392,104 @@
if (ignore_case) { @@ -3812,8 +3899,8 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c + + return xmemcoll (copy_old, oldlen, copy_new, newlen); + -+} -+ + } + +#if HAVE_MBRTOWC +static int +different_multi (const char *old, const char *new, size_t oldlen, size_t newlen, mbstate_t oldstate, mbstate_t newstate) @@ -3837,6 +3924,7 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c + for (i = 0; i < 2; i++) + { + copy[i] = xmalloc (len[i] + 1); ++ memset (copy[i], '\0', len[i] + 1); + + for (j = 0, chars = 0; j < len[i] && chars < check_chars; chars++) + { @@ -3861,9 +3949,11 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c + if (uwc != wc) + { + mbstate_t state_wc; ++ size_t mblen; + + memset (&state_wc, '\0', sizeof(mbstate_t)); -+ wcrtomb (copy[i] + j, uwc, &state_wc); ++ mblen = wcrtomb (copy[i] + j, uwc, &state_wc); ++ assert (mblen != (size_t)-1); + } + else + memcpy (copy[i] + j, str[i] + j, mblength); @@ -3881,15 +3971,16 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c + free (copy[1]); + return rc; + - } ++} +#endif - ++ /* Output the line in linebuffer LINE to standard output provided that the switches say it should be output. -@@ -303,15 +494,43 @@ check_file (const char *infile, const ch - { + MATCH is true if the line matches the previous line. +@@ -358,19 +553,38 @@ char *prevfield IF_LINT ( = NULL); size_t prevlen IF_LINT ( = 0); + bool first_group_printed = false; +#if HAVE_MBRTOWC + mbstate_t prevstate; + @@ -3900,37 +3991,43 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c { char *thisfield; size_t thislen; + bool new_group; +#if HAVE_MBRTOWC + mbstate_t thisstate; +#endif -+ + if (readlinebuffer_delim (thisline, stdin, delimiter) == 0) break; + thisfield = find_field (thisline); thislen = thisline->length - 1 - (thisfield - thisline->buffer); +#if HAVE_MBRTOWC + if (MB_CUR_MAX > 1) + { -+ thisstate = thisline->state; -+ -+ if (prevline->length == 0 || different_multi -+ (thisfield, prevfield, thislen, prevlen, thisstate, prevstate)) -+ { -+ fwrite (thisline->buffer, sizeof (char), -+ thisline->length, stdout); -+ -+ SWAP_LINES (prevline, thisline); -+ prevfield = thisfield; -+ prevlen = thislen; ++ thisstate = thisline->state; + ++ new_group = (prevline->length == 0 ++ || different_multi (thisfield, prevfield, ++ thislen, prevlen, ++ thisstate, prevstate)); ++ } ++ else ++#endif + new_group = (prevline->length == 0 + || different (thisfield, prevfield, thislen, prevlen)); + +@@ -388,6 +602,10 @@ + SWAP_LINES (prevline, thisline); + prevfield = thisfield; + prevlen = thislen; ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) + prevstate = thisstate; -+ } -+ } -+ else +#endif - if (prevline->length == 0 - || different (thisfield, prevfield, thislen, prevlen)) - { -@@ -330,17 +549,26 @@ check_file (const char *infile, const ch + first_group_printed = true; + } + } +@@ -400,17 +618,26 @@ size_t prevlen; uintmax_t match_count = 0; bool first_delimiter = true; @@ -3957,7 +4054,7 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c if (readlinebuffer_delim (thisline, stdin, delimiter) == 0) { if (ferror (stdin)) -@@ -349,6 +577,14 @@ check_file (const char *infile, const ch +@@ -419,6 +646,14 @@ } thisfield = find_field (thisline); thislen = thisline->length - 1 - (thisfield - thisline->buffer); @@ -3972,7 +4069,7 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c match = !different (thisfield, prevfield, thislen, prevlen); match_count += match;
-@@ -381,6 +617,9 @@ check_file (const char *infile, const ch +@@ -451,6 +686,9 @@ SWAP_LINES (prevline, thisline); prevfield = thisfield; prevlen = thislen; @@ -3982,7 +4079,7 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c if (!match) match_count = 0; } -@@ -426,6 +665,19 @@ main (int argc, char **argv) +@@ -497,6 +735,19 @@
atexit (close_stdout);
@@ -4002,10 +4099,10 @@ diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c skip_chars = 0; skip_fields = 0; check_chars = SIZE_MAX; -diff -urNp coreutils-8.21-orig/tests/local.mk coreutils-8.21/tests/local.mk ---- coreutils-8.21-orig/tests/local.mk 2013-02-15 14:24:32.645654553 +0100 -+++ coreutils-8.21/tests/local.mk 2013-02-15 14:25:07.873467648 +0100 -@@ -325,6 +325,7 @@ all_tests = \ +diff -Naur coreutils-8.23.orig/tests/local.mk coreutils-8.23/tests/local.mk +--- coreutils-8.23.orig/tests/local.mk 2014-07-13 17:09:52.000000000 -0500 ++++ coreutils-8.23/tests/local.mk 2014-07-18 22:36:17.398067074 -0500 +@@ -331,6 +331,7 @@ tests/misc/sort-discrim.sh \ tests/misc/sort-files0-from.pl \ tests/misc/sort-float.sh \ @@ -4013,31 +4110,39 @@ diff -urNp coreutils-8.21-orig/tests/local.mk coreutils-8.21/tests/local.mk tests/misc/sort-merge.pl \ tests/misc/sort-merge-fdlimit.sh \ tests/misc/sort-month.sh \ -diff -urNp coreutils-8.21-orig/tests/misc/cut.pl coreutils-8.21/tests/misc/cut.pl ---- coreutils-8.21-orig/tests/misc/cut.pl 2013-02-05 00:40:31.000000000 +0100 -+++ coreutils-8.21/tests/misc/cut.pl 2013-02-15 14:27:18.974468564 +0100 -@@ -23,9 +23,10 @@ use strict; +diff -Naur coreutils-8.23.orig/tests/misc/cut.pl coreutils-8.23/tests/misc/cut.pl +--- coreutils-8.23.orig/tests/misc/cut.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/cut.pl 2014-07-18 22:36:17.398067074 -0500 +@@ -23,9 +23,11 @@ # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
-my $mb_locale = $ENV{LOCALE_FR_UTF8}; --! defined $mb_locale || $mb_locale eq 'none' ++my $mb_locale; ++# uncommented enable multibyte paths ++$mb_locale = $ENV{LOCALE_FR_UTF8}; + ! defined $mb_locale || $mb_locale eq 'none' - and $mb_locale = 'C'; -+#my $mb_locale = $ENV{LOCALE_FR_UTF8}; -+#! defined $mb_locale || $mb_locale eq 'none' -+# and $mb_locale = 'C'; -+my $mb_locale = 'C'; ++ and $mb_locale = 'C';
my $prog = 'cut'; my $try = "Try '$prog --help' for more information.\n"; -diff -urNp coreutils-8.21-orig/tests/misc/expand.pl coreutils-8.21/tests/misc/expand.pl ---- coreutils-8.21-orig/tests/misc/expand.pl 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/tests/misc/expand.pl 2013-02-15 14:25:07.891468472 +0100 -@@ -23,6 +23,15 @@ use strict; +@@ -227,6 +229,7 @@ + my @new_t = @$t; + my $test_name = shift @new_t; + ++ next if ($test_name =~ "newline-[12][0-9]"); + push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; + } + push @Tests, @new; +diff -Naur coreutils-8.23.orig/tests/misc/expand.pl coreutils-8.23/tests/misc/expand.pl +--- coreutils-8.23.orig/tests/misc/expand.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/expand.pl 2014-07-18 22:36:17.399067050 -0500 +@@ -23,6 +23,15 @@ # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
-+# uncommented according to upstream commit enabling multibyte paths ++#comment out next line to disable multibyte tests +my $mb_locale = $ENV{LOCALE_FR_UTF8}; +! defined $mb_locale || $mb_locale eq 'none' + and $mb_locale = 'C'; @@ -4049,7 +4154,7 @@ diff -urNp coreutils-8.21-orig/tests/misc/expand.pl coreutils-8.21/tests/misc/ex my @Tests = ( ['t1', '--tabs=3', {IN=>"a\tb"}, {OUT=>"a b"}], -@@ -31,6 +40,37 @@ my @Tests = +@@ -31,6 +40,37 @@ ['i2', '--tabs=3 -i', {IN=>" \ta\tb"}, {OUT=>" a\tb"}], );
@@ -4087,41 +4192,150 @@ diff -urNp coreutils-8.21-orig/tests/misc/expand.pl coreutils-8.21/tests/misc/ex my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE};
-diff -urNp coreutils-8.21-orig/tests/misc/mb1.I coreutils-8.21/tests/misc/mb1.I ---- coreutils-8.21-orig/tests/misc/mb1.I 1970-01-01 01:00:00.000000000 +0100 -+++ coreutils-8.21/tests/misc/mb1.I 2013-02-15 14:25:07.902467891 +0100 -@@ -0,0 +1,4 @@ -+Apple@10 -+Banana@5 -+Citrus@20 -+Cherry@30 -diff -urNp coreutils-8.21-orig/tests/misc/mb1.X coreutils-8.21/tests/misc/mb1.X ---- coreutils-8.21-orig/tests/misc/mb1.X 1970-01-01 01:00:00.000000000 +0100 -+++ coreutils-8.21/tests/misc/mb1.X 2013-02-15 14:25:07.917467426 +0100 -@@ -0,0 +1,4 @@ -+Banana@5 -+Apple@10 -+Citrus@20 -+Cherry@30 -diff -urNp coreutils-8.21-orig/tests/misc/mb2.I coreutils-8.21/tests/misc/mb2.I ---- coreutils-8.21-orig/tests/misc/mb2.I 1970-01-01 01:00:00.000000000 +0100 -+++ coreutils-8.21/tests/misc/mb2.I 2013-02-15 14:25:07.933467390 +0100 -@@ -0,0 +1,4 @@ -+Apple@AA10@@20 -+Banana@AA5@@30 -+Citrus@AA20@@5 -+Cherry@AA30@@10 -diff -urNp coreutils-8.21-orig/tests/misc/mb2.X coreutils-8.21/tests/misc/mb2.X ---- coreutils-8.21-orig/tests/misc/mb2.X 1970-01-01 01:00:00.000000000 +0100 -+++ coreutils-8.21/tests/misc/mb2.X 2013-02-15 14:25:08.002467808 +0100 -@@ -0,0 +1,4 @@ -+Citrus@AA20@@5 -+Cherry@AA30@@10 -+Apple@AA10@@20 -+Banana@AA5@@30 -diff -urNp coreutils-8.21-orig/tests/misc/sort-mb-tests.sh coreutils-8.21/tests/misc/sort-mb-tests.sh ---- coreutils-8.21-orig/tests/misc/sort-mb-tests.sh 1970-01-01 01:00:00.000000000 +0100 -+++ coreutils-8.21/tests/misc/sort-mb-tests.sh 2013-02-18 17:44:03.852275681 +0100 +diff -Naur coreutils-8.23.orig/tests/misc/fold.pl coreutils-8.23/tests/misc/fold.pl +--- coreutils-8.23.orig/tests/misc/fold.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/fold.pl 2014-07-18 22:36:17.399067050 -0500 +@@ -20,9 +20,18 @@ + + (my $program_name = $0) =~ s|.*/||; + ++my $prog = 'fold'; ++my $try = "Try `$prog --help' for more information.\n"; ++my $inval = "$prog: invalid byte, character or field list\n$try"; ++ + # Turn off localization of executable's output. + @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + ++# uncommented to enable multibyte paths ++my $mb_locale = $ENV{LOCALE_FR_UTF8}; ++! defined $mb_locale || $mb_locale eq 'none' ++ and $mb_locale = 'C'; ++ + my @Tests = + ( + ['s1', '-w2 -s', {IN=>"a\t"}, {OUT=>"a\n\t"}], +@@ -31,9 +40,48 @@ + ['s4', '-w4 -s', {IN=>"abc ef\n"}, {OUT=>"abc \nef\n"}], + ); + ++# Add _POSIX2_VERSION=199209 to the environment of each test ++# that uses an old-style option like +1. ++if ($mb_locale ne 'C') ++ { ++ # Duplicate each test vector, appending "-mb" to the test name and ++ # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we ++ # provide coverage for the distro-added multi-byte code paths. ++ my @new; ++ foreach my $t (@Tests) ++ { ++ my @new_t = @$t; ++ my $test_name = shift @new_t; ++ ++ # Depending on whether fold is multi-byte-patched, ++ # it emits different diagnostics: ++ # non-MB: invalid byte or field list ++ # MB: invalid byte, character or field list ++ # Adjust the expected error output accordingly. ++ if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval} ++ (@new_t)) ++ { ++ my $sub = {ERR_SUBST => 's/, character//'}; ++ push @new_t, $sub; ++ push @$t, $sub; ++ } ++ push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; ++ } ++ push @Tests, @new; ++ } ++ ++@Tests = triple_test @Tests; ++ ++# Remember that triple_test creates from each test with exactly one "IN" ++# file two more tests (.p and .r suffix on name) corresponding to reading ++# input from a file and from a pipe. The pipe-reading test would fail ++# due to a race condition about 1 in 20 times. ++# Remove the IN_PIPE version of the "output-is-input" test above. ++# The others aren't susceptible because they have three inputs each. ++@Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests; ++ + my $save_temps = $ENV{DEBUG}; + my $verbose = $ENV{VERBOSE}; + +-my $prog = 'fold'; + my $fail = run_tests ($program_name, $prog, @Tests, $save_temps, $verbose); + exit $fail; +diff -Naur coreutils-8.23.orig/tests/misc/join.pl coreutils-8.23/tests/misc/join.pl +--- coreutils-8.23.orig/tests/misc/join.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/join.pl 2014-07-18 22:36:17.399067050 -0500 +@@ -25,6 +25,15 @@ + + my $prog = 'join'; + ++my $try = "Try `$prog --help' for more information.\n"; ++my $inval = "$prog: invalid byte, character or field list\n$try"; ++ ++my $mb_locale; ++#Comment out next line to disable multibyte tests ++$mb_locale = $ENV{LOCALE_FR_UTF8}; ++! defined $mb_locale || $mb_locale eq 'none' ++ and $mb_locale = 'C'; ++ + my $delim = chr 0247; + sub t_subst ($) + { +@@ -326,8 +335,49 @@ + push @Tests, $new_ent; + } + ++# Add _POSIX2_VERSION=199209 to the environment of each test ++# that uses an old-style option like +1. ++if ($mb_locale ne 'C') ++ { ++ # Duplicate each test vector, appending "-mb" to the test name and ++ # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we ++ # provide coverage for the distro-added multi-byte code paths. ++ my @new; ++ foreach my $t (@Tests) ++ { ++ my @new_t = @$t; ++ my $test_name = shift @new_t; ++ ++ # Depending on whether join is multi-byte-patched, ++ # it emits different diagnostics: ++ # non-MB: invalid byte or field list ++ # MB: invalid byte, character or field list ++ # Adjust the expected error output accordingly. ++ if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval} ++ (@new_t)) ++ { ++ my $sub = {ERR_SUBST => 's/, character//'}; ++ push @new_t, $sub; ++ push @$t, $sub; ++ } ++ #Adjust the output some error messages including test_name for mb ++ if (grep {ref $_ eq 'HASH' && exists $_->{ERR}} ++ (@new_t)) ++ { ++ my $sub2 = {ERR_SUBST => "s/$test_name-mb/$test_name/"}; ++ push @new_t, $sub2; ++ push @$t, $sub2; ++ } ++ push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; ++ } ++ push @Tests, @new; ++ } ++ + @Tests = triple_test @Tests; + ++#skip invalid-j-mb test, it is failing because of the format ++@Tests = grep {$_->[0] ne 'invalid-j-mb'} @Tests; ++ + my $save_temps = $ENV{DEBUG}; + my $verbose = $ENV{VERBOSE}; + +diff -Naur coreutils-8.23.orig/tests/misc/sort-mb-tests.sh coreutils-8.23/tests/misc/sort-mb-tests.sh +--- coreutils-8.23.orig/tests/misc/sort-mb-tests.sh 1969-12-31 18:00:00.000000000 -0600 ++++ coreutils-8.23/tests/misc/sort-mb-tests.sh 2014-07-18 22:36:17.399067050 -0500 @@ -0,0 +1,45 @@ +#!/bin/sh +# Verify sort's multi-byte support. @@ -4168,3 +4382,327 @@ diff -urNp coreutils-8.21-orig/tests/misc/sort-mb-tests.sh coreutils-8.21/tests/ +compare exp out || { fail=1; cat out; } + +Exit $fail +diff -Naur coreutils-8.23.orig/tests/misc/sort-merge.pl coreutils-8.23/tests/misc/sort-merge.pl +--- coreutils-8.23.orig/tests/misc/sort-merge.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/sort-merge.pl 2014-07-18 22:36:17.399067050 -0500 +@@ -26,6 +26,15 @@ + # Turn off localization of executable's output. + @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + ++my $mb_locale; ++# uncommented according to upstream commit enabling multibyte paths ++$mb_locale = $ENV{LOCALE_FR_UTF8}; ++! defined $mb_locale || $mb_locale eq 'none' ++ and $mb_locale = 'C'; ++ ++my $try = "Try `$prog --help' for more information.\n"; ++my $inval = "$prog: invalid byte, character or field list\n$try"; ++ + # three empty files and one that says 'foo' + my @inputs = (+(map{{IN=> {"empty$_"=> ''}}}1..3), {IN=> {foo=> "foo\n"}}); + +@@ -77,6 +86,39 @@ + {OUT=>$big_input}], + ); + ++# Add _POSIX2_VERSION=199209 to the environment of each test ++# that uses an old-style option like +1. ++if ($mb_locale ne 'C') ++ { ++ # Duplicate each test vector, appending "-mb" to the test name and ++ # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we ++ # provide coverage for the distro-added multi-byte code paths. ++ my @new; ++ foreach my $t (@Tests) ++ { ++ my @new_t = @$t; ++ my $test_name = shift @new_t; ++ ++ # Depending on whether sort is multi-byte-patched, ++ # it emits different diagnostics: ++ # non-MB: invalid byte or field list ++ # MB: invalid byte, character or field list ++ # Adjust the expected error output accordingly. ++ if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval} ++ (@new_t)) ++ { ++ my $sub = {ERR_SUBST => 's/, character//'}; ++ push @new_t, $sub; ++ push @$t, $sub; ++ } ++ next if ($test_name =~ "nmerge-."); ++ push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; ++ } ++ push @Tests, @new; ++ } ++ ++@Tests = triple_test @Tests; ++ + my $save_temps = $ENV{DEBUG}; + my $verbose = $ENV{VERBOSE}; + +diff -Naur coreutils-8.23.orig/tests/misc/sort.pl coreutils-8.23/tests/misc/sort.pl +--- coreutils-8.23.orig/tests/misc/sort.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/sort.pl 2014-07-18 22:36:17.400067026 -0500 +@@ -24,10 +24,15 @@ + # Turn off localization of executable's output. + @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + +-my $mb_locale = $ENV{LOCALE_FR_UTF8}; ++my $mb_locale; ++#Comment out next line to disable multibyte tests ++$mb_locale = $ENV{LOCALE_FR_UTF8}; + ! defined $mb_locale || $mb_locale eq 'none' + and $mb_locale = 'C'; + ++my $try = "Try `$prog --help' for more information.\n"; ++my $inval = "$prog: invalid byte, character or field list\n$try"; ++ + # Since each test is run with a file name and with redirected stdin, + # the name in the diagnostic is either the file name or "-". + # Normalize each diagnostic to use '-'. +@@ -415,6 +420,37 @@ + } + } + ++if ($mb_locale ne 'C') ++ { ++ # Duplicate each test vector, appending "-mb" to the test name and ++ # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we ++ # provide coverage for the distro-added multi-byte code paths. ++ my @new; ++ foreach my $t (@Tests) ++ { ++ my @new_t = @$t; ++ my $test_name = shift @new_t; ++ ++ # Depending on whether sort is multi-byte-patched, ++ # it emits different diagnostics: ++ # non-MB: invalid byte or field list ++ # MB: invalid byte, character or field list ++ # Adjust the expected error output accordingly. ++ if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval} ++ (@new_t)) ++ { ++ my $sub = {ERR_SUBST => 's/, character//'}; ++ push @new_t, $sub; ++ push @$t, $sub; ++ } ++ #disable several failing tests until investigation, disable all tests with envvars set ++ next if (grep {ref $_ eq 'HASH' && exists $_->{ENV}} (@new_t)); ++ next if ($test_name =~ "18g" or $test_name =~ "sort-numeric" or $test_name =~ "08[ab]" or $test_name =~ "03[def]" or $test_name =~ "h4" or $test_name =~ "n1" or $test_name =~ "2[01]a"); ++ push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; ++ } ++ push @Tests, @new; ++ } ++ + @Tests = triple_test @Tests; + + # Remember that triple_test creates from each test with exactly one "IN" +@@ -424,6 +460,7 @@ + # Remove the IN_PIPE version of the "output-is-input" test above. + # The others aren't susceptible because they have three inputs each. + @Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests; ++@Tests = grep {$_->[0] ne 'output-is-input-mb.p'} @Tests; + + my $save_temps = $ENV{DEBUG}; + my $verbose = $ENV{VERBOSE}; +diff -Naur coreutils-8.23.orig/tests/misc/unexpand.pl coreutils-8.23/tests/misc/unexpand.pl +--- coreutils-8.23.orig/tests/misc/unexpand.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/unexpand.pl 2014-07-18 22:36:17.400067026 -0500 +@@ -27,6 +27,14 @@ + + my $prog = 'unexpand'; + ++# comment out next line to disable multibyte tests ++my $mb_locale = $ENV{LOCALE_FR_UTF8}; ++! defined $mb_locale || $mb_locale eq 'none' ++ and $mb_locale = 'C'; ++ ++my $try = "Try `$prog --help' for more information.\n"; ++my $inval = "$prog: invalid byte, character or field list\n$try"; ++ + my @Tests = + ( + ['a1', {IN=> ' 'x 1 ."y\n"}, {OUT=> ' 'x 1 ."y\n"}], +@@ -92,6 +100,37 @@ + {EXIT => 1}, {ERR => "$prog: tab stop value is too large\n"}], + ); + ++if ($mb_locale ne 'C') ++ { ++ # Duplicate each test vector, appending "-mb" to the test name and ++ # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we ++ # provide coverage for the distro-added multi-byte code paths. ++ my @new; ++ foreach my $t (@Tests) ++ { ++ my @new_t = @$t; ++ my $test_name = shift @new_t; ++ ++ # Depending on whether unexpand is multi-byte-patched, ++ # it emits different diagnostics: ++ # non-MB: invalid byte or field list ++ # MB: invalid byte, character or field list ++ # Adjust the expected error output accordingly. ++ if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval} ++ (@new_t)) ++ { ++ my $sub = {ERR_SUBST => 's/, character//'}; ++ push @new_t, $sub; ++ push @$t, $sub; ++ } ++ next if ($test_name =~ 'b-1'); ++ push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; ++ } ++ push @Tests, @new; ++ } ++ ++@Tests = triple_test @Tests; ++ + my $save_temps = $ENV{DEBUG}; + my $verbose = $ENV{VERBOSE}; + +diff -Naur coreutils-8.23.orig/tests/misc/uniq.pl coreutils-8.23/tests/misc/uniq.pl +--- coreutils-8.23.orig/tests/misc/uniq.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/uniq.pl 2014-07-18 22:36:17.400067026 -0500 +@@ -23,9 +23,17 @@ + my $prog = 'uniq'; + my $try = "Try '$prog --help' for more information.\n"; + ++my $inval = "$prog: invalid byte, character or field list\n$try"; ++ + # Turn off localization of executable's output. + @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + ++my $mb_locale; ++#Comment out next line to disable multibyte tests ++$mb_locale = $ENV{LOCALE_FR_UTF8}; ++! defined $mb_locale || $mb_locale eq 'none' ++ and $mb_locale = 'C'; ++ + # When possible, create a "-z"-testing variant of each test. + sub add_z_variants($) + { +@@ -261,6 +269,53 @@ + and push @$t, {ENV=>'_POSIX2_VERSION=199209'}; + } + ++if ($mb_locale ne 'C') ++ { ++ # Duplicate each test vector, appending "-mb" to the test name and ++ # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we ++ # provide coverage for the distro-added multi-byte code paths. ++ my @new; ++ foreach my $t (@Tests) ++ { ++ my @new_t = @$t; ++ my $test_name = shift @new_t; ++ ++ # Depending on whether uniq is multi-byte-patched, ++ # it emits different diagnostics: ++ # non-MB: invalid byte or field list ++ # MB: invalid byte, character or field list ++ # Adjust the expected error output accordingly. ++ if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval} ++ (@new_t)) ++ { ++ my $sub = {ERR_SUBST => 's/, character//'}; ++ push @new_t, $sub; ++ push @$t, $sub; ++ } ++ # In test #145, replace the each ‘...’ by '...'. ++ if ($test_name =~ "145") ++ { ++ my $sub = { ERR_SUBST => "s/‘([^’]+)’/'$1'/g"}; ++ push @new_t, $sub; ++ push @$t, $sub; ++ } ++ next if ( $test_name =~ "schar" ++ or $test_name =~ "^obs-plus" ++ or $test_name =~ "119"); ++ push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; ++ } ++ push @Tests, @new; ++ } ++ ++# Remember that triple_test creates from each test with exactly one "IN" ++# file two more tests (.p and .r suffix on name) corresponding to reading ++# input from a file and from a pipe. The pipe-reading test would fail ++# due to a race condition about 1 in 20 times. ++# Remove the IN_PIPE version of the "output-is-input" test above. ++# The others aren't susceptible because they have three inputs each. ++ ++@Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests; ++ + @Tests = add_z_variants @Tests; + @Tests = triple_test @Tests; + +diff -Naur coreutils-8.23.orig/tests/pr/pr-tests.pl coreutils-8.23/tests/pr/pr-tests.pl +--- coreutils-8.23.orig/tests/pr/pr-tests.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/pr/pr-tests.pl 2014-07-18 22:36:17.401067000 -0500 +@@ -23,6 +23,15 @@ + + my $prog = 'pr'; + ++my $mb_locale; ++#Uncomment the following line to enable multibyte tests ++$mb_locale = $ENV{LOCALE_FR_UTF8}; ++! defined $mb_locale || $mb_locale eq 'none' ++ and $mb_locale = 'C'; ++ ++my $try = "Try `$prog --help' for more information.\n"; ++my $inval = "$prog: invalid byte, character or field list\n$try"; ++ + my @tv = ( + + # -b option is no longer an official option. But it's still working to +@@ -466,8 +475,48 @@ + {IN=>{3=>"x\ty\tz\n"}}, + {OUT=>join("\t", qw(a b c m n o x y z)) . "\n"} ]; + ++# Add _POSIX2_VERSION=199209 to the environment of each test ++# that uses an old-style option like +1. ++if ($mb_locale ne 'C') ++ { ++ # Duplicate each test vector, appending "-mb" to the test name and ++ # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we ++ # provide coverage for the distro-added multi-byte code paths. ++ my @new; ++ foreach my $t (@Tests) ++ { ++ my @new_t = @$t; ++ my $test_name = shift @new_t; ++ ++ # Depending on whether pr is multi-byte-patched, ++ # it emits different diagnostics: ++ # non-MB: invalid byte or field list ++ # MB: invalid byte, character or field list ++ # Adjust the expected error output accordingly. ++ if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval} ++ (@new_t)) ++ { ++ my $sub = {ERR_SUBST => 's/, character//'}; ++ push @new_t, $sub; ++ push @$t, $sub; ++ } ++ #temporarily skip some failing tests ++ next if ($test_name =~ "col-0" or $test_name =~ "col-inval"); ++ push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; ++ } ++ push @Tests, @new; ++ } ++ + @Tests = triple_test @Tests; + ++# Remember that triple_test creates from each test with exactly one "IN" ++# file two more tests (.p and .r suffix on name) corresponding to reading ++# input from a file and from a pipe. The pipe-reading test would fail ++# due to a race condition about 1 in 20 times. ++# Remove the IN_PIPE version of the "output-is-input" test above. ++# The others aren't susceptible because they have three inputs each. ++@Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests; ++ + my $save_temps = $ENV{DEBUG}; + my $verbose = $ENV{VERBOSE}; + diff --git a/coreutils/patches/coreutils-ipfire-disabled-tests.patch b/coreutils/patches/coreutils-ipfire-disabled-tests.patch index d77afb3..648e6e3 100644 --- a/coreutils/patches/coreutils-ipfire-disabled-tests.patch +++ b/coreutils/patches/coreutils-ipfire-disabled-tests.patch @@ -1,53 +1,7 @@ -diff -Nur b/gnulib-tests/gnulib.mk a/gnulib-tests/gnulib.mk ---- b/gnulib-tests/gnulib.mk 2013-02-07 17:58:44.000000000 +0100 -+++ a/gnulib-tests/gnulib.mk 2013-04-01 20:59:40.550543124 +0200 -@@ -524,10 +524,10 @@ - - ## begin gnulib module fdutimensat-tests - --TESTS += test-fdutimensat --check_PROGRAMS += test-fdutimensat --test_fdutimensat_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBINTL@ --EXTRA_DIST += nap.h test-futimens.h test-lutimens.h test-utimens.h test-utimens-common.h test-fdutimensat.c macros.h -+#TESTS += test-fdutimensat -+#check_PROGRAMS += test-fdutimensat -+#test_fdutimensat_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBINTL@ -+#EXTRA_DIST += nap.h test-futimens.h test-lutimens.h test-utimens.h test-utimens-common.h test-fdutimensat.c macros.h - - ## end gnulib module fdutimensat-tests - -@@ -2438,19 +2438,19 @@ - - ## begin gnulib module utimens-tests - --TESTS += test-utimens --check_PROGRAMS += test-utimens --test_utimens_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBINTL@ --EXTRA_DIST += nap.h test-futimens.h test-lutimens.h test-utimens.h test-utimens-common.h test-utimens.c macros.h -+#TESTS += test-utimens -+#check_PROGRAMS += test-utimens -+#test_utimens_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBINTL@ -+#EXTRA_DIST += nap.h test-futimens.h test-lutimens.h test-utimens.h test-utimens-common.h test-utimens.c macros.h - - ## end gnulib module utimens-tests - - ## begin gnulib module utimensat-tests - --TESTS += test-utimensat --check_PROGRAMS += test-utimensat --test_utimensat_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBINTL@ --EXTRA_DIST += nap.h test-lutimens.h test-utimens.h test-utimens-common.h test-utimensat.c signature.h macros.h -+#TESTS += test-utimensat -+#check_PROGRAMS += test-utimensat -+#test_utimensat_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBINTL@ -+#EXTRA_DIST += nap.h test-lutimens.h test-utimens.h test-utimens-common.h test-utimensat.c signature.h macros.h - - ## end gnulib module utimensat-tests - -diff -Nur b/tests/local.mk a/tests/local.mk ---- b/tests/local.mk 2013-02-11 11:30:12.000000000 +0100 -+++ a/tests/local.mk 2013-04-01 19:42:42.212419701 +0200 -@@ -108,7 +108,6 @@ +diff -Nur coreutils-8.23-orig/tests/local.mk coreutils-8.23/tests/local.mk +--- coreutils-8.23-orig/tests/local.mk 2014-07-14 00:09:52.000000000 +0200 ++++ coreutils-8.23/tests/local.mk 2015-01-23 21:44:03.355661943 +0100 +@@ -107,7 +107,6 @@
all_root_tests = \ tests/chown/basic.sh \ @@ -55,28 +9,25 @@ diff -Nur b/tests/local.mk a/tests/local.mk tests/cp/preserve-gid.sh \ tests/cp/special-bits.sh \ tests/cp/cp-mv-enotsup-xattr.sh \ -@@ -274,7 +273,6 @@ - tests/misc/groups-version.sh \ - tests/misc/head-c.sh \ - tests/misc/head-pos.sh \ -- tests/misc/id-context.sh \ - tests/misc/id-groups.sh \ - tests/misc/id-setgid.sh \ - tests/misc/md5sum.pl \ -@@ -328,7 +326,6 @@ - tests/misc/sort-merge.pl \ - tests/misc/sort-merge-fdlimit.sh \ - tests/misc/sort-month.sh \ -- tests/misc/sort-exit-early.sh \ - tests/misc/sort-rand.sh \ - tests/misc/sort-spinlock-abuse.sh \ - tests/misc/sort-stale-thread-mem.sh \ -@@ -503,12 +500,10 @@ +@@ -121,8 +120,6 @@ + tests/install/install-C-root.sh \ + tests/ls/capability.sh \ + tests/ls/nameless-uid.sh \ +- tests/misc/chcon.sh \ +- tests/misc/chroot-credentials.sh \ + tests/misc/selinux.sh \ + tests/misc/truncate-owned-by-other.sh \ + tests/mkdir/writable-under-readonly.sh \ +@@ -517,8 +514,6 @@ tests/du/trailing-slash.sh \ tests/du/two-args.sh \ tests/id/gnu-zero-uids.sh \ - tests/id/no-context.sh \ - tests/install/basic-1.sh \ +- tests/id/context.sh \ + tests/id/uid.sh \ + tests/id/setgid.sh \ + tests/id/zero.sh \ +@@ -527,7 +522,6 @@ tests/install/create-leading.sh \ tests/install/d-slashdot.sh \ tests/install/install-C.sh \ @@ -84,3 +35,11 @@ diff -Nur b/tests/local.mk a/tests/local.mk tests/install/strip-program.sh \ tests/install/trap.sh \ tests/ln/backup-1.sh \ +@@ -579,7 +573,6 @@ + tests/mkdir/parents.sh \ + tests/mkdir/perm.sh \ + tests/mkdir/selinux.sh \ +- tests/mkdir/restorecon.sh \ + tests/mkdir/special-1.sh \ + tests/mkdir/t-slash.sh \ + tests/mkdir/smack-no-root.sh \ diff --git a/coreutils/patches/coreutils-selinux.patch b/coreutils/patches/coreutils-selinux.patch deleted file mode 100644 index a151acb..0000000 --- a/coreutils/patches/coreutils-selinux.patch +++ /dev/null @@ -1,656 +0,0 @@ -diff -urNp coreutils-8.21-orig/configure.ac coreutils-8.21/configure.ac ---- coreutils-8.21-orig/configure.ac 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/configure.ac 2013-02-15 14:31:58.937482694 +0100 -@@ -204,6 +204,13 @@ if test "$gl_gcc_warnings" = yes; then - AC_SUBST([GNULIB_TEST_WARN_CFLAGS]) - fi - -+dnl Give the chance to enable SELINUX -+AC_ARG_ENABLE(selinux, dnl -+[ --enable-selinux Enable use of the SELINUX libraries], -+[AC_DEFINE(WITH_SELINUX, 1, [Define if you want to use SELINUX]) -+LIB_SELINUX="-lselinux" -+AC_SUBST(LIB_SELINUX)]) -+ - AC_FUNC_FORK - - optional_bin_progs= -diff -urNp coreutils-8.21-orig/init.cfg coreutils-8.21/init.cfg ---- coreutils-8.21-orig/init.cfg 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/init.cfg 2013-02-15 14:31:58.957469955 +0100 -@@ -308,8 +308,8 @@ require_selinux_() - - # Independent of whether SELinux is enabled system-wide, - # the current file system may lack SELinux support. -- case $(ls -Zd .) in -- '? .'|'unlabeled .') -+ case $(ls -Zd . | cut -f4 -d" ") in -+ '?'|'unlabeled') - skip_ "this system (or maybe just" \ - "the current file system) lacks SELinux support" - ;; -diff -urNp coreutils-8.21-orig/man/chcon.x coreutils-8.21/man/chcon.x ---- coreutils-8.21-orig/man/chcon.x 2011-08-23 15:44:01.000000000 +0200 -+++ coreutils-8.21/man/chcon.x 2013-02-15 14:31:58.937482694 +0100 -@@ -1,4 +1,4 @@ - [NAME] --chcon - change file security context -+chcon - change file SELinux security context - [DESCRIPTION] - ." Add any additional description here -diff -urNp coreutils-8.21-orig/man/runcon.x coreutils-8.21/man/runcon.x ---- coreutils-8.21-orig/man/runcon.x 2011-08-23 15:44:01.000000000 +0200 -+++ coreutils-8.21/man/runcon.x 2013-02-15 14:31:58.938486496 +0100 -@@ -1,5 +1,5 @@ - [NAME] --runcon - run command with specified security context -+runcon - run command with specified SELinux security context - [DESCRIPTION] - Run COMMAND with completely-specified CONTEXT, or with current or - transitioned security context modified by one or more of LEVEL, -diff -urNp coreutils-8.21-orig/src/chcon.c coreutils-8.21/src/chcon.c ---- coreutils-8.21-orig/src/chcon.c 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/src/chcon.c 2013-02-15 14:31:58.939469828 +0100 -@@ -355,7 +355,7 @@ Usage: %s [OPTION]... CONTEXT FILE...\n\ - "), - program_name, program_name, program_name); - fputs (_("\ --Change the security context of each FILE to CONTEXT.\n\ -+Change the SELinux security context of each FILE to CONTEXT.\n\ - With --reference, change the security context of each FILE to that of RFILE.\n\ - "), stdout); - -diff -urNp coreutils-8.21-orig/src/copy.c coreutils-8.21/src/copy.c ---- coreutils-8.21-orig/src/copy.c 2013-02-07 10:37:05.000000000 +0100 -+++ coreutils-8.21/src/copy.c 2013-02-15 14:31:58.941467872 +0100 -@@ -2315,6 +2315,8 @@ copy_internal (char const *src_name, cha - { - /* Here, we are crossing a file system boundary and cp's -x option - is in effect: so don't copy the contents of this directory. */ -+ if (x->preserve_security_context) -+ restore_default_fscreatecon_or_die (); - } - else - { -diff -urNp coreutils-8.21-orig/src/copy.h coreutils-8.21/src/copy.h ---- coreutils-8.21-orig/src/copy.h 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/src/copy.h 2013-02-15 14:31:58.943470982 +0100 -@@ -159,6 +159,9 @@ struct cp_options - bool preserve_timestamps; - bool explicit_no_preserve_mode; - -+ /* If true, attempt to set specified security context */ -+ bool set_security_context; -+ - /* Enabled for mv, and for cp by the --preserve=links option. - If true, attempt to preserve in the destination files any - logical hard links between the source files. If used with cp's -diff -urNp coreutils-8.21-orig/src/cp.c coreutils-8.21/src/cp.c ---- coreutils-8.21-orig/src/cp.c 2013-02-07 10:37:05.000000000 +0100 -+++ coreutils-8.21/src/cp.c 2013-02-15 14:31:58.945468929 +0100 -@@ -141,6 +141,7 @@ static struct option const long_opts[] = - {"target-directory", required_argument, NULL, 't'}, - {"update", no_argument, NULL, 'u'}, - {"verbose", no_argument, NULL, 'v'}, -+ {"context", required_argument, NULL, 'Z'}, - {GETOPT_HELP_OPTION_DECL}, - {GETOPT_VERSION_OPTION_DECL}, - {NULL, 0, NULL, 0} -@@ -201,6 +202,9 @@ Copy SOURCE to DEST, or multiple SOURCE( - all\n\ - "), stdout); - fputs (_("\ -+ -c same as --preserve=context\n\ -+"), stdout); -+ fputs (_("\ - --no-preserve=ATTR_LIST don't preserve the specified attributes\n\ - --parents use full source file name under DIRECTORY\n\ - "), stdout); -@@ -227,6 +231,7 @@ Copy SOURCE to DEST, or multiple SOURCE( - destination file is missing\n\ - -v, --verbose explain what is being done\n\ - -x, --one-file-system stay on this file system\n\ -+ -Z, --context=CONTEXT set security context of copy to CONTEXT\n\ - "), stdout); - fputs (HELP_OPTION_DESCRIPTION, stdout); - fputs (VERSION_OPTION_DESCRIPTION, stdout); -@@ -784,6 +789,7 @@ cp_option_init (struct cp_options *x) - x->explicit_no_preserve_mode = false; - x->preserve_security_context = false; - x->require_preserve_context = false; -+ x->set_security_context = false; - x->preserve_xattr = false; - x->reduce_diagnostics = false; - x->require_preserve_xattr = false; -@@ -933,7 +939,7 @@ main (int argc, char **argv) - we'll actually use backup_suffix_string. */ - backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX"); - -- while ((c = getopt_long (argc, argv, "abdfHilLnprst:uvxPRS:T", -+ while ((c = getopt_long (argc, argv, "abcdfHilLnprst:uvxPRS:TZ:", - long_opts, NULL)) - != -1) - { -@@ -981,6 +987,16 @@ main (int argc, char **argv) - copy_contents = true; - break; - -+ case 'c': -+ if ( x.set_security_context ) { -+ (void) fprintf(stderr, "%s: cannot force target context and preserve it\n", argv[0]); -+ exit( 1 ); -+ } -+ else if (selinux_enabled) { -+ x.preserve_security_context = true; -+ x.require_preserve_context = true; -+ } -+ break; - case 'd': - x.preserve_links = true; - x.dereference = DEREF_NEVER; -@@ -1091,6 +1107,27 @@ main (int argc, char **argv) - x.one_file_system = true; - break; - -+ -+ case 'Z': -+ /* politely decline if we're not on a selinux-enabled kernel. */ -+ if( !selinux_enabled ) { -+ fprintf( stderr, "Warning: ignoring --context (-Z). " -+ "It requires a SELinux enabled kernel.\n" ); -+ break; -+ } -+ if ( x.preserve_security_context ) { -+ (void) fprintf(stderr, "%s: cannot force target context to '%s' and preserve it\n", argv[0], optarg); -+ exit( 1 ); -+ } -+ x.set_security_context = true; -+ /* if there's a security_context given set new path -+ components to that context, too */ -+ if ( setfscreatecon(optarg) < 0 ) { -+ (void) fprintf(stderr, _("cannot set default security context %s\n"), optarg); -+ exit( 1 ); -+ } -+ break; -+ - case 'S': - make_backups = true; - backup_suffix_string = optarg; -diff -urNp coreutils-8.21-orig/src/id.c coreutils-8.21/src/id.c ---- coreutils-8.21-orig/src/id.c 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/src/id.c 2013-02-15 14:31:58.946469154 +0100 -@@ -106,7 +106,7 @@ int - main (int argc, char **argv) - { - int optc; -- int selinux_enabled = (is_selinux_enabled () > 0); -+ bool selinux_enabled = (is_selinux_enabled () > 0); - - /* If true, output the list of all group IDs. -G */ - bool just_group_list = false; -diff -urNp coreutils-8.21-orig/src/install.c coreutils-8.21/src/install.c ---- coreutils-8.21-orig/src/install.c 2013-02-07 10:37:05.000000000 +0100 -+++ coreutils-8.21/src/install.c 2013-02-15 14:31:58.948469440 +0100 -@@ -280,6 +280,7 @@ cp_option_init (struct cp_options *x) - x->data_copy_required = true; - x->require_preserve = false; - x->require_preserve_context = false; -+ x->set_security_context = false; - x->require_preserve_xattr = false; - x->recursive = false; - x->sparse_mode = SPARSE_AUTO; -@@ -639,7 +640,7 @@ In the 4th form, create all components o - -v, --verbose print the name of each directory as it is created\n\ - "), stdout); - fputs (_("\ -- --preserve-context preserve SELinux security context\n\ -+ -P, --preserve-context preserve SELinux security context\n\ - -Z, --context=CONTEXT set SELinux security context of files and directories\ - \n\ - "), stdout); -@@ -782,7 +783,7 @@ main (int argc, char **argv) - we'll actually use backup_suffix_string. */ - backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX"); - -- while ((optc = getopt_long (argc, argv, "bcCsDdg:m:o:pt:TvS:Z:", long_options, -+ while ((optc = getopt_long (argc, argv, "bcCsDdg:m:o:pPt:TvS:Z:", long_options, - NULL)) != -1) - { - switch (optc) -@@ -853,6 +854,7 @@ main (int argc, char **argv) - no_target_directory = true; - break; - -+ case 'P': - case PRESERVE_CONTEXT_OPTION: - if ( ! selinux_enabled) - { -@@ -860,6 +862,10 @@ main (int argc, char **argv) - "this kernel is not SELinux-enabled")); - break; - } -+ if ( x.set_security_context ) { -+ (void) fprintf(stderr, "%s: cannot force target context and preserve it\n", argv[0]); -+ exit( 1 ); -+ } - x.preserve_security_context = true; - use_default_selinux_context = false; - break; -@@ -871,6 +877,7 @@ main (int argc, char **argv) - break; - } - scontext = optarg; -+ x.set_security_context = true; - use_default_selinux_context = false; - break; - case_GETOPT_HELP_CHAR; -diff -urNp coreutils-8.21-orig/src/ls.c coreutils-8.21/src/ls.c ---- coreutils-8.21-orig/src/ls.c 2013-02-03 04:24:02.000000000 +0100 -+++ coreutils-8.21/src/ls.c 2013-02-15 14:31:58.953469008 +0100 -@@ -165,7 +165,8 @@ enum filetype - symbolic_link, - sock, - whiteout, -- arg_directory -+ arg_directory, -+ command_line - }; - - /* Display letters and indicators for each filetype. -@@ -281,6 +282,7 @@ static void queue_directory (char const - bool command_line_arg); - static void sort_files (void); - static void parse_ls_color (void); -+static void print_scontext_format (const struct fileinfo *f); - - /* Initial size of hash table. - Most hierarchies are likely to be shallower than this. */ -@@ -350,7 +352,7 @@ static struct pending *pending_dirs; - - static struct timespec current_time; - --static bool print_scontext; -+static int print_scontext = 0; - static char UNKNOWN_SECURITY_CONTEXT[] = "?"; - - /* Whether any of the files has an ACL. This affects the width of the -@@ -390,7 +392,9 @@ enum format - one_per_line, /* -1 */ - many_per_line, /* -C */ - horizontal, /* -x */ -- with_commas /* -m */ -+ with_commas, /* -m */ -+ security_format, /* -Z */ -+ invalid_format - }; - - static enum format format; -@@ -793,6 +797,9 @@ enum - SHOW_CONTROL_CHARS_OPTION, - SI_OPTION, - SORT_OPTION, -+ CONTEXT_OPTION, -+ LCONTEXT_OPTION, -+ SCONTEXT_OPTION, - TIME_OPTION, - TIME_STYLE_OPTION - }; -@@ -839,7 +846,9 @@ static struct option const long_options[ - {"time-style", required_argument, NULL, TIME_STYLE_OPTION}, - {"color", optional_argument, NULL, COLOR_OPTION}, - {"block-size", required_argument, NULL, BLOCK_SIZE_OPTION}, -- {"context", no_argument, 0, 'Z'}, -+ {"context", no_argument, 0, CONTEXT_OPTION}, -+ {"lcontext", no_argument, 0, LCONTEXT_OPTION}, -+ {"scontext", no_argument, 0, SCONTEXT_OPTION}, - {"author", no_argument, NULL, AUTHOR_OPTION}, - {GETOPT_HELP_OPTION_DECL}, - {GETOPT_VERSION_OPTION_DECL}, -@@ -849,12 +858,12 @@ static struct option const long_options[ - static char const *const format_args[] = - { - "verbose", "long", "commas", "horizontal", "across", -- "vertical", "single-column", NULL -+ "vertical", "single-column", "context", NULL - }; - static enum format const format_types[] = - { - long_format, long_format, with_commas, horizontal, horizontal, -- many_per_line, one_per_line -+ many_per_line, one_per_line, security_format - }; - ARGMATCH_VERIFY (format_args, format_types); - -@@ -1296,7 +1305,8 @@ main (int argc, char **argv) - /* Avoid following symbolic links when possible. */ - if (is_colored (C_ORPHAN) - || (is_colored (C_EXEC) && color_symlink_as_referent) -- || (is_colored (C_MISSING) && format == long_format)) -+ || (is_colored (C_MISSING) && (format == long_format -+ || format == security_format))) - check_symlink_color = true; - - /* If the standard output is a controlling terminal, watch out -@@ -1343,7 +1353,7 @@ main (int argc, char **argv) - if (dereference == DEREF_UNDEFINED) - dereference = ((immediate_dirs - || indicator_style == classify -- || format == long_format) -+ || format == long_format || format == security_format) - ? DEREF_NEVER - : DEREF_COMMAND_LINE_SYMLINK_TO_DIR); - -@@ -1363,7 +1373,7 @@ main (int argc, char **argv) - - format_needs_stat = sort_type == sort_time || sort_type == sort_size - || format == long_format -- || print_scontext -+ || format == security_format || print_scontext - || print_block_size; - format_needs_type = (! format_needs_stat - && (recursive -@@ -1394,7 +1404,7 @@ main (int argc, char **argv) - } - else - do -- gobble_file (argv[i++], unknown, NOT_AN_INODE_NUMBER, true, ""); -+ gobble_file (argv[i++], command_line, NOT_AN_INODE_NUMBER, true, ""); - while (i < argc); - - if (cwd_n_used) -@@ -1565,7 +1575,7 @@ decode_switches (int argc, char **argv) - ignore_mode = IGNORE_DEFAULT; - ignore_patterns = NULL; - hide_patterns = NULL; -- print_scontext = false; -+ print_scontext = 0; - - /* FIXME: put this in a function. */ - { -@@ -1941,13 +1951,27 @@ decode_switches (int argc, char **argv) - break; - - case 'Z': -- print_scontext = true; -+ print_scontext = 1; -+ format = security_format; - break; - - case_GETOPT_HELP_CHAR; - - case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); - -+ case CONTEXT_OPTION: /* default security context format */ -+ print_scontext = 1; -+ format = security_format; -+ break; -+ case LCONTEXT_OPTION: /* long format plus security context */ -+ print_scontext = 1; -+ format = long_format; -+ break; -+ case SCONTEXT_OPTION: /* short form of new security format */ -+ print_scontext = 0; -+ format = security_format; -+ break; -+ - default: - usage (LS_FAILURE); - } -@@ -2883,6 +2907,7 @@ gobble_file (char const *name, enum file - memset (f, '\0', sizeof *f); - f->stat.st_ino = inode; - f->filetype = type; -+ f->scontext = NULL; - - if (command_line_arg - || format_needs_stat -@@ -2995,7 +3020,7 @@ gobble_file (char const *name, enum file - && print_with_color && is_colored (C_CAP)) - f->has_capability = has_capability_cache (absolute_name, f); - -- if (format == long_format || print_scontext) -+ if (format == long_format || format == security_format || print_scontext) - { - bool have_selinux = false; - bool have_acl = false; -@@ -3016,7 +3041,7 @@ gobble_file (char const *name, enum file - err = 0; - } - -- if (err == 0 && format == long_format) -+ if (err == 0 && (format == long_format || format == security_format)) - { - int n = file_has_acl_cache (absolute_name, f); - err = (n < 0); -@@ -3035,7 +3060,8 @@ gobble_file (char const *name, enum file - } - - if (S_ISLNK (f->stat.st_mode) -- && (format == long_format || check_symlink_color)) -+ && (format == long_format || format == security_format -+ || check_symlink_color)) - { - struct stat linkstats; - -@@ -3054,6 +3080,7 @@ gobble_file (char const *name, enum file - command line are automatically traced if not being - listed as files. */ - if (!command_line_arg || format == long_format -+ || format == security_format - || !S_ISDIR (linkstats.st_mode)) - { - /* Get the linked-to file's mode for the filetype indicator -@@ -3087,7 +3114,7 @@ gobble_file (char const *name, enum file - block_size_width = len; - } - -- if (format == long_format) -+ if (format == long_format || format == security_format) - { - if (print_owner) - { -@@ -3591,6 +3618,13 @@ print_current_files (void) - print_long_format (sorted_file[i]); - DIRED_PUTCHAR ('\n'); - } -+ break; -+ case security_format: -+ for (i = 0; i < cwd_n_used; i++) -+ { -+ print_scontext_format (sorted_file[i]); -+ DIRED_PUTCHAR ('\n'); -+ } - break; - } - } -@@ -3753,6 +3787,67 @@ format_inode (char *buf, size_t buflen, - : (char *) "?"); - } - -+/* Print info about f in scontext format */ -+static void -+print_scontext_format (const struct fileinfo *f) -+{ -+ char modebuf[12]; -+ -+ /* 7 fields that may require LONGEST_HUMAN_READABLE bytes, -+ 1 10-byte mode string, -+ 9 spaces, one following each of these fields, and -+ 1 trailing NUL byte. */ -+ -+ char init_bigbuf[7 * LONGEST_HUMAN_READABLE + 10 + 9 + 1]; -+ char *buf = init_bigbuf; -+ char *p; -+ -+ p = buf; -+ -+ if ( print_scontext ) { /* zero means terse listing */ -+ filemodestring (&f->stat, modebuf); -+ if (! any_has_acl) -+ modebuf[10] = '\0'; -+ else if (f->acl_type == ACL_T_SELINUX_ONLY) -+ modebuf[10] = '.'; -+ else if (f->acl_type == ACL_T_YES) -+ modebuf[10] = '+'; -+ modebuf[11] = '\0'; -+ -+ /* print mode */ -+ -+ (void) sprintf (p, "%s ", modebuf); -+ p += strlen (p); -+ -+ /* print standard user and group */ -+ -+ DIRED_FPUTS (buf, stdout, p - buf); -+ format_user (f->stat.st_uid, owner_width, f->stat_ok); -+ format_group (f->stat.st_gid, group_width, f->stat_ok); -+ p = buf; -+ } -+ -+ (void) sprintf (p, "%-32s ", f->scontext ?: ""); -+ p += strlen (p); -+ -+ DIRED_INDENT (); -+ DIRED_FPUTS (buf, stdout, p - buf); -+ size_t w = print_name_with_quoting (f, false, &dired_obstack, p - buf); -+ -+ if (f->filetype == symbolic_link) { -+ if (f->linkname) { -+ DIRED_FPUTS_LITERAL (" -> ", stdout); -+ print_name_with_quoting (f, true, NULL, (p - buf) + w + 4); -+ if (indicator_style != none) -+ print_type_indicator (f->stat_ok, f->linkmode, f->filetype); -+ } -+ } -+ else { -+ if (indicator_style != none) -+ print_type_indicator (f->stat_ok, f->stat.st_mode, f->filetype); -+ } -+} -+ - /* Print information about F in long format. */ - static void - print_long_format (const struct fileinfo *f) -@@ -3844,9 +3939,15 @@ print_long_format (const struct fileinfo - The latter is wrong when nlink_width is zero. */ - p += strlen (p); - -+ if (print_scontext) -+ { -+ sprintf (p, "%-32s ", f->scontext ? f->scontext : ""); -+ p += strlen (p); -+ } -+ - DIRED_INDENT (); - -- if (print_owner || print_group || print_author || print_scontext) -+ if (print_owner || print_group || print_author) - { - DIRED_FPUTS (buf, stdout, p - buf); - -@@ -3859,9 +3960,6 @@ print_long_format (const struct fileinfo - if (print_author) - format_user (f->stat.st_author, author_width, f->stat_ok); - -- if (print_scontext) -- format_user_or_group (f->scontext, 0, scontext_width); -- - p = buf; - } - -@@ -4207,9 +4305,6 @@ print_file_name_and_frills (const struct - : human_readable (ST_NBLOCKS (f->stat), buf, human_output_opts, - ST_NBLOCKSIZE, output_block_size)); - -- if (print_scontext) -- printf ("%*s ", format == with_commas ? 0 : scontext_width, f->scontext); -- - size_t width = print_name_with_quoting (f, false, NULL, start_col); - - if (indicator_style != none) -@@ -4417,9 +4512,6 @@ length_of_file_name_and_frills (const st - output_block_size)) - : block_size_width); - -- if (print_scontext) -- len += 1 + (format == with_commas ? strlen (f->scontext) : scontext_width); -- - quote_name (NULL, f->name, filename_quoting_options, &name_width); - len += name_width; - -@@ -4856,9 +4948,16 @@ Sort entries alphabetically if none of - - -w, --width=COLS assume screen width instead of current value\n\ - -x list entries by lines instead of by columns\n\ - -X sort alphabetically by entry extension\n\ -- -Z, --context print any SELinux security context of each file\n\ - -1 list one file per line\n\ - "), stdout); -+ fputs(_("\nSELinux options:\n\n\ -+ --lcontext Display security context. Enable -l. Lines\n\ -+ will probably be too wide for most displays.\n\ -+ -Z, --context Display security context so it fits on most\n\ -+ displays. Displays only mode, user, group,\n\ -+ security context and file name.\n\ -+ --scontext Display only security context and file name.\n\ -+"), stdout); - fputs (HELP_OPTION_DESCRIPTION, stdout); - fputs (VERSION_OPTION_DESCRIPTION, stdout); - emit_size_note (); -diff -urNp coreutils-8.21-orig/src/mkdir.c coreutils-8.21/src/mkdir.c ---- coreutils-8.21-orig/src/mkdir.c 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/src/mkdir.c 2013-02-15 14:31:58.954469576 +0100 -@@ -38,6 +38,7 @@ - static struct option const longopts[] = - { - {GETOPT_SELINUX_CONTEXT_OPTION_DECL}, -+ {"context", required_argument, NULL, 'Z'}, - {"mode", required_argument, NULL, 'm'}, - {"parents", no_argument, NULL, 'p'}, - {"verbose", no_argument, NULL, 'v'}, -diff -urNp coreutils-8.21-orig/src/mknod.c coreutils-8.21/src/mknod.c ---- coreutils-8.21-orig/src/mknod.c 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/src/mknod.c 2013-02-15 14:31:58.955470548 +0100 -@@ -35,7 +35,7 @@ - - static struct option const longopts[] = - { -- {GETOPT_SELINUX_CONTEXT_OPTION_DECL}, -+ {GETOPT_SELINUX_CONTEXT_OPTION_DECL}, - {"mode", required_argument, NULL, 'm'}, - {GETOPT_HELP_OPTION_DECL}, - {GETOPT_VERSION_OPTION_DECL}, -diff -urNp coreutils-8.21-orig/src/mv.c coreutils-8.21/src/mv.c ---- coreutils-8.21-orig/src/mv.c 2013-02-07 10:37:05.000000000 +0100 -+++ coreutils-8.21/src/mv.c 2013-02-15 14:31:58.956469593 +0100 -@@ -120,6 +120,7 @@ cp_option_init (struct cp_options *x) - x->preserve_timestamps = true; - x->explicit_no_preserve_mode= false; - x->preserve_security_context = selinux_enabled; -+ x->set_security_context = false; - x->reduce_diagnostics = false; - x->data_copy_required = true; - x->require_preserve = false; /* FIXME: maybe make this an option */ -diff -urNp coreutils-8.21-orig/src/runcon.c coreutils-8.21/src/runcon.c ---- coreutils-8.21-orig/src/runcon.c 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/src/runcon.c 2013-02-15 14:31:58.956469593 +0100 -@@ -85,7 +85,7 @@ Usage: %s CONTEXT COMMAND [args]\n\ - or: %s [ -c ] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] COMMAND [args]\n\ - "), program_name, program_name); - fputs (_("\ --Run a program in a different security context.\n\ -+Run a program in a different SELinux security context.\n\ - With neither CONTEXT nor COMMAND, print the current security context.\n\ - "), stdout); - -diff -urNp coreutils-8.21-orig/tests/misc/selinux.sh coreutils-8.21/tests/misc/selinux.sh ---- coreutils-8.21-orig/tests/misc/selinux.sh 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/tests/misc/selinux.sh 2013-02-15 14:31:58.957469955 +0100 -@@ -37,7 +37,7 @@ chcon $ctx f d p || - - # inspect that context with both ls -Z and stat. - for i in d f p; do -- c=$(ls -dogZ $i|cut -d' ' -f3); test x$c = x$ctx || fail=1 -+ c=$(ls -dogZ $i|cut -d' ' -f4); test x$c = x$ctx || fail=1 - c=$(stat --printf %C $i); test x$c = x$ctx || fail=1 - done - diff --git a/coreutils/patches/coreutils-selinuxmanpages.patch b/coreutils/patches/coreutils-selinuxmanpages.patch deleted file mode 100644 index 9cbc166..0000000 --- a/coreutils/patches/coreutils-selinuxmanpages.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -urNp coreutils-6.10-orig/doc/coreutils.texi coreutils-6.10/doc/coreutils.texi ---- coreutils-6.10-orig/doc/coreutils.texi 2008-04-07 17:52:11.000000000 +0200 -+++ coreutils-6.10/doc/coreutils.texi 2008-04-07 18:01:43.000000000 +0200 -@@ -6981,6 +6981,11 @@ for i; do - done - @end example - -+@item -c -+@cindex SELinux security context information, preserving -+Preserve SELinux security context of the original files if possible. -+Some file systems don't support storing of SELinux security context. -+ - @item --copy-contents - @cindex directories, copying recursively - @cindex copying directories recursively diff --git a/dracut/dracut.nm b/dracut/dracut.nm index 7df057c..ceba070 100644 --- a/dracut/dracut.nm +++ b/dracut/dracut.nm @@ -4,8 +4,8 @@ ###############################################################################
name = dracut -version = 024 -release = 4 +version = 040 +release = 1
groups = System/Boot url = http://sourceforge.net/apps/trac/dracut/wiki diff --git a/help2man/help2man.nm b/help2man/help2man.nm index 3b54d46..9c5e3ea 100644 --- a/help2man/help2man.nm +++ b/help2man/help2man.nm @@ -4,8 +4,9 @@ ###############################################################################
name = help2man -version = 1.40.4 -release = 2 +version = 1.46.4 +release = 1 +arch = noarch
groups = Development/Tools url = http://www.gnu.org/software/help2man @@ -21,25 +22,22 @@ description still providing some useful information. end
-source_dl = +source_dl = ftp://ftp.gnu.org/gnu/%{name}/ +sources = %{thisapp}.tar.xz
build requires - perl + %{bindir}/perl end
configure_options += \ --disable-nls \ - --libdir=/usr/lib/help2man + --libdir=%{prefix}/lib/help2man
- make_install_targets += install_l10n + make_install_targets += \ + install_l10n end
packages package %{name} - end - - package %{name}-debuginfo - template DEBUGINFO - end end diff --git a/systemd/patches/0001-Make-systemctl-is-enabled-work-for-templated-units.patch b/systemd/patches/0001-Make-systemctl-is-enabled-work-for-templated-units.patch deleted file mode 100644 index 55dfe86..0000000 --- a/systemd/patches/0001-Make-systemctl-is-enabled-work-for-templated-units.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 67820a0cbdc9d72a1074debf8b2bc72203c775cc Mon Sep 17 00:00:00 2001 -From: Michael Tremer michael.tremer@ipfire.org -Date: Sun, 19 May 2013 13:45:48 +0000 -Subject: systemctl: make systemctl is-enabled work for templated units - -Patch resolves the problem that 'systemctl is-enabled' does -not work for templated units. - -Without this patch, systemctl is-enabled something@abc.service -returned "No such file or directory", because it first checked -if /usr/lib/systemd/system/something@abc.service, etc. exists. -If systemctl is-enabled is called for templated units, this -check should be omitted and it should search for symlinks in -the .wants dirs right away. - -This patch fixes the broken behaviour and resolves - https://bugs.freedesktop.org/show_bug.cgi?id=55318. - -[zj: fixed the patch to still check for broken symlinks and - masked instances. Also removed untrue assumptions from - the patch description.] ---- -diff --git a/src/shared/install.c b/src/shared/install.c -index edf4d2a..8f27c6d 100644 ---- a/src/shared/install.c -+++ b/src/shared/install.c -@@ -1609,24 +1609,29 @@ UnitFileState unit_file_get_state( - if (!path) - return -ENOMEM; - -+ /* -+ * Search for a unit file in our default paths, to -+ * be sure, that there are no broken symlinks. -+ */ - if (lstat(path, &st) < 0) { - r = -errno; -- if (errno == ENOENT) -- continue; -- -- return -errno; -- } -+ if (errno != ENOENT) -+ return r; - -- if (!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode)) -- return -ENOENT; -+ if (!unit_name_is_instance(name)) -+ continue; -+ } else { -+ if (!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode)) -+ return -ENOENT; - -- r = null_or_empty_path(path); -- if (r < 0 && r != -ENOENT) -- return r; -- else if (r > 0) { -- state = path_startswith(*i, "/run") ? -- UNIT_FILE_MASKED_RUNTIME : UNIT_FILE_MASKED; -- return state; -+ r = null_or_empty_path(path); -+ if (r < 0 && r != -ENOENT) -+ return r; -+ else if (r > 0) { -+ state = path_startswith(*i, "/run") ? -+ UNIT_FILE_MASKED_RUNTIME : UNIT_FILE_MASKED; -+ return state; -+ } - } - - r = find_symlinks_in_scope(scope, root_dir, name, &state); --- -cgit v0.9.0.2-2-gbebe diff --git a/systemd/systemd.nm b/systemd/systemd.nm index 1c6cb26..3ed1b5b 100644 --- a/systemd/systemd.nm +++ b/systemd/systemd.nm @@ -4,8 +4,8 @@ ###############################################################################
name = systemd -version = 204 -release = 5 +version = 215 +release = 1
maintainer = Stefan Schantl stefan.schantl@ipfire.org groups = System/Base @@ -38,7 +38,7 @@ build gperf hwdata intltool - kmod-devel >= 5 + kmod-devel >= 15 libacl-devel libblkid-devel libcap-devel @@ -57,6 +57,10 @@ build --with-sysvinit-path= \ --with-sysvrcnd-path= \ --enable-introspection=yes \ + --disable-networkd \ + --disable-resolvd \ + --disable-sysusers \ + --disable-timesyncd \ --disable-static
prepare_cmds diff --git a/sysvinit/patches/sysvinit-2.86-remove-utils-1.patch b/sysvinit/patches/sysvinit-2.86-remove-utils-1.patch index e5a2182..41e0f90 100644 --- a/sysvinit/patches/sysvinit-2.86-remove-utils-1.patch +++ b/sysvinit/patches/sysvinit-2.86-remove-utils-1.patch @@ -1,5 +1,6 @@ ---- sysvinit-2.86/src/Makefile.old 2004-06-09 14:47:45.000000000 +0200 -+++ sysvinit-2.86/src/Makefile 2011-12-17 18:20:12.067186698 +0100 +diff -Nur sysvinit-2.86-orig/src/Makefile sysvinit-2.86/src/Makefile +--- sysvinit-2.86-orig/src/Makefile 2004-06-09 14:47:45.000000000 +0200 ++++ sysvinit-2.86/src/Makefile 2015-01-24 20:17:45.980202112 +0100 @@ -10,32 +10,30 @@
CC = gcc @@ -11,33 +12,38 @@ # For some known distributions we do not build all programs, otherwise we do. BIN = -SBIN = init halt shutdown runlevel killall5 +-USRBIN = last mesg +SBIN = killall5 - USRBIN = last mesg ++USRBIN =
- MAN1 = last.1 lastb.1 mesg.1 +-MAN1 = last.1 lastb.1 mesg.1 -MAN5 = initscript.5 inittab.5 -MAN8 = halt.8 init.8 killall5.8 pidof.8 poweroff.8 reboot.8 runlevel.8 -MAN8 += shutdown.8 telinit.8 ++MAN1 = +MAN8 = killall5.8 pidof.8
ifeq ($(DISTRO),) - BIN += mountpoint +-BIN += mountpoint -SBIN += sulogin bootlogd -USRBIN += utmpdump wall -MAN1 += mountpoint.1 wall.1 -MAN8 += sulogin.8 bootlogd.8 ++BIN += +SBIN += +USRBIN += -+MAN1 += mountpoint.1 ++MAN1 += +MAN8 += endif
ifeq ($(DISTRO),Debian) - BIN += mountpoint +-BIN += mountpoint -SBIN += sulogin bootlogd -+SBIN += - MAN1 += mountpoint.1 +-MAN1 += mountpoint.1 -MAN8 += sulogin.8 bootlogd.8 ++BIN += ++SBIN += ++MAN1 += +MAN8 += endif
@@ -51,7 +57,7 @@ LCRYPT = -lcrypt endif
-@@ -120,14 +118,10 @@ +@@ -120,14 +118,7 @@ $(INSTALL) -m 755 $$i $(ROOT)/usr/bin/; \ done # $(INSTALL) -m 755 etc/initscript.sample $(ROOT)/etc/ @@ -59,14 +65,14 @@ - ln -sf halt $(ROOT)/sbin/poweroff - ln -sf init $(ROOT)/sbin/telinit ln -sf ../sbin/killall5 $(ROOT)/bin/pidof - if [ ! -f $(ROOT)/usr/bin/lastb ]; then \ - ln -sf last $(ROOT)/usr/bin/lastb; \ - fi +- if [ ! -f $(ROOT)/usr/bin/lastb ]; then \ +- ln -sf last $(ROOT)/usr/bin/lastb; \ +- fi - $(INSTALL) -m 644 initreq.h $(ROOT)/usr/include/ for i in $(MAN1); do \ $(INSTALL) -m 644 ../man/$$i $(ROOT)$(MANDIR)/man1/; \ done -@@ -137,12 +131,3 @@ +@@ -137,12 +128,3 @@ for i in $(MAN8); do \ $(INSTALL) -m 644 ../man/$$i $(ROOT)$(MANDIR)/man8/; \ done diff --git a/sysvinit/sysvinit.nm b/sysvinit/sysvinit.nm index 637b564..3727da5 100644 --- a/sysvinit/sysvinit.nm +++ b/sysvinit/sysvinit.nm @@ -5,7 +5,7 @@
name = sysvinit version = 2.86 -release = 5 +release = 6
groups = System/Base url = https://alioth.debian.org/projects/pkg-sysvinit/ @@ -22,29 +22,34 @@ sources = %{thisapp}.tar.gz CFLAGS += -D_GNU_SOURCE
build - requires - libselinux-devel - end - make_build_targets += \ -C src CFLAGS="%{CFLAGS}" \ - LDFLAGS="" \ - LCRYPT="-lcrypt" + LDFLAGS=""
install - mkdir -pv %{BUILDROOT}/{bin,sbin,usr/{bin,include}} - mkdir -pv %{BUILDROOT}/usr/share/man/man{1,5,8} - make -C src install ROOT=%{BUILDROOT} - - # /bin/mountpoint is part of util-linux >= 2.20 - rm -vf %{BUILDROOT}/bin/mountpoint \ - %{BUILDROOT}/usr/share/man/man1/mountpoint.1 + # Create directories. + mkdir -pv %{BUILDROOT}%{bindir} + mkdir -pv %{BUILDROOT}%{sbindir} + mkdir -pv %{BUILDROOT}%{mandir}/man8 + + # Install binaries. + install -m 0755 src/killall5 %{BUILDROOT}%{sbindir} + ln -sf ../sbin/killall5 %{BUILDROOT}%{bindir}/pidof + + # Install man-pages. + install -m 0664 man/killall5.8 %{BUILDROOT}%{mandir}/man8 + install -m 0664 man/pidof.8 %{BUILDROOT}%{mandir}/man8 end end
packages package %{name} groups += Base + + provides + /bin/pidof + /sbin/killall5 + end end
package %{name}-debuginfo diff --git a/util-linux/pam.d/runuser b/util-linux/pam.d/runuser new file mode 100644 index 0000000..37f0e84 --- /dev/null +++ b/util-linux/pam.d/runuser @@ -0,0 +1,5 @@ +#%PAM-1.0 +auth sufficient pam_rootok.so +session optional pam_keyinit.so revoke +session required pam_limits.so +session required pam_unix.so diff --git a/util-linux/pam.d/runuser-l b/util-linux/pam.d/runuser-l new file mode 100644 index 0000000..7a9a48c --- /dev/null +++ b/util-linux/pam.d/runuser-l @@ -0,0 +1,5 @@ +#%PAM-1.0 +auth include runuser +session optional pam_keyinit.so force revoke +-session optional pam_systemd.so +session include runuser diff --git a/util-linux/util-linux.nm b/util-linux/util-linux.nm index 60a54fc..a8f3629 100644 --- a/util-linux/util-linux.nm +++ b/util-linux/util-linux.nm @@ -4,14 +4,14 @@ ###############################################################################
name = util-linux -major_ver = 2.22 -minor_ver = 1 +major_ver = 2.25 +minor_ver = 2 version = %{major_ver}.%{minor_ver} release = 1
maintainer = Stefan Schantl stefan.schantl@ipfire.org groups = System/Base -url = http://kernel.org/~kzak/util-linux/ +url = https://github.com/karelzak/util-linux license = GPLv2 and GPLv2+ and BSD with advertising and Public Domain summary = A collection of basic system utilities.
@@ -27,14 +27,18 @@ source_dl = ftp://ftp.kernel.org/pub/linux/utils/util-linux/v%{major_ver}/ build requires audit-devel + automake >= 1.13 coreutils >= 8.19 gettext libcap-devel + libcap-ng-devel libselinux-devel libsepol-devel + libudev-devel ncurses-devel pam-devel - libudev-devel + python3-devel + systemd-devel >= 215 zlib-devel end
@@ -50,14 +54,16 @@ build --enable-kill \ --enable-partx \ --enable-write \ + --enable-runuser \ --enable-su \ - --enable-socket-activation \ - --enable-libmount-mount \ + --with-systemd \ --with-selinux \ --with-audit \ --with-udev \ --disable-makeinstall-chown \ - --disable-static + --disable-static \ + --disable-rpath \ + --with-python=3
prepare_cmds sed -e 's@etc/adjtime@var/lib/hwclock/adjtime@g' \ @@ -124,6 +130,7 @@ packages /sbin/findfs /sbin/fsck /sbin/nologin + /sbin/runuser end
obsoletes @@ -133,6 +140,7 @@ packages
conflicts filesystem < 002 + bash-completion <= 2.1-2 coreutils < 8.19 setup < 3.0-2 util-linux-ng @@ -242,6 +250,31 @@ packages end end
+ # Package information for libsmartcols. + package libsmartcols + summary = Formatting library for ls-like programs. + description + This is a library for ls-like terminal + programs, part of util-linux. + end + + files + %{libdir}/libsmartcols.* + end + end + + # Package information for libsmartcols-devel. + package libsmartcols-devel + summary = Development library and header of libsmartcols. + description = %{summary} + + files + %{includedir}/libsmartcols/* + %{libdir}/libsmartcols.so + %{libdir}/pkgconfig/smartcols.pc + end + end + package uuidd summary = Helper daemon to guarantee uniqueness of time-based UUIDs. description @@ -262,6 +295,10 @@ packages
prerequires += shadow-utils
+ requires + systemd-libs >= 215 + end + script prein getent group uuidd >/dev/null || groupadd -r uuidd getent passwd uuidd >/dev/null || \ @@ -288,6 +325,10 @@ packages systemctl try-restart uuidd.service >/dev/null 2>&1 || : end end + + package python3-libmount + template PYTHON3 + end package %{name}-debuginfo template DEBUGINFO
hooks/post-receive -- IPFire 3.x development tree