From nobody@FreeBSD.org  Sat Dec 13 20:19:13 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E436E1065679
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 13 Dec 2008 20:19:13 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id D36BC8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 13 Dec 2008 20:19:13 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDKJDUJ022962
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 13 Dec 2008 20:19:13 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id mBDKJDFl022961;
	Sat, 13 Dec 2008 20:19:13 GMT
	(envelope-from nobody)
Message-Id: <200812132019.mBDKJDFl022961@www.freebsd.org>
Date: Sat, 13 Dec 2008 20:19:13 GMT
From: Alex Keda <admin@lissyara.su>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Incorrect bzip2 behavior
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         129620
>Category:       bin
>Synopsis:       [patch] Incorrect bzip2(1) behavior
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 13 20:20:00 UTC 2008
>Closed-Date:    Mon Nov 15 15:51:54 UTC 2010
>Last-Modified:  Mon Nov 15 15:51:54 UTC 2010
>Originator:     Alex Keda
>Release:        CURRENT
>Organization:
USSR
>Environment:
FreeBSD acer.lissyara.int.otradno.ru 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Sat Dec 13 22:29:48 MSK 2008     lissyara@acer.lissyara.int.otradno.ru:/usr/obj/usr/src/sys/color-console  amd64

>Description:
acer# bzip2 --best --keep vmcore.9
bzip2: Input file vmcore.9 has 1 other link.
acer# bzip2 --best --keep --force vmcore.9
acer# ll | grep core
-rw-------  2 root  wheel   206M 13 &#1076;&#1077;&#1082; 22:41 vmcore.9
-rw-------  1 root  wheel    15M 13 &#1076;&#1077;&#1082; 22:41 vmcore.9.bz2
acer#   
================
I use '--keep' option. I think, not need check num links in this situation...
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: Jaakko Heinonen <jh@saunalahti.fi>
To: Alex Keda <admin@lissyara.su>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/129620: Incorrect bzip2 behavior
Date: Tue, 16 Dec 2008 17:59:13 +0200

 On 2008-12-13, Alex Keda wrote:
 > acer# bzip2 --best --keep vmcore.9
 > bzip2: Input file vmcore.9 has 1 other link.
 > acer# bzip2 --best --keep --force vmcore.9
 > acer# ll | grep core
 > -rw-------  2 root  wheel   206M 13 &#1076;&#1077;&#1082; 22:41 vmcore.9
 > -rw-------  1 root  wheel    15M 13 &#1076;&#1077;&#1082; 22:41 vmcore.9.bz2
 > acer#   
 > ================
 > I use '--keep' option. I think, not need check num links in this situation...
 
 This patch should do it:
 
 --- bzip2.c.patch begins here ---
 Index: contrib/bzip2/bzip2.c
 ===================================================================
 --- contrib/bzip2/bzip2.c	(revision 186035)
 +++ contrib/bzip2/bzip2.c	(working copy)
 @@ -1208,7 +1208,7 @@ void compress ( Char *name )
  	 return;
        }
     }
 -   if ( srcMode == SM_F2F && !forceOverwrite &&
 +   if ( srcMode == SM_F2F && !forceOverwrite && !keepInputFiles &&
          (n=countHardLinks ( inName )) > 0) {
        fprintf ( stderr, "%s: Input file %s has %d other link%s.\n",
                  progName, inName, n, n > 1 ? "s" : "" );
 --- bzip2.c.patch ends here ---
 
 Could you report this to bzip2 upstream? Looks like this behavior
 exists in the latest upstream version.
 
 -- 
 Jaakko

From: Alex Keda <admin@lissyara.su>
To: bug-followup@FreeBSD.org, admin@lissyara.su
Cc:  
Subject: Re: bin/129620: Incorrect bzip2(1) behavior
Date: Tue, 16 Dec 2008 19:58:15 +0300

 	
 No. I thought that this is part of the base system....
 Not GNU...
State-Changed-From-To: open->feedback 
State-Changed-By: arundel 
State-Changed-When: Mon Nov 15 13:41:03 UTC 2010 
State-Changed-Why:  
Could we please re-evaluate this issue? Changing the semantics of bzip2 is 
trvial (see patch). However this would introduce inconsistency between 

'bzip2	--keep', 
'gunzip	--keep' and 
'xz	--keep' 

cheers. 
alex 

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

From: Alex Keda <admin@lissyara.su>
To: bug-followup@FreeBSD.org, admin@lissyara.su
Cc:  
Subject: Re: bin/129620: [patch] Incorrect bzip2(1) behavior
Date: Mon, 15 Nov 2010 16:58:15 +0300

 I think, keep it as-is, because I meet with it only one - when write bug 
 report..
 
 please, close it request.
State-Changed-From-To: feedback->closed 
State-Changed-By: arundel 
State-Changed-When: Mon Nov 15 15:51:26 UTC 2010 
State-Changed-Why:  
Originator requested that this should be closed. 

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