4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
38 #include <sys/types.h>
40 #include "pkglocale.h"
42 #define MSG_INVALID "invalid entry"
45 tputcfent(struct cfent
*ept
, FILE *fp
)
53 if (ept
->path
== NULL
)
56 (void) fprintf(fp
, pkg_gt("Pathname: %s\n"), ept
->path
);
57 (void) fprintf(fp
, pkg_gt("Type: "));
61 (void) fputs(pkg_gt("regular file\n"), fp
);
65 (void) fputs(pkg_gt("directory\n"), fp
);
69 (void) fputs(pkg_gt("exclusive directory\n"), fp
);
73 (void) fputs(pkg_gt("volatile file\n"), fp
);
77 (void) fputs(pkg_gt("editted file\n"), fp
);
81 (void) fputs(pkg_gt("named pipe\n"), fp
);
85 (void) fputs(pkg_gt("installation file\n"), fp
);
90 (void) fprintf(fp
, pkg_gt("%s special device\n"),
91 (ept
->ftype
== 'b') ? pkg_gt("block") :
94 if (ept
->ainfo
.major
== BADMAJOR
)
95 (void) fprintf(fp
, pkg_gt("Major device number: %s\n"),
98 (void) fprintf(fp
, pkg_gt("Major device number: %ld\n"),
101 if (ept
->ainfo
.minor
== BADMINOR
)
102 (void) fprintf(fp
, pkg_gt("Minor device number: %s\n"),
105 (void) fprintf(fp
, pkg_gt("Minor device number: %ld\n"),
111 (void) fputs(pkg_gt("linked file\n"), fp
);
112 pt
= (ept
->ainfo
.local
? ept
->ainfo
.local
:
113 (char *)pkg_gt("(unknown)"));
114 (void) fprintf(fp
, pkg_gt("Source of link: %s\n"), pt
);
118 (void) fputs(pkg_gt("symbolic link\n"), fp
);
119 pt
= (ept
->ainfo
.local
? ept
->ainfo
.local
:
120 (char *)pkg_gt("(unknown)"));
121 (void) fprintf(fp
, pkg_gt("Source of link: %s\n"), pt
);
125 (void) fputs(pkg_gt("unknown\n"), fp
);
129 if (!strchr("lsin", ept
->ftype
)) {
130 if (ept
->ainfo
.mode
== BADMODE
)
131 (void) fprintf(fp
, pkg_gt("Expected mode: %s\n"),
134 (void) fprintf(fp
, pkg_gt("Expected mode: %04lo\n"),
137 (void) fprintf(fp
, pkg_gt("Expected owner: %s\n"),
139 (void) fprintf(fp
, pkg_gt("Expected group: %s\n"),
142 if (strchr("?infv", ept
->ftype
)) {
144 pkg_gt("Expected file size (bytes): %llu\n"),
147 pkg_gt("Expected sum(1) of contents: %ld\n"),
149 if (ept
->cinfo
.modtime
> 0) {
150 timep
= localtime(&(ept
->cinfo
.modtime
));
151 (void) strftime(timeb
, sizeof (timeb
),
152 pkg_gt("Expected last modification: %b %d %X %Y\n"),
154 (void) fputs(timeb
, fp
);
157 pkg_gt("Expected last modification: ?\n"));
159 if (ept
->ftype
== 'i') {
160 (void) fputc('\n', fp
);
165 if ((pinfo
= ept
->pinfo
) != NULL
) {
167 pkg_gt("Referenced by the following packages:\n\t"));
170 * Check for partially installed object. Need
171 * to explicitly check for '!', because objects
172 * that are provided by a server will have a
173 * different status character.
175 if (pinfo
->status
== '!')
177 (void) fprintf(fp
, "%-15s", pinfo
->pkg
);
178 if ((++count
% 5) == 0) {
179 (void) fputc('\n', fp
);
180 (void) fputc('\t', fp
);
185 (void) fputc('\n', fp
);
187 (void) fprintf(fp
, pkg_gt("Current status: %s\n"),
188 status
? pkg_gt("partially installed") :
189 pkg_gt("installed"));
190 (void) fputc('\n', fp
);