From aturetta@bestunion.it  Wed Mar 21 17:03:08 2007
Return-Path: <aturetta@bestunion.it>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 3A68016A408
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 21 Mar 2007 17:03:08 +0000 (UTC)
	(envelope-from aturetta@bestunion.it)
Received: from aa001msb.fastweb.it (aa001msb.fastweb.it [85.18.95.80])
	by mx1.freebsd.org (Postfix) with ESMTP id 6E1EF13C45B
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 21 Mar 2007 17:03:06 +0000 (UTC)
	(envelope-from aturetta@bestunion.it)
Received: from mail.bestunion.it (85.18.250.114) by aa001msb.fastweb.it (7.3.117.3)
        id 45F6AA2D006D75A6 for FreeBSD-gnats-submit@freebsd.org; Wed, 21 Mar 2007 17:51:24 +0100
Received: from proxy.lan.bestunion.it (vpn.bestunion.it [192.168.33.209])
	by mail.bestunion.it (8.14.0/8.14.0) with ESMTP id l2LGpLZL083203
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Mar 2007 17:51:23 +0100 (CET)
	(envelope-from aturetta@bestunion.it)
Received: (from root@localhost)
	by proxy.lan.bestunion.it (8.13.8/8.13.8/Submit) id l2LGpLOV041320;
	Wed, 21 Mar 2007 17:51:21 +0100 (CET)
	(envelope-from aturetta@bestunion.it)
Message-Id: <200703211651.l2LGpLOV041320@proxy.lan.bestunion.it>
Date: Wed, 21 Mar 2007 17:51:21 +0100 (CET)
From: Angelo Turetta <aturetta@bestunion.it>
To: FreeBSD-gnats-submit@freebsd.org
Subject: ports-mgmt/portupgrade deletes package on build failure
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         110630
>Category:       ports
>Synopsis:       ports-mgmt/portupgrade deletes package on build failure
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    sem
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 21 17:10:09 GMT 2007
>Closed-Date:    Sat Jan 12 18:49:02 UTC 2008
>Last-Modified:  Sat Jan 12 18:49:02 UTC 2008
>Originator:     Angelo Turetta
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD proxy.lan.bestunion.it 6.2-STABLE FreeBSD 6.2-STABLE #22: Wed Mar  7 17:38:45 CET 2007	aturetta@snape.lan.bestunion.it:/usr/obj/usr/src/sys/IPSEC i386

Relevant ports:

portupgrade-2.2.6_2,2       =  up-to-date with port
ruby-1.8.5.12,1             =  up-to-date with port
ruby18-bdb44-0.6.0          =  up-to-date with port
db44-4.4.20.4               =  up-to-date with port

	
>Description:
	Running portupgrade to update port versions, if for some reason the build 
	phase fails, portupgrade will no matter remove the installed port, breaking all 
	kinds of dependencies (and possibly making the machine unreacheable)

	It happened to me yesterday on two different machines for the tk84 port (which was broken 
        by a missing patch file in the morning (UTC) of 2007-03-20) 
	and on another machine for the port cvsup-mirror (which cannot be built in 'batch' 
        mode).

	I had already reported some strange behavior in case of build errors, but got no answers: 
	see http://lists.freebsd.org/pipermail/freebsd-ports/2006-September/035507.html

	I attach the portupgrade output for the two failures I noticed:

	---------------------- cvsup-mirror --------------
		--->  Upgrading 'cvsup-mirror-1.3_5' to 'cvsup-mirror-1.3_6' (net/cvsup-mirror)
		--->  Building '/usr/ports/net/cvsup-mirror'
		===>  Cleaning for cvsup-without-gui-16.1h_2
		===>  Cleaning for ezm3-1.2_1
		===>  Cleaning for gmake-3.81_1
		===>  Cleaning for gettext-0.16.1
		===>  Cleaning for libtool-1.5.22_4
		===>  Cleaning for libiconv-1.9.2_2
		===>  Cleaning for cvsup-mirror-1.3_6
		===>  cvsup-mirror-1.3_6 is an interactive port.
		*** Error code 1
		
		Stop in /usr/ports/net/cvsup-mirror.
		
		--->  Backing up the old version
		--->  Uninstalling the old version
		--->  Deinstalling 'cvsup-mirror-1.3_5'
		Do you want me to remove scheduled updates from "/etc/crontab" [y]? Done.
		Do you want me to remove the cvsupd logging from "/etc/syslog.conf" [y]? n
		Do you want me to remove the cvsup and cvsupd log entries from "/etc/newsyslog.conf" [y]? n
		Do you want me to remove group "cvsup" [y]? n
		Do you want me to remove user "cvsup" [y]? n
		Do you want me to remove group "cvsupin" [y]? n
		Do you want me to remove user "cvsupin" [y]? n
		pkg_delete: '/usr/local/etc/cvsup/config.sh' fails original MD5 checksum - deleted anyway.
		[Updating the pkgdb <format:bdb_btree> in /var/db/pkg ... - 483 packages found (-1 +0) (...) done]
		--->  Installing the new version via the port
		===>  cvsup-mirror-1.3_6 is an interactive port.
		*** Error code 1
		
		Stop in /usr/ports/net/cvsup-mirror.
		** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade.24918.10 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=cvsup-mirror-1.3_5 UPGRADE_PORT_VER=1.3_5 make BATCH=yes DEPENDS_TARGET=package reinstall
	----------------- end cvsup mirror --------------

	------------------ x11-toolkits/tk84 ------------
		===>  Cleaning for tcl-8.4.14_2,1
		===>  Cleaning for xorg-libraries-6.9.0_1
		===>  Cleaning for imake-6.9.0_1
		===>  Cleaning for libdrm-2.0.2
		===>  Cleaning for freetype2-2.2.1_1
		===>  Cleaning for fontconfig-2.4.2,1
		===>  Cleaning for perl-5.8.8
		===>  Cleaning for gmake-3.81_1
		===>  Cleaning for libtool-1.5.22_4
		===>  Cleaning for pkg-config-0.21
		===>  Cleaning for expat-2.0.0_1
		===>  Cleaning for gettext-0.16.1
		===>  Cleaning for libiconv-1.9.2_2
		===>  Cleaning for tk-8.4.14_3,2
		===>  Extracting for tk-8.4.14_3,2
		=> MD5 Checksum OK for tk8.4.14-src.tar.gz.
		=> SHA256 Checksum OK for tk8.4.14-src.tar.gz.
		===>  Patching for tk-8.4.14_3,2
		===>  Applying FreeBSD patches for tk-8.4.14_3,2
		===>   tk-8.4.14_3,2 depends on executable in : tclsh8.4 - found
		===>   tk-8.4.14_3,2 depends on shared library: X11.6 - found
		===>  Configuring for tk-8.4.14_3,2
		
		   <<<<< snip >>>>>
		
		===>  Building for tk-8.4.14_3,2
		cc -pipe -c -O2 -fno-strict-aliasing (......)
		
		   <<<<< snip >>>>>
		
		cc -pipe -O2 -fno-strict-aliasing -pipe    tkAppInit.o -L/video/usr/ports/x11-toolkits/tk84/work/tk8.4.14/unix -ltk84  -L/usr/local/lib -ltcl84  -L/usr/X11R6/lib -lX11  -lm -Wl,-rpath,/usr/local/lib:/usr/X11R6/lib -o wish
		===>  Installing for tk-8.4.14_3,2
		===>   tk-8.4.14_3,2 depends on executable in : tclsh8.4 - found
		===>   tk-8.4.14_3,2 depends on shared library: X11.6 - found
		** Missing /usr/ports/x11-toolkits/tk84/files/pkgIndex.tcl.in for tk-8.4.14_3,2.
		*** Error code 1
		
		Stop in /usr/ports/x11-toolkits/tk84.
		*** Error code 1
		
		Stop in /usr/ports/x11-toolkits/tk84.
		
		
		pkg_delete: package 'tk-8.4.14_2,2' is required by these other packages
		and may not be deinstalled (but I'll delete it anyway):
		git-1.4.4.4
		graphviz-2.12_1
		[Updating the pkgdb <format:bdb_btree> in /var/db/pkg ... - 482 packages found (-1 +0) (...) done]
		** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade.30568.1 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=tk-8.4.14_2,2 UPGRADE_PORT_VER=8.4.14_2,2 make BATCH=yes DEPENDS_TARGET=package reinstall
		pkg_create: can't find package 'tk-8.4.14_2,2' installed!
		pkg_create: package creation failed

	------------------ x11-toolkits/tk84 ------------

*******  Please note, 
in the case of tk84 the output is taken from the log file generated 
by the -L portupgrade option, PLUS the stderr output of the portupgrade command itself. My batch 
dumps the stdout of portupgrade to /dev/null (btw, this is due to another 'regression' I found 
in recent portupgrade, that even if you specify -L, the output from the build is always 
printed to stdout: this was not the case in pre 2.x versions, let's say one year ago)
>How-To-Repeat:
	
>Fix:

	


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->sem 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Mar 21 17:10:19 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110630 

From: Angelo Turetta <aturetta@bestunion.it>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: ports/110630: ports-mgmt/portupgrade deletes package on build failure
Date: Wed, 21 Mar 2007 18:46:11 +0100

 One small addition. This bug might be triggered by specifying the '-k' 
 switch when calling portupgrade.
 
 I'm sure the repackaging behaviour I mentioned in the note is 
 independent of the '-k' switch (as I only became aware of its existence 
 in the last few weeks)
 
 Angelo Turetta

From: Angelo Turetta <aturetta@bestunion.it>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: ports/110630: ports-mgmt/portupgrade deletes package on build failure
Date: Wed, 21 Mar 2007 18:47:12 +0100

 One small addition. This bug might be triggered by specifying the '-k' 
 switch when calling portupgrade.
 
 I'm sure the repackaging behaviour I mentioned in the text is 
 independent of the '-k' switch (as I only became aware of its existence 
 in the last few weeks)
 
 Angelo Turetta

From: Sergey Matveychuk <sem@FreeBSD.org>
To: bug-followup@FreeBSD.org, aturetta@bestunion.it
Cc:  
Subject: Re: ports/110630: ports-mgmt/portupgrade deletes package on build failure
Date: Fri, 23 Mar 2007 12:13:47 +0300

 Please correct me if I understood wrong.
 You mean portupgrade run with -p option removes port if build was broken?
 -- 
 Dixi.
 Sem.
State-Changed-From-To: open->analyzed 
State-Changed-By: sem 
State-Changed-When: Sat Apr 7 07:15:58 UTC 2007 
State-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=110630 
State-Changed-From-To: analyzed->feedback 
State-Changed-By: sem 
State-Changed-When: Sat Jan 12 18:44:09 UTC 2008 
State-Changed-Why:  
Feedback is a correct state 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110630 
State-Changed-From-To: feedback->closed 
State-Changed-By: sem 
State-Changed-When: Sat Jan 12 18:49:01 UTC 2008 
State-Changed-Why:  
can't reproduce it and feedback timeout 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110630 
>Unformatted:
