From jhs@jhs.muc.de Tue Jul 13 16:00:09 1999
Return-Path: <jhs@jhs.muc.de>
Received: from slarti.muc.de (slarti.muc.de [193.149.48.10])
	by hub.freebsd.org (Postfix) with SMTP id 75E341514C
	for <FreeBSD-gnats-submit@FreeBSD.ORG>; Tue, 13 Jul 1999 16:00:02 -0700 (PDT)
	(envelope-from jhs@jhs.muc.de)
Received: (qmail 26032 invoked from network); 13 Jul 1999 23:01:09 -0000
Received: from jhs.muc.de (193.149.49.84)
  by slarti.muc.de with SMTP; 13 Jul 1999 23:01:09 -0000
Received: (from jhs@localhost)
	by jhs.muc.de (8.9.3/8.9.3) id UAA24230;
	Tue, 13 Jul 1999 20:45:54 GMT
	(envelope-from jhs)
Message-Id: <199907132045.UAA24230@jhs.muc.de>
Date: Tue, 13 Jul 1999 20:45:54 GMT
From: jhs@FreeBSD.ORG
Sender: jhs@jhs.muc.de
Reply-To: jhs@FreeBSD.ORG
To: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Mk/bsd.port.mk failure to detect fail to extract
X-Send-Pr-Version: 3.2

>Number:         12635
>Category:       ports
>Synopsis:       Mk/bsd.port.mk fails to detect gzip fail to extract
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    asami
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 13 16:10:01 PDT 1999
>Closed-Date:    Tue Jul 13 16:51:21 PDT 1999
>Last-Modified:  Tue Jul 13 16:53:20 PDT 1999
>Originator:     Julian H. Stacey jhs@freebsd.org
>Release:        FreeBSD 3.2-RELEASE i386
>Organization:
>Environment:

	A multi hosted NFS site, with ports & distfiles & directories accessed
	via Lots of sequential symbolic links, to various CD-ROM directories 
	& newer-than-cd directories etc.
	A network where I hit the limit:
		sys/sys/param.h:171     #define MAXSYMLINKS     32 
	with this
		wc /usr/ports/distfiles//gv-3.5.8.tar.gz
			open: Too many levels of symbolic links
	but where, (curiously), this still works:
		cp /usr/ports/distfiles//gv-3.5.8.tar.gz /tmp/t
		wc /tmp/t
			1386    8212  369609 /tmp/t

>Description:

	Mk/bsd.port.mk fails to catch error code from gzip (fail to extract),
	As shown:
		make
		===>  Extracting for gv-3.5.8
		>> Checksum OK for gv-3.5.8.tar.gz.
		/bin/rm -rf /a/park/usr/ports/print/gv/work
		/bin/mkdir -p /a/park/usr/ports/print/gv/work
		for file in gv-3.5.8.tar.gz; do  if ! \
			(cd /a/park/usr/ports/print/gv/work && /usr/bin/gzip \
			-nf --best -dc /usr/ports/distfiles//$file | \
			 /usr/bin/tar -xf -); \
			then  exit 1;  fi  done
		/usr/ports/distfiles//gv-3.5.8.tar.gz: \
			Too many levels of symbolic links
		===>  Patching for gv-3.5.8
	The failure is in Mk/bsd.port.mk, not gzip, as this simple makefile, 
		xx:
			/usr/bin/gzip -nf --best -dc \
				/usr/ports/distfiles/gv-3.5.8.tar.gz > /tmp/t
        		echo This line is not echoed as gzip errors OK
	shows gzip returning an error code:
		/usr/ports/distfiles/gv-3.5.8.tar.gz: 
			Too many levels of symbolic links
		*** Error code 1
		Stop.
	So Mk/bsd.port.mk should also catch the error & stop, but it fails to.
	
>How-To-Repeat:
	
	Create EG a /usr/ports/distfiles//gv-3.5.8.tar.gz that goes through 35
	sym links 
	In Mk/bsd.port.mk remove the @ in a few lines  after line 1467 (do-extract:)
	go to some arbitrary port, 
	make clean
	make extract
	See that despite the
		Too many levels of symbolic links
	we now also wrongly have a work/.extract_done

>Fix:
	
	Mk/bsd.port.mk is ports-master domain _ so I leave fixing it to 
	the ports master(s). (but I am preparing a send-pr for src/
	that will double MAXSYMLINKS etc; this will hide (but not fix)
	the failure in Mk/bsd.port.mk, however even with this,
	if for some other reason gzip fails to return data to Mk/bsd.port.mk,
	Mk/bsd.port.mk might still not notice, so a fix is needed for Mk/bsd.port.mk )

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: asami 
State-Changed-When: Tue Jul 13 16:51:21 PDT 1999 
State-Changed-Why:  
That's because it's a pipe and a shell pipe returns the exit status 
of the last command executed.  I'm sorry, but there's nothing we 
can do about it unless this behavior of sh is changed.  I don't see 
much problem with this anyway, the make will bomb out very soon and the 
user has the "Too many levels of symbolic links" staring right at them. 


Responsible-Changed-From-To: freebsd-ports->asami 
Responsible-Changed-By: asami 
Responsible-Changed-When: Tue Jul 13 16:51:21 PDT 1999 
Responsible-Changed-Why:  
my area 
>Unformatted:
