Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/pkg_install Allow '%D' to be used when no last_file...
details: https://anonhg.NetBSD.org/src/rev/93a968d71340
branches: trunk
changeset: 542600:93a968d71340
user: abs <abs%NetBSD.org@localhost>
date: Sun Feb 02 12:59:53 2003 +0000
description:
Allow '%D' to be used when no last_file available. Fixes binary package
installation of gnome-dirs.
diffstat:
usr.sbin/pkg_install/add/extract.c | 8 ++------
usr.sbin/pkg_install/lib/file.c | 10 +++++++---
2 files changed, 9 insertions(+), 9 deletions(-)
diffs (58 lines):
diff -r 88250b74119a -r 93a968d71340 usr.sbin/pkg_install/add/extract.c
--- a/usr.sbin/pkg_install/add/extract.c Sun Feb 02 12:37:41 2003 +0000
+++ b/usr.sbin/pkg_install/add/extract.c Sun Feb 02 12:59:53 2003 +0000
@@ -1,11 +1,11 @@
-/* $NetBSD: extract.c,v 1.28 2003/01/05 21:49:51 agc Exp $ */
+/* $NetBSD: extract.c,v 1.29 2003/02/02 12:59:53 abs Exp $ */
#include <sys/cdefs.h>
#ifndef lint
#if 0
static const char *rcsid = "FreeBSD - Id: extract.c,v 1.17 1997/10/08 07:45:35 charnier Exp";
#else
-__RCSID("$NetBSD: extract.c,v 1.28 2003/01/05 21:49:51 agc Exp $");
+__RCSID("$NetBSD: extract.c,v 1.29 2003/02/02 12:59:53 abs Exp $");
#endif
#endif
@@ -294,10 +294,6 @@
break;
case PLIST_CMD:
- if (last_file == NULL && strchr(p->name, '%') != NULL) {
- cleanup(0);
- errx(2, "no last file specified for '%s' command", p->name);
- }
format_cmd(cmd, sizeof(cmd), p->name, Directory, last_file);
PUSHOUT(Directory);
if (Verbose)
diff -r 88250b74119a -r 93a968d71340 usr.sbin/pkg_install/lib/file.c
--- a/usr.sbin/pkg_install/lib/file.c Sun Feb 02 12:37:41 2003 +0000
+++ b/usr.sbin/pkg_install/lib/file.c Sun Feb 02 12:59:53 2003 +0000
@@ -1,11 +1,11 @@
-/* $NetBSD: file.c,v 1.57 2003/01/05 21:27:27 agc Exp $ */
+/* $NetBSD: file.c,v 1.58 2003/02/02 12:59:54 abs Exp $ */
#include <sys/cdefs.h>
#ifndef lint
#if 0
static const char *rcsid = "from FreeBSD Id: file.c,v 1.29 1997/10/08 07:47:54 charnier Exp";
#else
-__RCSID("$NetBSD: file.c,v 1.57 2003/01/05 21:27:27 agc Exp $");
+__RCSID("$NetBSD: file.c,v 1.58 2003/02/02 12:59:54 abs Exp $");
#endif
#endif
@@ -568,7 +568,11 @@
for (bufp = buf; (int) (bufp - buf) < size && *fmt;) {
if (*fmt == '%') {
- switch (*++fmt) {
+ if (*++fmt != 'D' && name == NULL) {
+ cleanup(0);
+ errx(2, "no last file available for '%s' command", buf);
+ }
+ switch (*fmt) {
case 'F':
strnncpy(bufp, size - (int) (bufp - buf), name, strlen(name));
bufp += strlen(bufp);
Home |
Main Index |
Thread Index |
Old Index