From neild@rpi.edu  Sat Sep  2 22:19:53 1995
Received: from mail1.its.rpi.edu (mail1.its.rpi.edu [128.113.100.7])
          by freefall.FreeBSD.org (8.6.11/8.6.6) with ESMTP id WAA06951
          for <FreeBSD-gnats-submit@freebsd.org>; Sat, 2 Sep 1995 22:19:53 -0700
Received: from magritte.its.rpi.edu (magritte.its.rpi.edu [128.113.100.20]) by mail1.its.rpi.edu (8.6.9/8.6.4) with ESMTP id BAA17356 for <FreeBSD-gnats-submit@freebsd.org>; Sun, 3 Sep 1995 01:19:50 -0400
Received: (neild@localhost) by magritte.its.rpi.edu (8.6.9/8.6.4) id BAA64470; Sun, 3 Sep 1995 01:19:30 -0400
Message-Id: <199509030519.BAA64470@magritte.its.rpi.edu>
Date: Sun, 3 Sep 1995 01:19:30 -0400
From: neild@rpi.edu
Reply-To: neild@rpi.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: Minor bug in pkg_add.
X-Send-Pr-Version: 3.2

>Number:         718
>Category:       bin
>Synopsis:       pkg_add incorrectly prints an error message
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jkh
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep  2 22:20:00 PDT 1995
>Closed-Date:    Sun Jun 2 21:48:37 PDT 1996
>Last-Modified:  Sun Jun  2 21:48:58 PDT 1996
>Originator:     Damien Neil
>Release:        FreeBSD 2.0-BUILT-19950603 i386
>Organization:
Case Western Reserve University
>Environment:

	

>Description:

When pkg_add discovers that it has insufficient temp space to unpack
a package, it displays an error message.  This error message is not
printed correctly.  It appears as:

Projected size of 24276116 exceeds free space in (null).
Not extracting /usr/home/damien/pkg_install/../emacs-19.28.tgz, sorry!

Clearly, the `(null)' is incorrect; it is intented to be the name of
the temp directory being used.

>How-To-Repeat:

Invoke pkg_add on a packate, with a temp directory that does not contain
sufficient space to unpack the package.  In my case, simply running

    $ /usr/sbin/pkg_add emacs-19.28.tgz

produces the error.

>Fix:

Apply the patch attached below in the .../src/usr.sbin/pkg_install/
directory.

Note that there are two separate bugs, either of which alone will produce
the incorrect behavior.

--- add/perform-old.c	Sat Sep  2 21:49:03 1995
+++ add/perform.c	Sat Sep  2 21:50:15 1995
@@ -165,7 +165,8 @@
 	    }
 	}
 	else
-	    where_to = PlayPen;
+	    where_to = where_playpen();
+
 	/*
 	 * Apply a crude heuristic to see how much space the package will
 	 * take up once it's unpacked.  I've noticed that most packages
@@ -178,7 +179,7 @@
 
 	if (min_free(where_to) < sb.st_size * 4) {
 	    whinge("Projected size of %d exceeds free space in %s.",
-		   sb.st_size * 4, where_to);
+		   (int)sb.st_size * 4, where_to);
 	    whinge("Not extracting %s, sorry!", pkg_fullname);
 	    goto bomb;
 	}
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jkh 
Responsible-Changed-By: scrappy 
Responsible-Changed-When: Sun May 26 22:57:08 PDT 1996 
Responsible-Changed-Why:  
jordan's baby...I think? 
State-Changed-From-To: open->closed 
State-Changed-By: jkh 
State-Changed-When: Sun Jun 2 21:48:37 PDT 1996 
State-Changed-Why:  
This has been fixed. 
>Unformatted:
