ports/58055: New port: chinese/ls
Statue
statue at freebsd.sinica.edu.tw
Wed Oct 15 06:30:25 UTC 2003
>Number: 58055
>Category: ports
>Synopsis: New port: chinese/ls
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Tue Oct 14 23:30:15 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Statue
>Release: FreeBSD 4.9-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD freebsd.sinica.edu.tw 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #4: Mon Sep 15 18:44:48 CST 2003 root at freebsd.sinica.edu.tw:/usr/src/sys/compile/GENERIC i386
>Description:
Chinese ls
>How-To-Repeat:
>Fix:
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# ls/
# ls/Makefile
# ls/files
# ls/pkg-descr
# ls/pkg-plist
# ls/files/patch-util.c
#
echo c - ls/
mkdir -p ls/ > /dev/null 2>&1
echo x - ls/Makefile
sed 's/^X//' >ls/Makefile << 'END-of-ls/Makefile'
X# New ports collection makefile for: ls
X# Date created: 13 Feb 1999
X# Whom: statue at freebsd.sinica.edu.tw
X#
X# $FreeBSD$
X#
X
XPORTNAME= ls
XPORTVERSION= 1.0
XCATEGORIES= chinese
XMASTER_SITES= # none
XDISTFILES= # none
X
XMAINTAINER= statue at freebsd.sinica.edu.tw
XCOMMENT= MultiByte Support ls
X
XSRCDIR= /usr/src/bin/ls
X
X.include <bsd.port.pre.mk>
Xdo-extract:
X.if exists (${SRCDIR})
X @${MKDIR} ${WRKDIR}
X @${CP} -R ${SRCDIR} ${WRKSRC}
X.else
XBROKEN= "You need to build this port with ${SRCDIR}"
X.endif
X
Xdo-install:
X @cd ${WRKSRC}; \
X ${INSTALL_PROGRAM} ${WRKSRC}/ls ${PREFIX}/bin/zh-ls;
X
X.include <bsd.port.post.mk>
END-of-ls/Makefile
echo c - ls/files
mkdir -p ls/files > /dev/null 2>&1
echo x - ls/pkg-descr
sed 's/^X//' >ls/pkg-descr << 'END-of-ls/pkg-descr'
XMultiByte Support ls
END-of-ls/pkg-descr
echo x - ls/pkg-plist
sed 's/^X//' >ls/pkg-plist << 'END-of-ls/pkg-plist'
X at comment $FreeBSD: outta-port/ls/pkg-plist,v 1.1 2002/05/15 17:21:59 statue Exp $
Xbin/zh-ls
END-of-ls/pkg-plist
echo x - ls/files/patch-util.c
sed 's/^X//' >ls/files/patch-util.c << 'END-of-ls/files/patch-util.c'
X--- util.c.orig Sun Mar 18 17:50:03 2001
X+++ util.c Sun Mar 18 17:50:36 2001
X@@ -52,6 +52,7 @@
X #include <stdio.h>
X #include <stdlib.h>
X #include <string.h>
X+#include <rune.h>
X
X #include "ls.h"
X #include "extern.h"
X@@ -60,15 +61,33 @@
X prn_printable(s)
X const char *s;
X {
X- unsigned char c;
X- int n;
X+ const char *p1, *p2;
X+ char *r, *ri;
X+ int len, dc;
X+ rune_t c;
X
X- for (n = 0; (c = *s) != '\0'; ++s, ++n)
X- if (isprint(c))
X- putchar(c);
X- else
X- putchar('?');
X- return n;
X+ p1 = s;
X+ dc = len = strlen(s);
X+ ri = r = (char *)malloc(len + 1);
X+ while(*p1 != 0) {
X+ c = sgetrune(p1, dc, &p2);
X+ if(c == _INVALID_RUNE) {
X+ p1++;
X+ dc--;
X+ *ri++ = '?';
X+ } else {
X+ dc -= p2 - p1;
X+ if(isprint(c))
X+ while(p1 != p2)
X+ *ri++ = *p1++;
X+ else
X+ while(p1 != p2)
X+ *ri++ = '?';
X+ }
X+ }
X+ *ri = 0;
X+ printf("%s", r);
X+ return len;
X }
X
X /*
END-of-ls/files/patch-util.c
exit
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list