sync with 4.2

This commit is contained in:
naddy 2007-08-11 17:52:11 +00:00
parent 0a5814d158
commit a0256963f3
8 changed files with 53 additions and 57 deletions

View File

@ -1,8 +1,8 @@
# $OpenBSD: Makefile,v 1.12 2006/10/21 09:42:32 naddy Exp $
# $OpenBSD: Makefile,v 1.13 2007/08/11 17:52:11 naddy Exp $
COMMENT= "ls that can use color to display file attributes"
COMMENT= ls that can use color to display file attributes
DISTNAME= ls-3.9
DISTNAME= ls-4.2
PKGNAME= color${DISTNAME}
CATEGORIES= sysutils

View File

@ -1,5 +1,5 @@
MD5 (ls-3.9.tar.gz) = dexg2yx0GVPz31gBgKDF4A==
RMD160 (ls-3.9.tar.gz) = N/shVirHJDQPbffpRl07ZDpz3mY=
SHA1 (ls-3.9.tar.gz) = xeFPjNJ1sUmaR8vlpN9w0cP+/fs=
SHA256 (ls-3.9.tar.gz) = g1WF3yfI2kBp2D/AJImiAaaLLM0HDXCQFbaFLK5Wr6A=
SIZE (ls-3.9.tar.gz) = 12685
MD5 (ls-4.2.tar.gz) = ZSp4ITsdjfO9Xj3o9lGiWw==
RMD160 (ls-4.2.tar.gz) = xvT1RJooEc+I5lYfZ4gRwWOQDnQ=
SHA1 (ls-4.2.tar.gz) = pPW/mMynEwmYQy3FSyci6P7tpc8=
SHA256 (ls-4.2.tar.gz) = YU6mDT67wvLkysNmxjHNxNNERAgprNWkpQnA8emMQUw=
SIZE (ls-4.2.tar.gz) = 12635

View File

@ -1,8 +1,8 @@
$OpenBSD: patch-Makefile,v 1.6 2005/09/05 11:55:47 espie Exp $
--- Makefile.orig Tue Jun 21 20:05:48 2005
+++ Makefile Mon Sep 5 13:44:56 2005
$OpenBSD: patch-Makefile,v 1.7 2007/08/11 17:52:11 naddy Exp $
--- Makefile.orig Wed Aug 6 21:09:09 2003
+++ Makefile Sat Aug 11 19:28:48 2007
@@ -1,8 +1,13 @@
# $OpenBSD: patch-Makefile,v 1.6 2005/09/05 11:55:47 espie Exp $
# $OpenBSD: patch-Makefile,v 1.7 2007/08/11 17:52:11 naddy Exp $
-PROG= ls
+PROG= colorls

View File

