Add -U argument to pkg_create - by default, all files are added to the

pkgdb.byfile.db database. If -U is specified on command line to
pkg_create, don't add the PLIST entry to pkgdb.byfile.db.

Bump version number.
This commit is contained in:
agc 2001-05-18 13:21:38 +00:00
parent 8aa2f73d43
commit 6ccfedb598
5 changed files with 24 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: create.h,v 1.14 1999/12/20 03:25:57 hubertf Exp $ */
/* $NetBSD: create.h,v 1.15 2001/05/18 13:21:38 agc Exp $ */
/* from FreeBSD Id: create.h,v 1.13 1997/10/08 07:46:19 charnier Exp */
@ -48,6 +48,7 @@ extern int Dereference;
extern int PlistOnly;
extern int RelativeLinks;
extern int ReorderDirs;
extern int update_pkgdb;
void check_list(char *, package_t *, const char *);
void copy_plist(char *, package_t *);

View File

@ -1,11 +1,11 @@
/* $NetBSD: main.c,v 1.17 2001/03/05 16:53:13 wiz Exp $ */
/* $NetBSD: main.c,v 1.18 2001/05/18 13:21:38 agc Exp $ */
#include <sys/cdefs.h>
#ifndef lint
#if 0
static const char *rcsid = "from FreeBSD Id: main.c,v 1.17 1997/10/08 07:46:23 charnier Exp";
#else
__RCSID("$NetBSD: main.c,v 1.17 2001/03/05 16:53:13 wiz Exp $");
__RCSID("$NetBSD: main.c,v 1.18 2001/05/18 13:21:38 agc Exp $");
#endif
#endif
@ -24,7 +24,7 @@ __RCSID("$NetBSD: main.c,v 1.17 2001/03/05 16:53:13 wiz Exp $");
#include "lib.h"
#include "create.h"
static char Options[] = "ORhlVvFf:p:P:C:c:d:i:k:L:r:t:X:D:m:s:S:b:B:";
static char Options[] = "ORhlVvFf:p:P:C:c:d:i:k:L:r:t:X:D:m:s:S:b:B:U";
char *Prefix = NULL;
char *Comment = NULL;
@ -45,6 +45,7 @@ char *SizeAll = NULL;
char *SrcDir = NULL;
char PlayPen[FILENAME_MAX];
size_t PlayPenSize = sizeof(PlayPen);
int update_pkgdb = 1;
int Dereference = 0;
int PlistOnly = 0;
int RelativeLinks = 0;
@ -55,7 +56,7 @@ static void
usage(void)
{
fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
"usage: pkg_create [-ORhlVv] [-P dpkgs] [-C cpkgs] [-p prefix] [-f contents]",
"usage: pkg_create [-ORUhlVv] [-P dpkgs] [-C cpkgs] [-p prefix] [-f contents]",
" [-i iscript] [-k dscript] [-r rscript] [-t template]",
" [-X excludefile] [-D displayfile] [-m mtreefile]",
" [-b build-version-file] [-B build-info-file]",
@ -84,6 +85,10 @@ main(int argc, char **argv)
ReorderDirs = 1;
break;
case 'U':
update_pkgdb = 0;
break;
case 'p':
Prefix = optarg;
break;

View File

@ -1,4 +1,4 @@
.\" $NetBSD: pkg_create.1,v 1.27 2001/04/09 12:47:37 wiz Exp $
.\" $NetBSD: pkg_create.1,v 1.28 2001/05/18 13:21:38 agc Exp $
.\"
.\" FreeBSD install - a package for the installation and maintainance
.\" of non-core utilities.
@ -32,7 +32,7 @@
.Nd a utility for creating software package distributions
.Sh SYNOPSIS
.Nm
.Op Fl hlORVv
.Op Fl hlORUVv
.Bk -words
.Op Fl B Ar build-info-file
.Ek
@ -257,6 +257,8 @@ directory is limited. Be sure to leave some number of `X' characters
for
.Xr mktemp 3
to fill in with a unique ID.
.It Fl U
Do not update the package file database with any file information.
.It Fl V
Print version number and exit.
.It Fl v

View File

@ -1,11 +1,11 @@
/* $NetBSD: pl.c,v 1.19 2000/07/05 20:18:16 hubertf Exp $ */
/* $NetBSD: pl.c,v 1.20 2001/05/18 13:21:38 agc Exp $ */
#include <sys/cdefs.h>
#ifndef lint
#if 0
static const char *rcsid = "from FreeBSD Id: pl.c,v 1.11 1997/10/08 07:46:35 charnier Exp";
#else
__RCSID("$NetBSD: pl.c,v 1.19 2000/07/05 20:18:16 hubertf Exp $");
__RCSID("$NetBSD: pl.c,v 1.20 2001/05/18 13:21:38 agc Exp $");
#endif
#endif
@ -120,7 +120,7 @@ check_list(char *home, package_t *pkg, const char *PkgName)
int dirc;
/* Open Package Database for writing */
if (pkgdb_open(0) == -1) {
if (update_pkgdb && pkgdb_open(0) == -1) {
cleanup(0);
err(1, "can't open pkgdb");
}
@ -146,7 +146,7 @@ check_list(char *home, package_t *pkg, const char *PkgName)
* but as they are present before pkg_create
* starts, it's ok to do this somewhere here
*/
{
if (update_pkgdb) {
char *s, t[FILENAME_MAX];
(void) snprintf(t, sizeof(t), "%s/%s", cwd, p->name);
@ -206,7 +206,9 @@ check_list(char *home, package_t *pkg, const char *PkgName)
}
}
pkgdb_close();
if (update_pkgdb) {
pkgdb_close();
}
if (ReorderDirs && dirc > 0) {
reorder(pkg, dirc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: version.h,v 1.4 2001/03/07 10:04:33 wiz Exp $ */
/* $NetBSD: version.h,v 1.5 2001/05/18 13:21:39 agc 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 "20010307"
#define PKGTOOLS_VERSION "20010518"
#endif /* _INST_LIB_VERSION_H_ */