Bug 26824

Summary: grep works wrong in apsfilter's SETUP
Product: Ports & Packages Reporter: Martin.Kaeske <Martin.Kaeske>
Component: Individual Port(s)Assignee: andreas <andreas>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Martin.Kaeske 2001-04-24 22:20:01 UTC
I did a cvsup to 4.3-STABLE and tried to compile apsfilter-5.4.2.
The problem is that the SETUP-script doesn't work properly, it doesn't
show the different printer while selecting the apropriate driver.
I found out that there are some problems with grep and especially
the '-v' option. In line 365 SETUP tries to find out how many printer
are supported, by let say the gs-driver 
- MAXNO=`grep -c -v "^#" $PRINTER_LIST, where $PRINTER_LIST holds the 
file containing supported printer. The problem is that MAXNO is always 
"0" no matter what file. Furthermore line 390 fails w/o $PRINTER_LIST.
What confused me is, that "grep -v" works fine on the shell prompt
or another shell-script

Fix: 

No idea :-( Maybe a /bin/sh error
Maybe a similar problem to PR#ports/24455
How-To-Repeat: run the SETUP-script
select driver-selection
choose the gs-driver
Comment 1 Martin.Kaeske 2001-04-28 18:49:03 UTC
I "solved the problem with replacing grep with sed.
grep -v "^#" $PRINTER_LIST --> sed -e '/^#/d' $PRINTER_LIST
grep -c .... ---> sed ...|wc -l

But might not be in the interest of the apsfilter developers.

Martin

-- 
The instructions said to use Windows 98 or better, so I installed
FreeBSD.

		-- Jim Levie in comp.unix.bsd.freebsd.misc --
Comment 2 Ying-Chieh Liao freebsd_committer freebsd_triage 2001-05-25 19:40:32 UTC
Responsible Changed
From-To: freebsd-ports->andreas

over to maintainer
Comment 3 Martin.Kaeske 2001-05-28 16:35:48 UTC
I've managed to get it working with replacing all grep calls 
with /usr/compat/linux/bin/grep.
It is really strange, because i'm not able to reproduce the
problem with another shell script, it only happens in SETUP.

Martin

-- 
The instructions said to use Windows 98 or better, so I installed
FreeBSD.

		-- Jim Levie in comp.unix.bsd.freebsd.misc --
Comment 4 Martin.Kaeske 2001-05-29 00:48:56 UTC
*grmpf*
You want believe it :-)
There must be something wrong with my PATH
and a call to grep resolved to freegrep, after removing freegrep 
everything is fine.
I'm very sorry, maybe i contact the freegrep developers.
I think we can close this PR

Martin

-- 
The instructions said to use Windows 98 or better, so I installed
FreeBSD.

		-- Jim Levie in comp.unix.bsd.freebsd.misc --
Comment 5 andreas freebsd_committer freebsd_triage 2001-05-29 08:04:40 UTC
State Changed
From-To: open->closed

no freebsd or apsfilter problem. 
wrong PATH leading to freegrep first caused the problem. 
thanks for investigating further.