Add a new option to pkg_create to allow easy registration of all

dependencies. Just like -P is used for the full dependencies to create
@blddep entries in the PLIST, -T does that as well. To reduce the chance
of confusing older tools, they are sorted after the full dependencies.
Bump pkg_install version to 20070308.
This commit is contained in:
joerg 2007-03-08 18:20:20 +00:00
parent 3aeb570fd3
commit 2fcc3fcbe6
5 changed files with 50 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: create.h,v 1.21 2007/03/08 15:36:57 joerg Exp $ */
/* $NetBSD: create.h,v 1.22 2007/03/08 18:20:20 joerg Exp $ */
/* from FreeBSD Id: create.h,v 1.13 1997/10/08 07:46:19 charnier Exp */
@ -34,6 +34,7 @@ extern char *DeInstall;
extern char *Contents;
extern char *Mtree;
extern char *Pkgdeps;
extern char *BuildPkgdeps;
extern char *Pkgcfl;
extern char *BuildVersion;
extern char *BuildInfo;

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.32 2007/03/08 15:36:57 joerg Exp $ */
/* $NetBSD: main.c,v 1.33 2007/03/08 18:20:20 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@ -11,7 +11,7 @@
#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.32 2007/03/08 15:36:57 joerg Exp $");
__RCSID("$NetBSD: main.c,v 1.33 2007/03/08 18:20:20 joerg Exp $");
#endif
#endif
@ -32,7 +32,7 @@ __RCSID("$NetBSD: main.c,v 1.32 2007/03/08 15:36:57 joerg Exp $");
#include "lib.h"
#include "create.h"
static const char Options[] = "B:C:D:EFI:K:L:OP:RS:UVb:c:d:f:i:k:lm:n:p:r:s:t:v";
static const char Options[] = "B:C:D:EFI:K:L:OP:RS:T:UVb:c:d:f:i:k:lm:n:p:r:s:t:v";
char *Prefix = NULL;
char *Comment = NULL;
@ -43,6 +43,7 @@ char *DeInstall = NULL;
char *Contents = NULL;
char *Mtree = NULL;
char *Pkgdeps = NULL;
char *BuildPkgdeps = NULL;
char *Pkgcfl = NULL;
char *BuildVersion = NULL;
char *BuildInfo = NULL;
@ -69,7 +70,7 @@ usage(void)
" [-K pkg_dbdir] [-k dscript] [-L SrcDir] [-m mtreefile]\n"
" [-n preserve-file] [-P dpkgs] [-p prefix] [-r rscript]\n"
" [-S size-all-file] [-s size-pkg-file] [-t template]\n"
" -c comment -d description -f packlist\n"
" [-T buildpkgs] -c comment -d description -f packlist\n"
" pkg-name\n");
exit(1);
}
@ -172,6 +173,10 @@ main(int argc, char **argv)
Pkgdeps = optarg;
break;
case 'T':
BuildPkgdeps = optarg;
break;
case 'C':
Pkgcfl = optarg;
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: perform.c,v 1.47 2007/03/08 15:36:57 joerg Exp $ */
/* $NetBSD: perform.c,v 1.48 2007/03/08 18:20:20 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@ -11,7 +11,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: perform.c,v 1.38 1997/10/13 15:03:51 jkh Exp";
#else
__RCSID("$NetBSD: perform.c,v 1.47 2007/03/08 15:36:57 joerg Exp $");
__RCSID("$NetBSD: perform.c,v 1.48 2007/03/08 18:20:20 joerg Exp $");
#endif
#endif
@ -264,6 +264,27 @@ pkg_perform(lpkg_head_t *pkgs)
printf(".\n");
}
/*
* Put the build dependencies after the dependencies.
* This works due to the evaluation order in pkg_add.
*/
if (BuildPkgdeps) {
if (Verbose && !PlistOnly)
printf("Registering build depends:");
while (BuildPkgdeps) {
cp = strsep(&BuildPkgdeps, " \t\n");
if (*cp) {
if (findmatchingname(_pkgdb_getPKGDB_DIR(), cp, note_whats_installed, installed) > 0) {
add_plist(&plist, PLIST_BLDDEP, installed);
if (Verbose && !PlistOnly)
printf(" %s", cp);
}
}
}
if (Verbose && !PlistOnly)
printf(".\n");
}
/* Put the conflicts directly after the dependencies, if any */
if (Pkgcfl) {
if (Verbose && !PlistOnly)

View File

@ -1,4 +1,4 @@
.\" $NetBSD: pkg_create.1,v 1.44 2007/03/08 15:36:57 joerg Exp $
.\" $NetBSD: pkg_create.1,v 1.45 2007/03/08 18:20:20 joerg Exp $
.\"
.\" FreeBSD install - a package for the installation and maintenance
.\" of non-core utilities.
@ -70,6 +70,9 @@
.Op Fl P Ar dpkgs
.Ek
.Bk -words
.Op Fl T Ar buildpkgs
.Ek
.Bk -words
.Op Fl p Ar prefix
.Ek
.Bk -words
@ -246,6 +249,16 @@ In addition, the exact versions of the packages referred to in the
list will be added to the packing list in the form of
.Cm @blddep
directives.
.It Fl T Ar buildpkgs
This is assumed to be a whitespace separated list of package names.
The exact versions of the packages referred to in the
.Ar buildpkgs
list will be added to the packing list in the form of
.Cm @blddep
directives.
This directives are stored after those created by the
.Fl P
option.
.It Fl p Ar prefix
Set
.Ar prefix

View File

@ -1,4 +1,4 @@
/* $NetBSD: version.h,v 1.82 2006/11/03 09:20:45 joerg Exp $ */
/* $NetBSD: version.h,v 1.83 2007/03/08 18:20:20 joerg 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 "20061103"
#define PKGTOOLS_VERSION "20070308"
#endif /* _INST_LIB_VERSION_H_ */