Subject: Re: pkg_chk doesn't work due too a fmt(1) bug (was: CVS commit: src/usr.bin/fmt)
To: None <tech-pkg@netbsd.org>
From: Bernd Ernesti <netbsd@lists.veego.de>
List: tech-pkg
Date: 01/04/2006 22:46:08
--ibTvN161/egqYuK8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Wed, Jan 04, 2006 at 10:21:39PM +0100, Bernd Ernesti wrote:
> On Wed, Jan 04, 2006 at 08:54:11PM +0100, Bernd Ernesti wrote:
> [..]
> 
> > Hmm, maybe i have a test case:
> 
> fmt.c revision 1.22 fixed the problem with the line wrapping, but there is
> still the problem where the output is 'a '.
> I need to find a test case for that.

Ok, here is a new test case for that problem. It is a slightly modified version.

There is a problem with an buffer >1024.

Copy the previously send pkgchk_update-hostname.conf, the new fmt_test2.sh
and the pkgchk_update-hostname.conf-2 into the same directory and run the
fmt_test2.sh in that directory.

I replaced the pkg_info | awk call with a simply cat, so you won't need a
lot of installed packages.

Notice the 'a ' at the end of the output.

pkgchk_update-hostname.conf-2 is 1025 bytes long. fmt works if you remove one
char from that file.

Bernd


--ibTvN161/egqYuK8
Content-Type: application/x-sh
Content-Disposition: attachment; filename="fmt_test2.sh"
Content-Transfer-Encoding: quoted-printable

#!/bin/sh -e=0A=0A# modify it so it matches the pkgsrc location on your sys=
tem=0APKGSRCDIR=3D/home/source/pkgsrc=0A=0A#PKGCHK_UPDATE_CONF=3D$PKGSRCDIR=
/pkgchk_update-$(hostname).conf=0APKGCHK_UPDATE_CONF=3Dpkgchk_update-hostna=
me.conf=0A=0APKG_INFO=3D"/usr/bin/env  /usr/sbin/pkg_info -K /var/db/pkg"=
=0AAWK=3D"/usr/bin/awk"=0ASORT=3D"/usr/bin/sort"=0AFMT=3D"/usr/bin/fmt"=0A=
=0Apkgdirs_from_installed()=0A    {=0A    cat $PKGCHK_UPDATE_CONF-2 | ${SOR=
T}=0A#    ${PKG_INFO} -Bqa | ${AWK} -F=3D '/PKGPATH=3D/{print $2}' | ${SORT=
}=0A    }=0A=0Atmp=3D$(cat $PKGCHK_UPDATE_CONF;echo $(pkgdirs_from_installe=
d)|$FMT -1)=0Aecho $tmp=0Aexit=0A=0Aecho $tmp | $FMT -1 | ${SORT} -u > $PKG=
CHK_UPDATE_CONF=0A=0A
--ibTvN161/egqYuK8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="pkgchk_update-hostname.conf-2"

archivers/cabextract
archivers/gtar-base
archivers/lha
archivers/liblzo
archivers/lzo
archivers/unarj
archivers/unrar
archivers/unzip
archivers/zip
audio/SDL_mixer
audio/abcde
audio/cd-discid
audio/cdparanoia
audio/esound
audio/flac
audio/gsm
audio/id3
audio/id3lib
audio/id3v2
audio/lame
audio/liba52
audio/libao
audio/libao-oss
audio/libaudiofile
audio/libcddb
audio/libid3tag
audio/libmad
audio/libvorbis
audio/mpg321
audio/nas
audio/rplay
audio/sox
audio/toolame
audio/xmcd
audio/xmmix
audio/xmradio
benchmarks/nttcp
benchmarks/ttcp
chat/ircII
comms/gkermit
comms/lrzsz
comms/minicom
converters/doc2html
converters/p5-MIME-Base64
converters/rpm2cpio
converters/rtf2html
converters/uulib
converters/wv
converters/xlhtml
converters/xlreader
databases/db4
databases/gnome-mime-data
databases/gq
databases/libgda
databases/libgnomedb
databases/mysql4-client
databases/mysql4-server
databases/openldap
databases/p5-DBD-mysql
databases/p5-DBI
databases/p5-perl-ldap
databases/shared-mime-info
devel/GConf2
devel/SDL
devel/apr2

--ibTvN161/egqYuK8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="pkgchk_update-hostname.conf"

archivers/cabextract archivers/lha archivers/unarj archivers/unrar 
archivers/unzip archivers/zip audio/SDL_mixer audio/abcde devel/GConf2 
devel/SDL devel/apr devel/atk devel/autoconf devel/autoconf213 
devel/automake devel/bison fonts/Xft2 fonts/alee-ttf fonts/arphic-ttf 
fonts/baekmuk-ttf graphics/ImageMagick graphics/MesaLib graphics/SDL_image 
graphics/aalib inputmethod/canna inputmethod/canna-dict 
inputmethod/canna-lib inputmethod/canna-server misc/JMdict misc/bidwatcher 
multimedia/alevt net/GeoIP net/ORBit net/ORBit2 net/SDL_net net/arpwatch 
net/bittornado net/bittornado-gui print/acroread7 shells/bash 
sysutils/acpidump www/analog x11/Xaw3d x11/Xfixes x11/Xrandr x11/Xrender 

--ibTvN161/egqYuK8--