@ -1,10 +1,10 @@
$OpenBSD: patch-colorls_1,v 1.8 2006/05/27 04:35:21 naddy Exp $
--- colorls.1.orig Sat May 27 06:10:29 2006
+++ colorls.1 Sat May 27 06:30:47 2006
$OpenBSD: patch-colorls_1,v 1.9 2007/08/11 17:52:11 naddy Exp $
--- colorls.1.orig Sat Aug 11 19:28:46 2007
+++ colorls.1 Sat Aug 11 19:34:55 2007
@@ -34,14 +34,14 @@
.\" @(#)ls.1 8.7 (Berkeley) 7/29/94
.\"
.Dd July 29, 1994
.Dd $Mdocdate: August 11 2007 $
-.Dt LS 1
+.Dt COLORLS 1
.Os
@ -20,7 +20,7 @@ $OpenBSD: patch-colorls_1,v 1.8 2006/05/27 04:35:21 naddy Exp $
.Op Ar file ...
.Sh DESCRIPTION
For each operand that names a
@@ -110,9 +110,15 @@ and a vertical bar
@@ -112,6 +112,12 @@ and a vertical bar
after each that is a FIFO.
.It Fl f
Output is not sorted.
@ -31,13 +31,9 @@ $OpenBSD: patch-colorls_1,v 1.8 2006/05/27 04:35:21 naddy Exp $
+in the environment.
+(See below.)
.It Fl g
Does nothing; kept for compatibility with older versions of
-.Nm ls .
+.Nm ls
.It Fl h
When used with a long format
option, use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte,
@@ -394,7 +400,7 @@ The
The same as
.Fl l ,
@@ -414,7 +420,7 @@ The
.Nm
utility exits 0 on success or \*(Gt0 if an error occurred.
.Sh ENVIRONMENT
@ -46,7 +42,7 @@ $OpenBSD: patch-colorls_1,v 1.8 2006/05/27 04:35:21 naddy Exp $
.It Ev BLOCKSIZE
If the environment variable
.Ev BLOCKSIZE
@@ -404,6 +410,44 @@ option is not specified, the block count
@@ -424,6 +430,44 @@ option is not specified, the block counts
(see
.Fl s )
will be displayed in units of that size block.
@ -91,7 +87,7 @@ $OpenBSD: patch-colorls_1,v 1.8 2006/05/27 04:35:21 naddy Exp $
.It COLUMNS
If this variable contains a string representing a
decimal integer, it is used as the
@@ -416,6 +460,99 @@ many pathname text columns to display
@@ -436,6 +480,99 @@ many pathname text columns to display
based on the width provided
(see
.Fl C ) .
@ -191,7 +187,7 @@ $OpenBSD: patch-colorls_1,v 1.8 2006/05/27 04:35:21 naddy Exp $
.It Ev TZ
The time zone to use when displaying dates.
See
@@ -425,24 +562,25 @@ for more information.
@@ -445,24 +582,25 @@ for more information.
.Sh EXAMPLES
List the contents of the current working directory in long format:
.Pp
@ -220,8 +216,8 @@ $OpenBSD: patch-colorls_1,v 1.8 2006/05/27 04:35:21 naddy Exp $
.Xr symlink 7 ,
.Xr sticky 8
.Sh STANDARDS
@@ -458,6 +596,6 @@ utility is expected to be a superset of
specification.
@@ -492,6 +630,6 @@ flag differs between this implementation and
.St -p1003.1-2004 .
.Sh HISTORY
An
-.Nm

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-ls_c,v 1.8 2006/05/27 04:35:21 naddy Exp $
--- ls.c.orig Sat May 27 04:58:46 2006
+++ ls.c Sat May 27 05:55:02 2006
@@ -62,6 +62,10 @@ static char rcsid[] = "$OpenBSD: ls.c,v
$OpenBSD: patch-ls_c,v 1.9 2007/08/11 17:52:11 naddy Exp $
--- ls.c.orig Mon May 7 20:39:28 2007
+++ ls.c Sat Aug 11 19:28:48 2007
@@ -62,6 +62,10 @@ static char rcsid[] = "$OpenBSD: ls.c,v 1.29 2007/05/0
#include <string.h>
#include <unistd.h>
#include <util.h>
@ -12,7 +12,7 @@ $OpenBSD: patch-ls_c,v 1.8 2006/05/27 04:35:21 naddy Exp $
#include "ls.h"
#include "extern.h"
@@ -103,6 +107,15 @@ int f_statustime; /* use time of last m
@@ -104,6 +108,15 @@ int f_statustime; /* use time of last mode change */
int f_stream; /* stream format */
int f_type; /* add type character for non-regular files */
int f_typedir; /* add type character for directories */
@ -28,7 +28,7 @@ $OpenBSD: patch-ls_c,v 1.8 2006/05/27 04:35:21 naddy Exp $
int rval;
@@ -114,6 +127,11 @@ ls_main(int argc, char *argv[])
@@ -115,6 +128,11 @@ ls_main(int argc, char *argv[])
int ch, fts_options, notused;
int kflag = 0;
char *p;
@ -40,7 +40,7 @@ $OpenBSD: patch-ls_c,v 1.8 2006/05/27 04:35:21 naddy Exp $
/* Terminal defaults to -Cq, non-terminal defaults to -1. */
if (isatty(STDOUT_FILENO)) {
@@ -131,7 +149,7 @@ ls_main(int argc, char *argv[])
@@ -132,7 +150,7 @@ ls_main(int argc, char *argv[])
f_listdot = 1;
fts_options = FTS_PHYSICAL;
@ -49,7 +49,7 @@ $OpenBSD: patch-ls_c,v 1.8 2006/05/27 04:35:21 naddy Exp $
switch (ch) {
/*
* The -1, -C and -l, -m and -x options all override each
@@ -176,6 +194,9 @@ ls_main(int argc, char *argv[])
@@ -185,6 +203,9 @@ ls_main(int argc, char *argv[])
case 'F':
f_type = 1;
break;
@ -59,9 +59,9 @@ $OpenBSD: patch-ls_c,v 1.8 2006/05/27 04:35:21 naddy Exp $
case 'L':
fts_options &= ~FTS_PHYSICAL;
fts_options |= FTS_LOGICAL;
@@ -240,11 +261,46 @@ ls_main(int argc, char *argv[])
argc -= optind;
argv += optind;
@@ -254,11 +275,46 @@ ls_main(int argc, char *argv[])
if (f_grouponly == -1)
f_grouponly = 0;
+ /* Enabling of colours is conditional on the environment. */
+ if (getenv("CLICOLOR") &&

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-ls_h,v 1.3 2003/08/27 00:41:51 naddy Exp $
--- ls.h.orig 2003-08-06 21:09:09.000000000 +0200
+++ ls.h 2003-08-27 00:31:29.000000000 +0200
@@ -50,6 +50,9 @@ extern int f_size; /* list size in shor
$OpenBSD: patch-ls_h,v 1.4 2007/08/11 17:52:11 naddy Exp $
--- ls.h.orig Mon May 7 20:39:28 2007
+++ ls.h Sat Aug 11 19:28:48 2007
@@ -51,6 +51,9 @@ extern int f_size; /* list size in short listing */
extern int f_statustime; /* use time of last mode change */
extern int f_type; /* add type character for non-regular files */
extern int f_typedir; /* add type character for directories */

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-print_c,v 1.6 2005/06/21 18:26:21 naddy Exp $
--- print.c.orig Tue Jun 21 20:05:48 2005
+++ print.c Tue Jun 21 20:12:00 2005
@@ -56,6 +56,11 @@ static char rcsid[] = "$OpenBSD: print.c
$OpenBSD: patch-print_c,v 1.7 2007/08/11 17:52:11 naddy Exp $
--- print.c.orig Mon May 7 20:39:28 2007
+++ print.c Sat Aug 11 19:28:48 2007
@@ -56,6 +56,11 @@ static char rcsid[] = "$OpenBSD: print.c,v 1.25 2007/0
#include <tzfile.h>
#include <unistd.h>
#include <util.h>
@ -63,7 +63,7 @@ $OpenBSD: patch-print_c,v 1.6 2005/06/21 18:26:21 naddy Exp $
if (dp->list->fts_level != FTS_ROOTLEVEL && (f_longform || f_size))
(void)printf("total %lu\n", howmany(dp->btotal, blocksize));
@@ -123,7 +161,15 @@ printlong(DISPLAY *dp)
@@ -124,7 +162,15 @@ printlong(DISPLAY *dp)
printtime(sp->st_ctime);
else
printtime(sp->st_mtime);
@ -79,7 +79,7 @@ $OpenBSD: patch-print_c,v 1.6 2005/06/21 18:26:21 naddy Exp $
if (f_type || (f_typedir && S_ISDIR(sp->st_mode)))
(void)printtype(sp->st_mode);
if (S_ISLNK(sp->st_mode))
@@ -223,6 +269,9 @@ printaname(FTSENT *p, u_long inodefield,
@@ -224,6 +270,9 @@ printaname(FTSENT *p, u_long inodefield, u_long sizefi
{
struct stat *sp;
int chcnt;
@ -89,7 +89,7 @@ $OpenBSD: patch-print_c,v 1.6 2005/06/21 18:26:21 naddy Exp $
sp = p->fts_statp;
chcnt = 0;
@@ -231,7 +280,15 @@ printaname(FTSENT *p, u_long inodefield,
@@ -232,7 +281,15 @@ printaname(FTSENT *p, u_long inodefield, u_long sizefi
if (f_size)
chcnt += printf("%*qd ",
(int)sizefield, howmany(sp->st_blocks, blocksize));
@ -105,7 +105,7 @@ $OpenBSD: patch-print_c,v 1.6 2005/06/21 18:26:21 naddy Exp $
if (f_type || (f_typedir && S_ISDIR(sp->st_mode)))
chcnt += printtype(sp->st_mode);
return (chcnt);
@@ -345,6 +402,151 @@ printtype(u_int mode)
@@ -346,6 +403,151 @@ printtype(u_int mode)
}
return (0);
}

View File

@ -1,14 +1,14 @@
$OpenBSD: patch-util_c,v 1.4 2005/06/21 18:26:21 naddy Exp $
--- util.c.orig Tue Jun 21 20:12:36 2005
+++ util.c Tue Jun 21 20:13:39 2005
$OpenBSD: patch-util_c,v 1.5 2007/08/11 17:52:11 naddy Exp $
--- util.c.orig Wed Apr 25 10:16:10 2007
+++ util.c Sat Aug 11 19:30:28 2007
@@ -67,7 +67,11 @@ void
usage(void)
{
(void)fprintf(stderr,
+#ifdef COLORLS
+ "usage: %s [-1AaCcdFfGghikLlmnopqRrSsTtuWx] [file ...]\n",
+ "usage: %s [-1AaCcdFfGghikLlmnopqRrSsTtux] [file ...]\n",
+#else
"usage: %s [-1AaCcdFfghikLlmnopqRrSsTtuWx] [file ...]\n",
"usage: %s [-1AaCcdFfghikLlmnopqRrSsTtux] [file ...]\n",
+#endif
__progname);
exit(1);