summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/add
diff options
context:
space:
mode:
authoreik <eik@FreeBSD.org>2004-06-29 18:59:19 +0000
committereik <eik@FreeBSD.org>2004-06-29 18:59:19 +0000
commit7a7a88ae41089ff6cb4d75e4c2271702d2fc40ba (patch)
treed736eb1b5c7ccb34088587a0c550492399691ef6 /usr.sbin/pkg_install/add
parentffbd0ede95b92fdb9e9a5457126a4eeca1726352 (diff)
downloadFreeBSD-src-7a7a88ae41089ff6cb4d75e4c2271702d2fc40ba.zip
FreeBSD-src-7a7a88ae41089ff6cb4d75e4c2271702d2fc40ba.tar.gz
- pkg_info: flag -r: (show packages this packages depends on (documentation change))
- pkg_info: new flag -j (show the requirements script) - pkg_info: fix verbose output when used on packages - better handling of corrupt entries in /var/db/pkg - differ between corrupt entires and packages not installed - various small fixes PR: 56989, 57016, 57029, 26468
Diffstat (limited to 'usr.sbin/pkg_install/add')
-rw-r--r--usr.sbin/pkg_install/add/extract.c2
-rw-r--r--usr.sbin/pkg_install/add/perform.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/pkg_install/add/extract.c b/usr.sbin/pkg_install/add/extract.c
index 337fe4d..4793dc2 100644
--- a/usr.sbin/pkg_install/add/extract.c
+++ b/usr.sbin/pkg_install/add/extract.c
@@ -85,7 +85,7 @@ rollback(const char *name, const char *home, PackingList start, PackingList stop
++(pos); \
} while (0)
-int
+static int
add_arg(char *buf, int len, const char *str)
{
int i = 0;
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c
index ab409c0..8af962c 100644
--- a/usr.sbin/pkg_install/add/perform.c
+++ b/usr.sbin/pkg_install/add/perform.c
@@ -71,7 +71,7 @@ pkg_do(char *pkg)
int code;
PackingList p;
struct stat sb;
- int inPlace, conflictsfound, i, errcode;
+ int inPlace, conflictsfound, errcode;
/* support for separate pre/post install scripts */
int new_m = 0;
char pre_script[FILENAME_MAX] = INSTALL_FNAME;
@@ -243,7 +243,7 @@ pkg_do(char *pkg)
* See if we're already registered either with the same name (the same
* version) or some other version with the same origin.
*/
- if ((isinstalledpkg(Plist.name) ||
+ if ((isinstalledpkg(Plist.name) > 0 ||
matchbyorigin(Plist.origin, NULL) != NULL) && !Force) {
warnx("package '%s' or its older version already installed",
Plist.name);
@@ -254,13 +254,14 @@ pkg_do(char *pkg)
/* Now check the packing list for conflicts */
for (p = Plist.head; p != NULL; p = p->next) {
if (p->type == PLIST_CONFLICTS) {
+ int i;
conflict[0] = strdup(p->name);
conflict[1] = NULL;
matched = matchinstalled(MATCH_GLOB, conflict, &errcode);
free(conflict[0]);
if (errcode == 0 && matched != NULL)
for (i = 0; matched[i] != NULL; i++)
- if (isinstalledpkg(matched[i])) {
+ if (isinstalledpkg(matched[i]) > 0) {
warnx("package '%s' conflicts with %s", Plist.name,
matched[i]);
conflictsfound = 1;
@@ -291,7 +292,7 @@ pkg_do(char *pkg)
printf(" with '%s' origin", deporigin);
printf(".\n");
}
- if (!isinstalledpkg(p->name) &&
+ if (isinstalledpkg(p->name) <= 0 &&
!(deporigin != NULL && matchbyorigin(deporigin, NULL) != NULL)) {
char path[FILENAME_MAX], *cp = NULL;
OpenPOWER on IntegriCloud