Bug 182888 - pkg-fallout / clang fix of port misc/sls
Summary: pkg-fallout / clang fix of port misc/sls
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Danilo Egea Gondolfo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-10 23:50 UTC by sec
Modified: 2013-10-11 21:50 UTC (History)
0 users

See Also:


Attachments
file.diff (845 bytes, patch)
2013-10-10 23:50 UTC, sec
no flags Details | Diff
file.diff (2.00 KB, patch)
2013-10-10 23:50 UTC, sec
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description sec 2013-10-10 23:50:01 UTC
misc/sls does not compile with clang.
Most of the problem is K&R-style C code without function declarations.

Fix: attached are two patches - first a "minimal" patch to get it compiling again,
the second patch is to get it warning-free on both gcc and clang.

I suggest adding both patches, but only the first is striclty necessary.

File: misc/sls/files/patch-clang
======================================================================

File: misc/sls/files/patch-cleanup
Comment 1 Danilo Egea Gondolfo freebsd_committer freebsd_triage 2013-10-11 17:49:40 UTC
Responsible Changed
From-To: freebsd-ports-bugs->danilo

I'll take it.
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-10-11 21:46:38 UTC
Author: danilo
Date: Fri Oct 11 20:46:29 2013
New Revision: 330101
URL: http://svnweb.freebsd.org/changeset/ports/330101

Log:
  - Fix build with clang [1]
  - Add stage support
  
  PR:		ports/182888
  Submitted by:	Stefan `Sec` Zehl <sec@42.org> (maintainer) [1]
  Approved by:	wg/culot (mentors, implicit)

Added:
  head/misc/sls/files/patch-sls.c   (contents, props changed)
Deleted:
  head/misc/sls/files/patch-aa
Modified:
  head/misc/sls/Makefile

Modified: head/misc/sls/Makefile
==============================================================================
--- head/misc/sls/Makefile	Fri Oct 11 20:20:59 2013	(r330100)
+++ head/misc/sls/Makefile	Fri Oct 11 20:46:29 2013	(r330101)
@@ -13,8 +13,16 @@ COMMENT=	List information about file(s) 
 
 WRKSRC=		${WRKDIR}/sls
 
-MAN1=		sls.1
-PLIST_FILES=	bin/sls
+PLIST_FILES=	bin/sls \
+		man/man1/sls.1.gz
+
+ALL_TARGET=	sls
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|CFLAGS|#&|' ${WRKSRC}/Makefile
+
+do-install:
+	${CP} ${WRKSRC}/sls ${STAGEDIR}${PREFIX}/bin
+	${CP} ${WRKSRC}/sls.1 ${STAGEDIR}${PREFIX}/man/man1
 
-NO_STAGE=	yes
 .include <bsd.port.mk>

Added: head/misc/sls/files/patch-sls.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/misc/sls/files/patch-sls.c	Fri Oct 11 20:46:29 2013	(r330101)
@@ -0,0 +1,79 @@
+--- ./sls.c.orig	2013-10-11 17:05:37.000000000 -0300
++++ ./sls.c	2013-10-11 17:06:06.000000000 -0300
+@@ -24,7 +24,10 @@
+ #include <time.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-#include <sys/dir.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <errno.h>
++#include <dirent.h>
+ 
+ #define ISEXEC(m)	(m & (S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6)))
+ #define MAXUIDS		200	/* max #of user names from passwd file */
+@@ -86,12 +89,14 @@
+ static int    sortsfile(), sortfile();
+ static time_t getsixmosago();		/* for emulating 'ls' date silliness */
+ 
+-extern char  *getenv(), *malloc(), *realloc();
+-extern int    errno;
+-extern time_t time();
+-
++void dirread (char *dirname);
++void dofile (register char *fname, int cmdarg);
++void selectfs (register char *fname, register struct stat *psbuf);
++void selectf (register char *fname);
++void display (SFILESTAT *pf);
+ /******************************************************************************/
+ 
++int
+ main (ac, av)
+     int            ac;
+     char          *av[];
+@@ -211,6 +216,7 @@
+ 
+ /******************************************************************************/
+ 
++void
+ dofile (fname, cmdarg)
+     register char  *fname;	/* name of file to stat and list */
+     int             cmdarg;	/* =1 if fname was command line arg */
+@@ -267,11 +273,12 @@
+ 
+ /******************************************************************************/
+ 
++void
+ dirread (dirname)
+     char           *dirname;
+ {  /* read a directory and everything under it that's on the same device */
+     register DIR   *dirp;		/* ptr to directory list */
+-    register struct direct  *dentp;	/* ptr to directory entry */
++    register struct dirent  *dentp;	/* ptr to directory entry */
+     register char  *pfname;
+     register int    len;
+     char            fname[512];		/* maximum pathname length */
+@@ -314,6 +321,7 @@
+ 
+ /******************************************************************************/
+ 
++void
+ selectf (fname)
+     register char *fname;
+ {  /* allocate space for this file name for sorting */
+@@ -356,6 +364,7 @@
+ 
+ /******************************************************************************/
+ 
++void
+ selectfs (fname, psbuf)
+     register char *fname;
+     register struct stat  *psbuf;
+@@ -594,6 +603,7 @@
+ 
+ /******************************************************************************/
+ 
++void
+ display (pf)
+     SFILESTAT       *pf;
+ {  /* display info about a file */
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Danilo Egea Gondolfo freebsd_committer freebsd_triage 2013-10-11 21:47:58 UTC
State Changed
From-To: open->closed

Committed, with minor changes. Thanks!