Unlike cpio from other unix the current release on Linux 6.0 write all message on stderr. For exemple: cpio -iv < /dev/nst0 1>/tmp/log 2>/tmp/error, will write all informations in /tmp/error. I've seen in the code that all messages are written to stderr in the conditionnal routine "verbose"... Just a change in the source code from stderr to stdout in this conditionnal case (verbose) and cpio is working well....
I'm not sure what the problem is here. Linux uses GNU cpio which is a different implementation than what "other unix" vendors probably use. I would say that other unix vendors have a problem if they are writing error messages to stdout :-) You can of course do cpio -iv < /dev/nst0 2>&1 > /tmp/log if you wish all messages in the same file. Please reopen with more specific details if there is a problem here. ------- Email Received From Alain.DEGREFFE.be 06/09/99 09:01 -------
OK, I understand now. I'm changing the summary to clarify ...
Find here the patch... cpio-2.4.2-stderr-stdout.patch --- cpio-2.4.2/copyin.c Wed Nov 30 23:49:06 1994 +++ cpio-2.4.2/copyin.c Wed Jun 9 17:39:34 1999 @@ -1001,9 +1001,9 @@ } if (verbose_flag) - fprintf (stderr, "%s\n", file_hdr.c_name); + fprintf (stdout, "%s\n", file_hdr.c_name); if (dot_flag) - fputc ('.', stderr); + fputc ('.', stdout); } } --- cpio-2.4.2/copyout.c Wed Jan 10 17:10:45 1996 +++ cpio-2.4.2/copyout.c Wed Jun 9 17:53:45 1999 @@ -492,9 +492,9 @@ } if (verbose_flag) - fprintf (stderr, "%s\n", input_name.ds_string); + fprintf (stdout, "%s\n", input_name.ds_string); if (dot_flag) - fputc ('.', stderr); + fputc ('.', stdout); } } Alain to apply to srpms in patch6 for exemple.... (see cpio SPEC)
sorry reload cause this double sending... oops :-) Alain
The single unix spec is actually quite explicit about what should be happening: STDOUT When the -o option is used, the standard output is an archive file formatted as specified by pax with the -x cpio option. Otherwise, the standard output contains commentary in an unspecified format concerning the progress of the execution. STDERR When the -o option is not used, the standard error contains commentary in an unspecified format concerning the progress of the execution. Otherwise, the standard error is used only for diagnostic messages.
Fixed in cpio-2.4.2-13. Thanks for the patch.
This patch has been reverted because GNU cpio appears to be conformant to the Single Unix Specification without the patch, and the patch caused other breakage (see #6376, #7538).
Commit pushed to master at https://github.com/openshift/origin https://github.com/openshift/origin/commit/73fa36753957122e9af7dd034c99af2cb4ef7d62 Merge pull request #3522 from gabemontero/issue3358 Merged by openshift-bot