From be9eb6014ef2948fb0e81e527cd12109aa436dc3 Mon Sep 17 00:00:00 2001 From: grant Date: Tue, 11 Feb 2003 16:42:06 +0000 Subject: belatedly sync with src: Allow '%D' to be used when no last_file available. Fixes binary package installation of gnome-dirs. crank PKGTOOLS_VERSION to 20030202. --- pkgtools/pkg_install/files/add/extract.c | 8 ++------ pkgtools/pkg_install/files/lib/file.c | 10 +++++++--- pkgtools/pkg_install/files/lib/version.h | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'pkgtools/pkg_install') diff --git a/pkgtools/pkg_install/files/add/extract.c b/pkgtools/pkg_install/files/add/extract.c index 6df4ee92b11..2f64eb44ff1 100644 --- a/pkgtools/pkg_install/files/add/extract.c +++ b/pkgtools/pkg_install/files/add/extract.c @@ -1,4 +1,4 @@ -/* $NetBSD: extract.c,v 1.2 2003/01/06 04:34:15 jschauma Exp $ */ +/* $NetBSD: extract.c,v 1.3 2003/02/11 16:42:06 grant Exp $ */ #if 0 #include @@ -6,7 +6,7 @@ #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.2 2003/01/06 04:34:15 jschauma Exp $"); +__RCSID("$NetBSD: extract.c,v 1.3 2003/02/11 16:42:06 grant Exp $"); #endif #endif #endif @@ -306,10 +306,6 @@ extract_plist(char *home, package_t *pkg) 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 --git a/pkgtools/pkg_install/files/lib/file.c b/pkgtools/pkg_install/files/lib/file.c index faf268887f5..c93dd0680e0 100644 --- a/pkgtools/pkg_install/files/lib/file.c +++ b/pkgtools/pkg_install/files/lib/file.c @@ -1,4 +1,4 @@ -/* $NetBSD: file.c,v 1.2 2003/01/06 04:34:17 jschauma Exp $ */ +/* $NetBSD: file.c,v 1.3 2003/02/11 16:42:06 grant Exp $ */ #if 0 #include @@ -6,7 +6,7 @@ #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.2 2003/01/06 04:34:17 jschauma Exp $"); +__RCSID("$NetBSD: file.c,v 1.3 2003/02/11 16:42:06 grant Exp $"); #endif #endif #endif @@ -589,7 +589,11 @@ format_cmd(char *buf, size_t size, char *fmt, char *dir, char *name) 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); diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h index 42ef5f6ca53..c490426d427 100644 --- a/pkgtools/pkg_install/files/lib/version.h +++ b/pkgtools/pkg_install/files/lib/version.h @@ -1,4 +1,4 @@ -/* $NetBSD: version.h,v 1.3 2003/01/11 07:52:19 schmonz Exp $ */ +/* $NetBSD: version.h,v 1.4 2003/02/11 16:42:07 grant Exp $ */ /* * Copyright (c) 2001 Thomas Klausner. All rights reserved. @@ -33,6 +33,6 @@ #ifndef _INST_LIB_VERSION_H_ #define _INST_LIB_VERSION_H_ -#define PKGTOOLS_VERSION "20030111" +#define PKGTOOLS_VERSION "20030202" #endif /* _INST_LIB_VERSION_H_ */ -- cgit v1.2.3