summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/add
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2008-05-03 22:56:50 +0000
committerpav <pav@FreeBSD.org>2008-05-03 22:56:50 +0000
commitf6342a8cc70520205466101de2fc3225e5c9ab2c (patch)
tree047e0d070e77398a2c7167602f4bfa0c7a91be2a /usr.sbin/pkg_install/add
parent0cabcd8279358de2fe1c18b8f6403831e37f9967 (diff)
downloadFreeBSD-src-f6342a8cc70520205466101de2fc3225e5c9ab2c.zip
FreeBSD-src-f6342a8cc70520205466101de2fc3225e5c9ab2c.tar.gz
- Restore functionality broken in previous commit; we need to be able to report
multiple installed packages with the same PKGORIGIN. Reported by: marcus MFC after: 1 month
Diffstat (limited to 'usr.sbin/pkg_install/add')
-rw-r--r--usr.sbin/pkg_install/add/perform.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c
index 3d86a9d..b8ba1a9 100644
--- a/usr.sbin/pkg_install/add/perform.c
+++ b/usr.sbin/pkg_install/add/perform.c
@@ -452,7 +452,7 @@ pkg_do(char *pkg)
/* Time to record the deed? */
if (!NoRecord && !Fake) {
char contents[FILENAME_MAX];
- char **depnames = NULL, **deporigins = NULL, **depmatches;
+ char **depnames = NULL, **deporigins = NULL, ***depmatches;
int i, dep_count = 0;
FILE *contfile;
@@ -540,20 +540,24 @@ pkg_do(char *pkg)
if (!IgnoreDeps && depmatches) {
for (i = 0; i < dep_count; i++) {
if (depmatches[i]) {
- /* Origin looked up */
- sprintf(contents, "%s/%s/%s", LOG_DIR, depmatches[i],
- REQUIRED_BY_FNAME);
- if (depnames[i] && strcmp(depnames[i], depmatches[i]) != 0)
- warnx("warning: package '%s' requires '%s', but '%s' "
- "is installed", Plist.name, depnames[i], depmatches[i]);
- contfile = fopen(contents, "a");
- if (!contfile) {
- warnx("can't open dependency file '%s'!\n"
- "dependency registration is incomplete", contents);
- } else {
- fprintf(contfile, "%s\n", Plist.name);
- if (fclose(contfile) == EOF)
- warnx("cannot properly close file %s", contents);
+ int j;
+ char **tmp = depmatches[i];
+ for (j = 0; tmp[j] != NULL; j++) {
+ /* Origin looked up */
+ sprintf(contents, "%s/%s/%s", LOG_DIR, tmp[j],
+ REQUIRED_BY_FNAME);
+ if (depnames[i] && strcmp(depnames[i], tmp[j]) != 0)
+ warnx("warning: package '%s' requires '%s', but '%s' "
+ "is installed", Plist.name, depnames[i], tmp[j]);
+ contfile = fopen(contents, "a");
+ if (!contfile) {
+ warnx("can't open dependency file '%s'!\n"
+ "dependency registration is incomplete", contents);
+ } else {
+ fprintf(contfile, "%s\n", Plist.name);
+ if (fclose(contfile) == EOF)
+ warnx("cannot properly close file %s", contents);
+ }
}
} else if (depnames[i]) {
/* No package present with this origin, try literal package name */
OpenPOWER on IntegriCloud