From dan@spirit.jaded.net  Tue Jan 11 17:21:45 2000
Return-Path: <dan@spirit.jaded.net>
Received: from spirit.jaded.net (liv3-3.hamilton.idirect.com [209.161.208.3])
	by hub.freebsd.org (Postfix) with ESMTP id 9D1A614EF2
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 11 Jan 2000 17:21:34 -0800 (PST)
	(envelope-from dan@spirit.jaded.net)
Received: (from dan@localhost)
	by spirit.jaded.net (8.9.3/8.9.3) id UAA01888;
	Tue, 11 Jan 2000 20:27:21 -0500 (EST)
Message-Id: <200001120127.UAA01888@spirit.jaded.net>
Date: Tue, 11 Jan 2000 20:27:21 -0500 (EST)
From: dan@freebsd.org
Sender: dan@spirit.jaded.net
Reply-To: dan@freebsd.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: pkg_delete feature: handle full paths
X-Send-Pr-Version: 3.2

>Number:         16074
>Category:       bin
>Synopsis:       pkg_delete feature
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 11 17:30:00 PST 2000
>Closed-Date:    Tue Feb 8 08:53:41 PST 2000
>Last-Modified:  Tue Feb  8 08:54:13 PST 2000
>Originator:     Dan Moschuk
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
>Environment:
n/a
>Description:
Request for pkg_delete feature to handle /var/db/pkg/pkgname as a valid
package name.
>How-To-Repeat:
n/a
>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->dan 
Responsible-Changed-By: dan 
Responsible-Changed-When: Tue Jan 11 17:32:15 PST 2000 
Responsible-Changed-Why:  
Assigning me my own PR 

From: "Matthew D. Fuller" <fullermd@futuresouth.com>
To: dan@FreeBSD.ORG
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/16074: pkg_delete feature: handle full paths
Date: Tue, 11 Jan 2000 20:06:16 -0600

 > >Description:
 > Request for pkg_delete feature to handle /var/db/pkg/pkgname as a valid
 > package name.
 
 Just sent diffs to the cvs-all/cvs-commiters mailing lists with patches
 to do this (pkg_info also).  See below for posterity.
 
 
 Index: delete/main.c
 ===================================================================
 RCS file: /usr/cvs/src/usr.sbin/pkg_install/delete/main.c,v
 retrieving revision 1.14
 diff -u -r1.14 main.c
 --- main.c	1999/08/28 01:18:01	1.14
 +++ main.c	2000/01/12 02:00:25
 @@ -41,6 +41,7 @@
  {
      int ch, error;
      char **pkgs, **start;
 +    char *pkgs_split;
  
      pkgs = start = argv;
      while ((ch = getopt(argc, argv, Options)) != -1)
 @@ -81,9 +82,29 @@
      argv += optind;
  
      /* Get all the remaining package names, if any */
 -    /* Get all the remaining package names, if any */
      while (*argv)
 -	*pkgs++ = *argv++;
 +    {
 +        if( (pkgs_split = rindex(*argv, (int) '/')) != NULL )
 +        {
 +            while( !isalpha(*(pkgs_split+1)) )
 +            {
 +                *pkgs_split = '\0';
 +                pkgs_split = rindex(*argv, (int) '/');
 +            }
 +            if(pkgs_split != NULL)
 +            {
 +                pkgs_split++;
 +                *pkgs = pkgs_split;
 +                pkgs++;
 +            }
 +        }
 +        else
 +        {
 +            *pkgs = *argv;
 +            pkgs++;
 +        }
 +        argv++;
 +    }
  
      /* If no packages, yelp */
      if (pkgs == start)
 Index: info/main.c
 ===================================================================
 RCS file: /usr/cvs/src/usr.sbin/pkg_install/info/main.c,v
 retrieving revision 1.20
 diff -u -r1.20 main.c
 --- main.c	2000/01/07 13:25:53	1.20
 +++ main.c	2000/01/12 02:00:26
 @@ -44,6 +44,7 @@
  {
      int ch;
      char **pkgs, **start;
 +    char *pkgs_split;
  
      pkgs = start = argv;
      if (argc == 1) {
 @@ -144,7 +145,28 @@
  
      /* Get all the remaining package names, if any */
      while (*argv)
 -	*pkgs++ = *argv++;
 +    {
 +        if( (pkgs_split = rindex(*argv, (int) '/')) != NULL )
 +        {
 +            while( !isalpha(*(pkgs_split+1)) )
 +            {
 +                *pkgs_split = '\0';
 +                pkgs_split = rindex(*argv, (int) '/');
 +            }
 +            if(pkgs_split != NULL)
 +            {
 +                pkgs_split++;
 +                *pkgs = pkgs_split;
 +                pkgs++;
 +            }
 +        }
 +        else
 +        {
 +            *pkgs = *argv;
 +            pkgs++;
 +        }
 +        argv++;
 +    }
  
      /* If no packages, yelp */
      if (pkgs == start && !AllInstalled && !CheckPkg)
 
 
 
 
 -- 
 Matthew Fuller     (MF4839)     |    fullermd@over-yonder.net
 Unix Systems Administrator      |    fullermd@futuresouth.com
 Specializing in FreeBSD         |    http://www.over-yonder.net/
 
 "The only reason I'm burning my candle at both ends, is because I
       haven't figured out how to light the middle yet"
 
State-Changed-From-To: open->closed 
State-Changed-By: dan 
State-Changed-When: Fri Jan 14 17:16:18 PST 2000 
State-Changed-Why:  
Feature committed. 
State-Changed-From-To: closed->open 
State-Changed-By: dan 
State-Changed-When: Fri Jan 14 17:17:10 PST 2000 
State-Changed-Why:  
Oops.  Re-open to remind me to MFC. 
State-Changed-From-To: open->closed 
State-Changed-By: dan 
State-Changed-When: Tue Feb 8 08:53:41 PST 2000 
State-Changed-Why:  
I committed this long ago. 
>Unformatted:
