FreeBSD Bugzilla – Attachment 5848 Details for
Bug 13649
Enhancement to PKG_INSTALL tools (4.0-CURRENT)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
pkg_install.patch
pkg_install.patch (text/plain), 9.65 KB, created by
Sergey Matveychuk
on 2002-12-05 02:00:42 UTC
(
hide
)
Description:
pkg_install.patch
Filename:
MIME Type:
Creator:
Sergey Matveychuk
Created:
2002-12-05 02:00:42 UTC
Size:
9.65 KB
patch
obsolete
>diff -ruN /tmp/current/src/usr.sbin/pkg_install/add/perform.c pkg_install/add/perform.c >--- /tmp/current/src/usr.sbin/pkg_install/add/perform.c Tue Sep 3 10:59:33 2002 >+++ pkg_install/add/perform.c Sun Dec 1 21:29:21 2002 >@@ -77,6 +77,7 @@ > char pre_script[FILENAME_MAX] = INSTALL_FNAME; > char post_script[FILENAME_MAX]; > char pre_arg[FILENAME_MAX], post_arg[FILENAME_MAX]; >+ int conflictsfound=0; > > code = 0; > zapLogDir = 0; >@@ -246,6 +247,36 @@ > Plist.name); > code = 1; > goto success; /* close enough for government work */ >+ } >+ >+ /* Now check the packing list for conflicts */ >+ for (p = Plist.head; p ; p = p->next) { >+ if (p->type == PLIST_PKGCFL) { >+ char *conflict[2]; >+ char **matched; >+ int i,errcode; >+ >+ conflict[0]=strdup(p->name); >+ conflict[1]=NULL; >+ matched = matchinstalled(MATCH_GLOB,conflict,&errcode); >+ if(errcode == 0 && matched != NULL) >+ for(i=0; matched[i] != NULL; i++) >+ if(isinstalledpkg(matched[i])) { >+ warnx("Package '%s' conflicts with %s", Plist.name, >+ matched[i]); >+ conflictsfound=1; >+ } >+ >+ continue; >+ } >+ } >+ if(conflictsfound) { >+ if(!Force) { >+ warnx("please use pkg_delete first to remove it (them)"); >+ code = 1; >+ goto bomb; >+ } else >+ warnx("proceeding anyway"); > } > > /* Now check the packing list for dependencies */ >diff -ruN /tmp/current/src/usr.sbin/pkg_install/add/pkg_add.1 pkg_install/add/pkg_add.1 >--- /tmp/current/src/usr.sbin/pkg_install/add/pkg_add.1 Tue Sep 10 06:42:59 2002 >+++ pkg_install/add/pkg_add.1 Sun Dec 1 22:08:59 2002 >@@ -208,20 +208,29 @@ > .Sh TECHNICAL DETAILS > The > .Nm >-utility is fairly simple. It extracts each package's "packing list" >-into a special staging directory, parses it, >-and then runs through the following sequence to fully extract the contents: >+utility extracts each package's "packing list" into a special staging >+directory in /tmp (or $PKG_TMPDIR if set), parses it, and then runs >+through the following sequence to fully extract the contents of the package: > .Bl -enum > .It >-Check if the package is already recorded as installed. If so, >-terminate installation. >+A check is made to determine if the package is already recorded as installed. >+If it is, installation is terminated. >+.It >+A check is made to determine if the package conflicts (from >+.Cm @pkgcfl >+directives, see >+.Xr pkg_create 1 ) >+with an already recorded as installed package. If it is, >+installation is terminated. > .It > Scan all the package dependencies (from > .Cm @pkgdep > directives, see > .Xr pkg_create 1 ) >-and make sure each one is met. If not, try and find the missing >-dependencies' packages and auto-install them; if they can't be found >+are read from the packing list. >+If any of these required packages is not currently installed, >+an attempt is made to find and install it; >+if the missing package cannot be found or installed, > the installation is terminated. > .It > Search for any >@@ -384,11 +393,14 @@ > consists of a directory name. > The current directory may be indicated > implicitly by an empty directory name, or explicitly by a single >-period. >+period. It is usually set to >+.Pa /usr/ports/packages/All . > .Pp > The environment variable > .Ev PKG_DBDIR >-specifies an alternative location for the installed package database. >+specifies an alternative location for the installed package database, >+default location is >+.Pa /var/db/pkg . > .Pp > The environment variables > .Ev PKG_TMPDIR >diff -ruN /tmp/current/src/usr.sbin/pkg_install/create/create.h pkg_install/create/create.h >--- /tmp/current/src/usr.sbin/pkg_install/create/create.h Sun Apr 21 01:20:58 2002 >+++ pkg_install/create/create.h Sat Nov 30 16:00:28 2002 >@@ -37,6 +37,7 @@ > extern char *ExcludeFrom; > extern char *Mtree; > extern char *Pkgdeps; >+extern char *Pkgcfl; > extern char *Origin; > extern char *InstalledPkg; > extern char PlayPen[]; >diff -ruN /tmp/current/src/usr.sbin/pkg_install/create/main.c pkg_install/create/main.c >--- /tmp/current/src/usr.sbin/pkg_install/create/main.c Sun Apr 21 01:20:58 2002 >+++ pkg_install/create/main.c Sat Nov 30 15:59:59 2002 >@@ -16,7 +16,7 @@ > #include "lib.h" > #include "create.h" > >-static char Options[] = "YNOhjvyzf:p:P:c:d:i:I:k:K:r:t:X:D:m:s:o:b:"; >+static char Options[] = "YNOhjvyzf:p:P:C:c:d:i:I:k:K:r:t:X:D:m:s:o:b:"; > > char *Prefix = NULL; > char *Comment = NULL; >@@ -32,6 +32,7 @@ > char *ExcludeFrom = NULL; > char *Mtree = NULL; > char *Pkgdeps = NULL; >+char *Pkgcfl = NULL; > char *Origin = NULL; > char *InstalledPkg = NULL; > char PlayPen[FILENAME_MAX]; >@@ -78,6 +79,10 @@ > Contents = optarg; > break; > >+ case 'C': >+ Pkgcfl = optarg; >+ break; >+ > case 'c': > Comment = optarg; > break; >@@ -195,11 +200,11 @@ > usage() > { > fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n", >-"usage: pkg_create [-YNOhvy] [-P pkgs] [-p prefix] [-f contents] [-i iscript]", >-" [-I piscript] [-k dscript] [-K pdscript] [-r rscript] ", >-" [-t template] [-X excludefile] [-D displayfile] ", >-" [-m mtreefile] [-o origin] -c comment -d description ", >-" -f packlist pkg-filename", >+"usage: pkg_create [-YNOhvy] [-P pkgs] [-C cpkgs] [-p prefix] [-f contents] ", >+" [-i iscript] [-I piscript] [-k dscript] [-K pdscript] ", >+" [-r rscript] [-t template] [-X excludefile] ", >+" [-D displayfile] [-m mtreefile] [-o origin] ", >+" -c comment -d description -f packlist pkg-filename", > " pkg_create [-YNhvy] -b pkg-name [pkg-filename]"); > exit(1); > } >diff -ruN /tmp/current/src/usr.sbin/pkg_install/create/perform.c pkg_install/create/perform.c >--- /tmp/current/src/usr.sbin/pkg_install/create/perform.c Sun Aug 25 05:01:08 2002 >+++ pkg_install/create/perform.c Sat Nov 30 16:06:00 2002 >@@ -145,6 +145,22 @@ > printf(".\n"); > } > >+ /* Put the conflicts directly after the dependencies, if any */ >+ if (Pkgcfl) { >+ if (Verbose && !PlistOnly) >+ printf("Registering conflicts:"); >+ while (Pkgcfl) { >+ cp = strsep(&Pkgcfl, " \t\n"); >+ if (*cp) { >+ add_plist(&plist, PLIST_PKGCFL, cp); >+ if (Verbose && !PlistOnly) >+ printf(" %s", cp); >+ } >+ } >+ if (Verbose && !PlistOnly) >+ printf(".\n"); >+ } >+ > /* If a SrcDir override is set, add it now */ > if (SrcDir) { > if (Verbose && !PlistOnly) >diff -ruN /tmp/current/src/usr.sbin/pkg_install/create/pkg_create.1 pkg_install/create/pkg_create.1 >--- /tmp/current/src/usr.sbin/pkg_install/create/pkg_create.1 Mon Aug 5 01:20:09 2002 >+++ pkg_install/create/pkg_create.1 Sun Dec 1 21:46:53 2002 >@@ -32,6 +32,7 @@ > .Sh SYNOPSIS > .Nm > .Op Fl YNOhjvyz >+.Op Fl C Ar cpkgs > .Op Fl P Ar pkgs > .Op Fl p Ar prefix > .Op Fl f Ar contents >@@ -142,6 +143,13 @@ > when the package is later installed. > It will be passed the package's name as > the first argument. >+.It Fl C Ar cpkgs >+Set the initial package conflict list to >+.Ar cpkgs . >+This is assumed to be a whitespace separated list of package names >+and is meant as a convenient shorthand for specifying multiple >+.Cm @pkgcfl >+directives in the packing list (see PACKING LIST DETAILS section below). > .It Fl P Ar pkgs > Set the initial package dependency list to > .Ar pkgs . >@@ -482,6 +490,11 @@ > package is deinstalled. Multiple > .Cm @pkgdep > directives may be used if the package depends on multiple other packages. >+.It Cm @pkgcfl Ar pkgcflname >+Declare a conflict with the >+.Ar pkgcflname >+package, as the two packages contain references to the same files, >+and so cannot co-exist on the same system. > .El > .Sh ENVIRONMENT > The environment variable >diff -ruN /tmp/current/src/usr.sbin/pkg_install/info/show.c pkg_install/info/show.c >--- /tmp/current/src/usr.sbin/pkg_install/info/show.c Thu Oct 24 21:27:32 2002 >+++ pkg_install/info/show.c Sat Nov 30 18:17:53 2002 >@@ -158,6 +158,10 @@ > "\tdependency origin: %s\n", p->name); > break; > >+ case PLIST_PKGCFL: >+ printf(Quiet ? "@pkgcfl %s\n" : "Conflicts: %s\n", p->name); >+ break; >+ > case PLIST_MTREE: > printf(Quiet ? "@mtree %s\n" : "\tPackage mtree file: %s\n", p->name); > break; >diff -ruN /tmp/current/src/usr.sbin/pkg_install/lib/lib.h pkg_install/lib/lib.h >--- /tmp/current/src/usr.sbin/pkg_install/lib/lib.h Mon Sep 9 23:43:30 2002 >+++ pkg_install/lib/lib.h Sun Dec 1 01:12:22 2002 >@@ -86,7 +86,7 @@ > * Version of the package tools - increase only when some > * functionality used by bsd.port.mk is changed, added or removed > */ >-#define PKG_INSTALL_VERSION 20020908 >+#define PKG_INSTALL_VERSION 20021201 > > #define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf" > #define main(argc, argv) real_main(argc, argv) >@@ -99,8 +99,8 @@ > PLIST_FILE, PLIST_CWD, PLIST_CMD, PLIST_CHMOD, > PLIST_CHOWN, PLIST_CHGRP, PLIST_COMMENT, PLIST_IGNORE, > PLIST_NAME, PLIST_UNEXEC, PLIST_SRC, PLIST_DISPLAY, >- PLIST_PKGDEP, PLIST_MTREE, PLIST_DIR_RM, PLIST_IGNORE_INST, >- PLIST_OPTION, PLIST_ORIGIN, PLIST_DEPORIGIN >+ PLIST_PKGDEP, PLIST_PKGCFL, PLIST_MTREE, PLIST_DIR_RM, >+ PLIST_IGNORE_INST, PLIST_OPTION, PLIST_ORIGIN, PLIST_DEPORIGIN > }; > typedef enum _plist_t plist_t; > >diff -ruN /tmp/current/src/usr.sbin/pkg_install/lib/plist.c pkg_install/lib/plist.c >--- /tmp/current/src/usr.sbin/pkg_install/lib/plist.c Sun Sep 1 00:21:47 2002 >+++ pkg_install/lib/plist.c Sat Nov 30 18:14:57 2002 >@@ -241,6 +241,8 @@ > return PLIST_DISPLAY; > else if (!strcmp(cmd, "pkgdep")) > return PLIST_PKGDEP; >+ else if (!strcmp(cmd, "pkgcfl")) >+ return PLIST_PKGCFL; > else if (!strcmp(cmd, "mtree")) > return PLIST_MTREE; > else if (!strcmp(cmd, "dirrm")) >@@ -362,6 +364,10 @@ > > case PLIST_PKGDEP: > fprintf(fp, "%cpkgdep %s\n", CMD_CHAR, plist->name); >+ break; >+ >+ case PLIST_PKGCFL: >+ fprintf(fp, "%cpkgcfl %s\n", CMD_CHAR, plist->name); > break; > > case PLIST_MTREE:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 13649
:
5846
|
5847
| 5848