Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jul 1999 01:50:46 -0700 (PDT)
From:      Mark Diekhans <markd@Grizzly.COM>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/12570: No way to keep pkg_add from installing prerequisite
Message-ID:  <199907090850.BAA65762@osprey.grizzly.com>

next in thread | raw e-mail | index | archive | help

>Number:         12570
>Category:       bin
>Synopsis:       No way to keep pkg_add from installing prerequisite
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul  9 02:00:01 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Mark Diekhans
>Release:        FreeBSD 3.2-RELEASE i386
>Organization:
Grizzly
>Environment:


>Description:

    pkg_add just goes ahead and installs prerequisite if it can find them.  Especially
    likely if -r is specified.  While this is a great default, sometimes one doesn't
    want a package dragging down 3/4 of the world.  An option is needed to disable this.
    A patch is enclosed that add a -N option to disable this feature.

>How-To-Repeat:

>Fix:

*** add.h.ORG	Fri Jul  9 01:25:15 1999
--- add.h	Fri Jul  9 01:27:59 1999
***************
*** 29,34 ****
--- 29,35 ----
  extern Boolean	NoInstall;
  extern Boolean	NoRecord;
  extern Boolean	Force;
+ extern Boolean	NoPrereqInstall;
  extern char	*Mode;
  extern char	*Owner;
  extern char	*Group;
*** main.c.ORG	Fri Jul  9 01:24:53 1999
--- main.c	Fri Jul  9 01:44:58 1999
***************
*** 30,40 ****
  #include "lib.h"
  #include "add.h"
  
! static char Options[] = "hvIRfnrp:SMt:";
  
  char	*Prefix		= NULL;
  Boolean	NoInstall	= FALSE;
  Boolean	NoRecord	= FALSE;
  Boolean Remote		= FALSE;
  
  char	*Mode		= NULL;
--- 30,41 ----
  #include "lib.h"
  #include "add.h"
  
! static char Options[] = "hvIRfNnrp:SMt:";
  
  char	*Prefix		= NULL;
  Boolean	NoInstall	= FALSE;
  Boolean	NoRecord	= FALSE;
+ Boolean	NoPrereqInstall = FALSE;
  Boolean Remote		= FALSE;
  
  char	*Mode		= NULL;
***************
*** 88,93 ****
--- 89,98 ----
  	    Force = TRUE;
  	    break;
  
+ 	case 'N':
+ 	    NoPrereqInstall = TRUE;
+ 	    break;
+ 
  	case 'n':
  	    Fake = TRUE;
  	    Verbose = TRUE;
***************
*** 206,212 ****
  usage()
  {
      fprintf(stderr, "%s\n%s\n",
! 		"usage: pkg_add [-vInrfRMS] [-t template] [-p prefix]",
  		"               pkg-name [pkg-name ...]");
      exit(1);
  }
--- 211,217 ----
  usage()
  {
      fprintf(stderr, "%s\n%s\n",
! 		"usage: pkg_add [-vInfNrRMS] [-t template] [-p prefix]",
  		"               pkg-name [pkg-name ...]");
      exit(1);
  }
*** perform.c.ORG	Fri Jul  9 01:25:06 1999
--- perform.c	Fri Jul  9 01:42:48 1999
***************
*** 246,252 ****
  	if (vsystem("pkg_info -e %s", p->name)) {
  	    char path[FILENAME_MAX], *cp = NULL;
  
! 	    if (!Fake) {
  		if (!isURL(pkg) && !getenv("PKG_ADD_BASE")) {
  		    snprintf(path, FILENAME_MAX, "%s/%s.tgz", getenv("_TOP"), p->name);
  		    if (fexists(path))
--- 246,253 ----
  	if (vsystem("pkg_info -e %s", p->name)) {
  	    char path[FILENAME_MAX], *cp = NULL;
  
! 
! 	    if (!Fake && !NoPrereqInstall) {
  		if (!isURL(pkg) && !getenv("PKG_ADD_BASE")) {
  		    snprintf(path, FILENAME_MAX, "%s/%s.tgz", getenv("_TOP"), p->name);
  		    if (fexists(path))
***************
*** 293,301 ****
  	    }
  	    else {
  		if (Verbose)
! 		    printf("and was not found%s.\n", Force ? " (proceeding anyway)" : "");
! 		else
! 		    printf("Package dependency %s for %s not found%s\n", p->name, pkg,
  			   Force ? " (proceeding anyway)" : "!");
  		if (!Force)
  		    ++code;
--- 294,305 ----
  	    }
  	    else {
  		if (Verbose)
! 		    printf("and was not found%s%s.\n",
!                            NoPrereqInstall ? " and prerequisite install disabled" : "",
!                            Force ? " (proceeding anyway)" : "");
! 		else 
! 		    printf("Package dependency %s for %s not found%s%s\n", p->name, pkg,
!                            NoPrereqInstall ? " and prerequisite install disabled" : "",
  			   Force ? " (proceeding anyway)" : "!");
  		if (!Force)
  		    ++code;
*** pkg_add.1.ORG	Fri Jul  9 01:24:58 1999
--- pkg_add.1	Fri Jul  9 01:44:30 1999
***************
*** 25,31 ****
  .Nd a utility for installing software package distributions
  .Sh SYNOPSIS
  .Nm
! .Op Fl vInfrRMS
  .Op Fl t Ar template
  .Op Fl p Ar prefix
  .Ar pkg-name [pkg-name ...]
--- 25,31 ----
  .Nd a utility for installing software package distributions
  .Sh SYNOPSIS
  .Nm
! .Op Fl vInfNrRMS
  .Op Fl t Ar template
  .Op Fl p Ar prefix
  .Ar pkg-name [pkg-name ...]
***************
*** 96,101 ****
--- 96,106 ----
  .Nm
  will still try to find and auto-install missing prerequisite packages,
  a failure to find one will not be fatal.
+ .It Fl N
+ Don't install prerequisite packages.  This causes the installation to
+ fail if a prerequisite is not installed unless
+ .Fl f 
+ is specified
  .It Fl p Ar prefix
  Set
  .Ar prefix

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907090850.BAA65762>