I have tried to consider all comments

26.06.2011, 02:22, "Stuart Henderson" <[email protected]>:
> On 2011-06-25, Mike Korbakov <[email protected]>; wrote:
>
>>  Here is dash port.
>>
>>  I'm surprised that needs the great patch (which adds one letter).
>>  What do you think, is correct that text utilities, which have always been a 
>> part most
>>  of all UNIX'es now in a separate package (textutils) and has different 
>> names?
>
> GNU tools have not by any means been a part of most UNIX-like OS...
> Anyway it makes more sense to drop textutils and patch to replace "nl"
> with "cat -n" instead. The output format is the same (check with
> hexdump -C or something if you want to).

I didn't mean GNU tools. May be, not most of all old UNIX'es, but most modern 
systems has textools.
Read bottom of page:
http://www.freebsd.org/cgi/man.cgi?query=nl&apropos=0&sektion=1&manpath=FreeBSD+Ports+8.2-RELEASE&format=html
historical links:
http://minnie.tuhs.org/cgi-bin/utree.pl?file=pdp11v/usr/src/cmd/nl.c
http://minnie.tuhs.org/cgi-bin/utree.pl?file=SysIII/usr/src/cmd/nl.c

gnl -v 0 , cat -n , awk '{ print "  " FNR-1 "  " $0 }'  leads to three 
different results, just try.
But in our case awk produced usefull code.
 
>>  # $Id: Makefile,v 1.4 2011/03/29 18:08:30 mike-kmv Exp $
>
> We use $OpenBSD$ tags.

- Corrected  ($Id$ because I used cvs repository at sf.net)

>>  COMMENT= Debian Almquist shell, POSIX-compliant, faster than bash
>>
>>  DISTNAME= dash-0.5.6.1
>>  PKGREVISION= 0
>
> this isn't pkgsrc ;) we use REVISION which automatically sets p<whatever>
> in PKGNAME (so there's no need to touch PKGNAME in the typical case where
> DISTNAME is sane), but we start with no REVISION line at all, then add
> REVISION=0 after the first update etc, than go back to no REVISION line
> when DISTNAME is increased to a new version..
>
>>  BUILD_DEPENDS= devel/gmake
>>  BUILD_DEPENDS= textproc/textutils
>
> dep on gmake here is unnecessary, USE_GMAKE sets it. just as well,
> because your dep on textutils overrides the variable..
>
> I would suggest that for new ports, you start from a current version of
> /usr/ports/infrastructure/templates/Makefile.template

Makefile:
# $OpenBSD$

COMMENT=        Debian Almquist shell, POSIX-compliant

DISTNAME=       dash-0.5.6.1
REVISION=       0
CATEGORIES=     shells

HOMEPAGE=       http://gondor.apana.org.au/~herbert/dash/
MASTER_SITES=   ${HOMEPAGE}files/

MAINTAINER=     Mike Korbakov <[email protected]>

# BSD, GPLv2
PERMIT_PACKAGE_CDROM=   Yes
PERMIT_PACKAGE_FTP=     Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP=   Yes

USE_GMAKE=              yes
CONFIGURE_STYLE=        gnu

include <bsd.port.mk>

patches/patch-src_mkbuiltins:
$OpenBSD$
--- src/mkbuiltins.orig Sat Jun  5 13:34:23 2010
+++ src/mkbuiltins      Sun Jun 26 02:36:23 2011
@@ -84,7 +84,7 @@ cat <<\!
  */

 !
-sed 's/        -[a-z]*//' $temp2 | nl -v 0 | LC_COLLATE=C sort -u -k 3,3 |
+sed 's/        -[a-z]*//' $temp2 | awk '{ print "  " FNR-1 "  " $0 }'  | 
LC_COLLATE=C sort -u -k 3,3 |
 tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |
        awk '{  printf "#define %s (builtincmd + %d)\n", $3, $1}'
 printf '\n#define NUMBUILTINS %d\n' $(wc -l < $temp2)

Attachment: dash.tar.gz
Description: Binary data

Reply via email to