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 20:54:11
--2fHTh5uZTiUOsy+g
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Wed, Jan 04, 2006 at 11:03:22AM -0500, Christos Zoulas wrote:
> On Jan 4,  6:50am, htodd@twofifty.com (Hisashi T Fujinaka) wrote:
> -- Subject: Re: pkg_chk doesn't work due too a fmt(1) bug (was: CVS commit: s
> 
> | Is anyone looking at this? pkg_chk -u is broken for me as well.
> 
> No, I am not looking into it. Is there a PR for this that shows how fmt
> is broken?

I meant to say 'pkg_chk -u' and not '-a'.

Hmm, maybe i have a test case:

# cat pkgchk_update-hostname.conf | fmt-broken -1
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 

# cat pkgchk_update-hostname.conf | fmt -1
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


fmt-broken is a binary based on the current source of fmt(1) and 'fmt' is based
on the source code before December.

pkgchk_update-hostname.conf is the result of a stripped down /var/db/pkg and
a shortend pkg_chk, where I manually deleted the directories until I didn't
get the 'a ' output in that file anymore.

Attached is the pkgchk_update-hostname.conf file and a stripped down pkg_chk
for the fmt problem.

Bernd


--2fHTh5uZTiUOsy+g
Content-Type: application/x-sh
Content-Disposition: attachment; filename="fmt_test.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/usr/pkgsrc=0A=0APKGCHK_UPDATE_CONF=3D$PKGSRCDIR/pkgchk_u=
pdate-$(hostname).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#FMT=3D"/usr/bin/fmt-broken"=0A=0Apkgdirs_from_installed()=0A  =
  {=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 | $FMT -1 | ${SORT} -u > $PKGCHK_UPDATE_CONF=0A=0A
--2fHTh5uZTiUOsy+g
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 

--2fHTh5uZTiUOsy+g--