summaryrefslogtreecommitdiff
path: root/misc/colorls
diff options
context:
space:
mode:
authorhans <hans>2012-03-01 16:25:16 +0000
committerhans <hans>2012-03-01 16:25:16 +0000
commitfe7fc7a2cb196de67cfa3167d6d9d4773dfb97b7 (patch)
tree953083d2e1a6b3c55ceb2aa804bc24e91a353f4d /misc/colorls
parenta409d77c8d273c4f762b4790c6efbdf5a8d7f9dd (diff)
downloadpkgsrc-fe7fc7a2cb196de67cfa3167d6d9d4773dfb97b7.tar.gz
Fix build on SunOS.
- uses fts functions - define u_quad_t and S_ISTXT - no st_flags in struct stat
Diffstat (limited to 'misc/colorls')
-rw-r--r--misc/colorls/Makefile6
-rw-r--r--misc/colorls/distinfo5
-rw-r--r--misc/colorls/patches/patch-ac78
-rw-r--r--misc/colorls/patches/patch-stat__flags.c18
4 files changed, 96 insertions, 11 deletions
diff --git a/misc/colorls/Makefile b/misc/colorls/Makefile
index 9f643bc9416..a91601f5c03 100644
--- a/misc/colorls/Makefile
+++ b/misc/colorls/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.24 2011/09/06 20:39:50 wiz Exp $
+# $NetBSD: Makefile,v 1.25 2012/03/01 16:25:16 hans Exp $
DISTNAME= ls
PKGNAME= colorls-2.2
@@ -12,6 +12,8 @@ COMMENT= ls(1) that can use color to display file attributes
PKG_INSTALLATION_TYPES= overwrite pkgviews
PKG_DESTDIR_SUPPORT= user-destdir
+USE_FEATURES+= fts_open
+
NO_SRC_ON_FTP= Already in MASTER_SITE_LOCAL
MANCOMPRESSED_IF_MANZ= yes
@@ -19,6 +21,8 @@ MAKE_ENV+= BINOWN=${BINOWN:Q} BINGRP=${BINGRP:Q} \
MANOWN=${MANOWN:Q} MANGRP=${MANGRP:Q}
INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 ${PKGMANDIR}/cat1
+CFLAGS.SunOS+= -Du_quad_t=uint64_t -DS_ISTXT=S_ISVTX
+
pre-patch:
${CP} ${WRKSRC}/ls.1 ${WRKSRC}/colorls.1
diff --git a/misc/colorls/distinfo b/misc/colorls/distinfo
index 82f1b869295..f97f7d12ee0 100644
--- a/misc/colorls/distinfo
+++ b/misc/colorls/distinfo
@@ -1,11 +1,12 @@
-$NetBSD: distinfo,v 1.6 2011/06/14 13:25:57 wiz Exp $
+$NetBSD: distinfo,v 1.7 2012/03/01 16:25:16 hans Exp $
SHA1 (ls.tar.gz) = f0d069e71faade167feaf14c4e6327bcc14d6616
RMD160 (ls.tar.gz) = 7b607b7ab953ad0dc603c269fa03648cd54ac04f
Size (ls.tar.gz) = 11768 bytes
SHA1 (patch-aa) = 831f286605126a136b540b4456916db8cc8ff7e4
SHA1 (patch-ab) = 8f26c3e16bb85371bbb16c5f77a667b3a456af68
-SHA1 (patch-ac) = 201dfa7f1fd9cdf022f7c4f50af9b14fe1e0cccb
+SHA1 (patch-ac) = cccd6669acec44b9efc2e7c8992fd2905371885f
SHA1 (patch-ad) = d502e96261a950c5307794f01422147430c76aba
SHA1 (patch-ae) = f901c10b02f9a965e10603a2d0365f0439b00e65
SHA1 (patch-extern.h) = ecb2f17ab8f17a42f744c26a86d243d90b309fd5
+SHA1 (patch-stat__flags.c) = 2ec98a701142eb4483ca58ed09e24748676f9d27
diff --git a/misc/colorls/patches/patch-ac b/misc/colorls/patches/patch-ac
index e74cb184759..a2bd5b925d2 100644
--- a/misc/colorls/patches/patch-ac
+++ b/misc/colorls/patches/patch-ac
@@ -1,13 +1,21 @@
-$NetBSD: patch-ac,v 1.4 2011/01/02 14:46:39 obache Exp $
+$NetBSD: patch-ac,v 1.5 2012/03/01 16:25:16 hans Exp $
--- ls.c.orig 1996-12-21 23:40:58.000000000 +0000
+++ ls.c
-@@ -59,12 +59,18 @@ static char const sccsid[] = "@(#)ls.c 8
+@@ -59,12 +59,26 @@ static char const sccsid[] = "@(#)ls.c 8
#include <string.h>
#include <unistd.h>
#include <locale.h>
++#ifdef HAVE_NBCOMPAT_H
++#include <nbcompat/pwd.h>
++#include <nbcompat/grp.h>
++#endif
+#include <pwd.h>
+#include <grp.h>
++
++#ifdef __sun
++#include <sys/ttold.h>
++#endif
#include "ls.h"
#include "extern.h"
@@ -21,7 +29,17 @@ $NetBSD: patch-ac,v 1.4 2011/01/02 14:46:39 obache Exp $
static void traverse __P((int, char **, int));
static void (*printfcn) __P((DISPLAY *));
-@@ -94,6 +100,7 @@ int f_statustime; /* use time of last m
+@@ -76,7 +90,9 @@ int termwidth = 80; /* default terminal
+ /* flags */
+ int f_accesstime; /* use time of last access */
+ int f_column; /* columnated format */
++#ifndef __sun
+ int f_flags; /* show flags associated with a file */
++#endif
+ int f_inode; /* print inode */
+ int f_kblocks; /* print size in kilobytes */
+ int f_listdir; /* list actual directory, not contents */
+@@ -94,6 +110,7 @@ int f_statustime; /* use time of last m
int f_dirname; /* if precede with directory name */
int f_timesort; /* sort by time vice name */
int f_type; /* add type character for non-regular files */
@@ -29,7 +47,7 @@ $NetBSD: patch-ac,v 1.4 2011/01/02 14:46:39 obache Exp $
#ifndef BSD4_4_LITE
int f_whiteout; /* show whiteout entries */
#endif
-@@ -135,9 +142,9 @@ main(argc, argv)
+@@ -135,9 +152,13 @@ main(argc, argv)
fts_options = FTS_PHYSICAL;
#ifdef BSD4_4_LITE
@@ -37,11 +55,15 @@ $NetBSD: patch-ac,v 1.4 2011/01/02 14:46:39 obache Exp $
+ while ((ch = getopt(argc, argv, "1ACFGLRTacdfgikloqrstu")) != EOF) {
#else
- while ((ch = getopt(argc, argv, "1ACFLRTWacdfgikloqrstu")) != EOF) {
++#ifndef __sun
+ while ((ch = getopt(argc, argv, "1ACFGLRTWacdfgikloqrstu")) != EOF) {
++#else
++ while ((ch = getopt(argc, argv, "1ACFGLRTWacdfgiklqrstu")) != EOF) {
++#endif
#endif
switch (ch) {
/*
-@@ -168,6 +175,10 @@ main(argc, argv)
+@@ -168,6 +189,10 @@ main(argc, argv)
case 'F':
f_type = 1;
break;
@@ -52,7 +74,19 @@ $NetBSD: patch-ac,v 1.4 2011/01/02 14:46:39 obache Exp $
case 'L':
fts_options &= ~FTS_PHYSICAL;
fts_options |= FTS_LOGICAL;
-@@ -228,18 +239,21 @@ main(argc, argv)
+@@ -197,9 +222,11 @@ main(argc, argv)
+ case 'k':
+ f_kblocks = 1;
+ break;
++#ifndef __sun
+ case 'o':
+ f_flags = 1;
+ break;
++#endif
+ case 'q':
+ f_nonprint = 1;
+ break;
+@@ -228,18 +255,21 @@ main(argc, argv)
argc -= optind;
argv += optind;
@@ -76,7 +110,7 @@ $NetBSD: patch-ac,v 1.4 2011/01/02 14:46:39 obache Exp $
fts_options |= FTS_COMFOLLOW;
#ifndef BSD4_4_LITE
-@@ -384,7 +398,8 @@ display(p, list)
+@@ -384,7 +414,8 @@ display(p, list)
u_long btotal, maxblock, maxinode, maxlen, maxnlink;
int bcfile, flen, glen, ulen, maxflags, maxgroup, maxuser;
int entries, needstats;
@@ -86,7 +120,35 @@ $NetBSD: patch-ac,v 1.4 2011/01/02 14:46:39 obache Exp $
/*
* If list is NULL there are two possibilities: that the parent
-@@ -521,7 +536,11 @@ display(p, list)
+@@ -452,12 +483,14 @@ display(p, list)
+ group = group_from_gid(sp->st_gid, 0);
+ if ((glen = strlen(group)) > maxgroup)
+ maxgroup = glen;
++#ifndef __sun
+ if (f_flags) {
+ flags =
+ flags_to_string(sp->st_flags, "-");
+ if ((flen = strlen(flags)) > maxflags)
+ maxflags = flen;
+ } else
++#endif
+ flen = 0;
+
+ if ((np = malloc(sizeof(NAMES) +
+@@ -473,10 +506,12 @@ display(p, list)
+ S_ISBLK(sp->st_mode))
+ bcfile = 1;
+
++#ifndef __sun
+ if (f_flags) {
+ np->flags = &np->data[ulen + glen + 2];
+ (void)strcpy(np->flags, flags);
+ }
++#endif
+ cur->fts_pointer = np;
+ }
+ }
+@@ -521,7 +556,11 @@ display(p, list)
*/
static int
mastercmp(a, b)
diff --git a/misc/colorls/patches/patch-stat__flags.c b/misc/colorls/patches/patch-stat__flags.c
new file mode 100644
index 00000000000..370ed260379
--- /dev/null
+++ b/misc/colorls/patches/patch-stat__flags.c
@@ -0,0 +1,18 @@
+$NetBSD: patch-stat__flags.c,v 1.1 2012/03/01 16:25:16 hans Exp $
+
+--- stat_flags.c.orig 1996-12-22 00:40:58.000000000 +0100
++++ stat_flags.c 2012-03-01 15:39:46.769141152 +0100
+@@ -43,6 +43,8 @@ static char const sccsid[] = "@(#)stat_f
+ #include <stddef.h>
+ #include <string.h>
+
++#ifndef __sun
++
+ #define SAPPEND(s) { \
+ if (prefix != NULL) \
+ (void)strcat(string, prefix); \
+@@ -153,3 +155,4 @@ string_to_flags(stringp, setp, clrp)
+ }
+ return (0);
+ }
++#endif /* __sun */