Bug 12635 - Mk/bsd.port.mk fails to detect gzip fail to extract
Summary: Mk/bsd.port.mk fails to detect gzip fail to extract
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Satoshi Asami
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-07-14 00:10 UTC by jhs
Modified: 1999-07-14 00:53 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jhs freebsd_committer freebsd_triage 1999-07-14 00:10:01 UTC
	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.

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 )
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
Comment 1 Satoshi Asami freebsd_committer freebsd_triage 1999-07-14 00:51:21 UTC
State Changed
From-To: open->closed

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. 


Comment 2 Satoshi Asami freebsd_committer freebsd_triage 1999-07-14 00:51:21 UTC
Responsible Changed
From-To: freebsd-ports->asami

my area