Subject: problem with pkg_add and depoted packages
To: None <tech-pkg@netbsd.org>
From: Joachim Kuebart <kuebart@mathematik.uni-ulm.de>
List: tech-pkg
Date: 03/12/2005 03:41:23
Hi,

I'm experiencing a problem with pkg_add when adding depoted packages: if
the package is to be linked into the "" view, the command

	pkg_add -w "" digest-20021220

yields a usage message from pkg_view. This is due to the fact that pkg_view
gets called with an argument of "-w " (note the space) by pkg_add. So I
applied this patch:

Index: perform.c
===================================================================
RCS file: /pub/NetBSD-CVS/src/usr.sbin/pkg_install/add/perform.c,v
retrieving revision 1.106
diff -u -p -r1.106 perform.c
--- perform.c	4 Feb 2005 09:03:02 -0000	1.106
+++ perform.c	12 Mar 2005 02:39:25 -0000
@@ -936,9 +936,9 @@ ignore_replace_depends_check:
 		}
 
 		fexec_skipempty(BINDIR "/pkg_view", "-d", dbdir,
-				View ? "-w " : "", View ? View : "",
-				Viewbase ? "-W " : "", Viewbase ? Viewbase : "",
-				Verbose ? "-v " : "", "add", PkgName, NULL);
+				View ? "-w" : "", View ? View : "",
+				Viewbase ? "-W" : "", Viewbase ? Viewbase : "",
+				Verbose ? "-v" : "", "add", PkgName, NULL);
 	}
 
 	goto success;

Now, the problem that remains is that fexec_skipempty() will delete the
empty option argument to -w, and pkg_view still complains with a usage
message.

What to do about this?

Cheers,

cu Jo

-- 
La perfection est atteinte non quand il ne reste rien à ajouter, mais quand
il ne reste rien à enlever.  (Antoine de Saint-Exupéry)