summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuediger Meier2015-03-13 16:09:36 +0100
committerKarel Zak2015-03-16 14:26:47 +0100
commit3f8478a71ccde6883d4c81b7e65561a106653b28 (patch)
tree76a018b6e55aabcfb8dc71228225a6ca8b2b6243
parenttests: use --no-act for logger tests (diff)
downloadkernel-qcow2-util-linux-3f8478a71ccde6883d4c81b7e65561a106653b28.tar.gz
kernel-qcow2-util-linux-3f8478a71ccde6883d4c81b7e65561a106653b28.tar.xz
kernel-qcow2-util-linux-3f8478a71ccde6883d4c81b7e65561a106653b28.zip
tailf: deprecated
We want to remove it in 2 years, March 2017. See discussion "tailf, really needed?" http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/10967 [kzak@redhat.com: - move warning to usage()] Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl> Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--Documentation/deprecated.txt5
-rw-r--r--tests/expected/tailf/simple1
-rw-r--r--text-utils/tailf.16
-rw-r--r--text-utils/tailf.c14
4 files changed, 22 insertions, 4 deletions
diff --git a/Documentation/deprecated.txt b/Documentation/deprecated.txt
index fc31ece5d..11f4d1fa3 100644
--- a/Documentation/deprecated.txt
+++ b/Documentation/deprecated.txt
@@ -3,6 +3,11 @@ deprecated utils are in maintenance mode and we keep them in source tree for
backward compatibility only.
+what: tailf
+why: "tail -f" is better nowadays, tailf has unfixed bugs
+
+--------------------------
+
what: sfdisk --show-size
why: this does not belong to fdisk, use "blockdev --getsz"
diff --git a/tests/expected/tailf/simple b/tests/expected/tailf/simple
index ddf72de36..5edc76b2e 100644
--- a/tests/expected/tailf/simple
+++ b/tests/expected/tailf/simple
@@ -1,2 +1,3 @@
+tailf: warning: use of 'tailf' is deprecated, use 'tail -f' instead
a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9
diff --git a/text-utils/tailf.1 b/text-utils/tailf.1
index d59c5317b..9c6bd6ade 100644
--- a/text-utils/tailf.1
+++ b/text-utils/tailf.1
@@ -29,6 +29,12 @@ tailf \- follow the growth of a log file
[option]
.I file
.SH DESCRIPTION
+.B tailf is deprecated.
+It may have unfixed bugs and will be removed in March 2017. Nowadays it's safe
+to use
+.B tail -f
+(coreutils) in contrast to the original documentation below.
+.PP
.B tailf
will print out the last 10 lines of the given \fIfile\fR and then wait
for this \fIfile\fR to grow. It is similar to
diff --git a/text-utils/tailf.c b/text-utils/tailf.c
index 603904924..d05987af7 100644
--- a/text-utils/tailf.c
+++ b/text-utils/tailf.c
@@ -19,13 +19,18 @@
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * This command is deprecated. The utility is in maintenance mode,
+ * meaning we keep them in source tree for backward compatibility
+ * only. Do not waste time making this command better, unless the
+ * fix is about security or other very critical issue.
*
- * less -F and tail -f cause a disk access every five seconds. This
- * program avoids this problem by waiting for the file size to change.
- * Hence, the file is not accessed, and the access time does not need to be
- * flushed back to disk. This is sort of a "stealth" tail.
+ * See Documentation/deprecated.txt for more information.
*/
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -202,6 +207,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE *out)
fputs(USAGE_HELP, out);
fputs(USAGE_VERSION, out);
fprintf(out, USAGE_MAN_TAIL("tailf(1)"));
+ fputs(_("Warning: use of 'tailf' is deprecated, use 'tail -f' instead.\n"), out);
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}