xref: /illumos-gate/usr/src/cmd/svr4pkg/pkgadm/pkgadm_msgs.h (revision d8109ce4330e1b8ad6c29f9fccacec969066bb9d)
1 /*
2  * CDDL HEADER START
3  *
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.
7  *
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.
12  *
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]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright (c) 2017 Peter Tribble.
24  */
25 
26 /*
27  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
28  * Use is subject to license terms.
29  */
30 
31 #ifndef	_PKGADM_MSGS_H
32 #define	_PKGADM_MSGS_H
33 
34 
35 #include <libintl.h>
36 
37 #ifdef	__cplusplus
38 extern "C" {
39 #endif
40 
41 #ifdef	lint
42 #define	gettext(x)	x
43 #endif
44 
45 /* generic messages */
46 #define	MSG_BAD_SUB		gettext(\
47 	"\"%s\" is not a valid subcommand")
48 
49 #define	MSG_MISSING_OPERAND	gettext(\
50 	"-%c requires an operand")
51 
52 #define	MSG_USAGE		gettext(\
53 "usage:\n" \
54 "\n" \
55 "pkgadm dbstatus [-R rootpath]\n" \
56 "\n" \
57 "\t- Returns 'text' - the text install database in use since Solaris 2.0\n" \
58 "\t  is the current install database in use.\n" \
59 "\n" \
60 "pkgadm sync [-R rootpath] [-q]\n" \
61 "\n" \
62 "\t- Writes the contents file and rolls the contents log file.\n" \
63 "\t- Optionally forces the contents file server to quit [-q].\n" \
64 "\n" \
65 "pkgadm -V\n" \
66 "\t- Displays packaging tools version\n" \
67 "\n" \
68 "pkgadm -?\n" \
69 "\t- Shows this help message\n")
70 
71 #define	MSG_WARNING		gettext(\
72 	"WARNING")
73 
74 #define	MSG_ERROR		gettext(\
75 	"ERROR")
76 
77 #define	MSG_T_OPTION_ARGS	gettext(\
78 	"-t option takes 2 or 3 arguments, not %d!\n")
79 
80 #define	MSG_T_RESULT_TWO	gettext(\
81 	"result <%d>: <%s> ~= <%s>\n")
82 
83 #define	MSG_T_RESULT_THREE	gettext(\
84 	"required <%d> actual <%d> <%30s> ~- <%30s>\n")
85 
86 #define	MSG_ERROR		gettext(\
87 	"ERROR")
88 
89 /* warnings */
90 
91 #define	CREATE_PKGDIR_WARN	gettext(\
92 	"Creating directory <%s>\n")
93 
94 #define	MSG_VALID_STALE		gettext(\
95 	"Removing stale lock on <%s> pid <%ld> zid <%ld>")
96 
97 /* errors */
98 
99 #define	MSG_INTERNAL			gettext(\
100 	"Intenal Error <%s>")
101 
102 #define	MSG_OPEN			gettext(\
103 	"Cannot open <%s> for reading")
104 
105 #define	MSG_OPEN_WRITE			gettext(\
106 	"Cannot open <%s> for writing")
107 
108 #define	ERR_LOG_FAIL			gettext(\
109 	"Failed to log message using format <%s>")
110 
111 #define	MSG_ZONES_MISSING_REQUEST	gettext(\
112 	"Must specify operation to perform\n")
113 
114 #define	MSG_LOCK_ALTROOT_CANTCREATE	gettext(\
115 	"lock: cannot create alternative root directory <%s>: %s\n")
116 
117 #define	MSG_LOCK_ALTROOT_NONEXIST	gettext(\
118 	"lock: argument to -R <%s> is not a directory: %s\n")
119 
120 #define	MSG_LOCK_ROOTDIR_INVALID	gettext(\
121 	"lock: lock file base directory <%s> not valid: %s\n")
122 
123 #define	MSG_LOCK_WFLAG_BADINT	gettext(\
124 	"The integer value <%s> given to the -W option includes an " \
125 	"invalid character: \"%c\"\n")
126 
127 #define	MSG_LOCK_pFLAG_BADINT	gettext(\
128 	"The integer value <%s> given to the -p option includes an " \
129 	"invalid character: \"%c\"\n")
130 
131 #define	MSG_LOCK_zFLAG_BADINT	gettext(\
132 	"The integer value <%s> given to the -z option includes an " \
133 	"invalid character: \"%c\"\n")
134 
135 #define	MSG_LOCK_nFLAG_BADINT	gettext(\
136 	"The integer value <%s> given to the -n option includes an " \
137 	"invalid character: \"%c\"\n")
138 
139 #define	MSG_LOCK_ar_TOGETHER	gettext(\
140 	"lock: The -a and -r options cannot be used together: "\
141 	"specify only one.\n")
142 
143 #define	MSG_LOCK_kARG_TOOLONG	gettext(\
144 	"Argument to -k is <%d> characters: may not exceed <%d> characters\n")
145 
146 #define	MSG_LOCK_oARG_TOOLONG	gettext(\
147 	"Argument to -o is <%d> characters: may not exceed <%d> characters\n")
148 
149 #define	MSG_LOCK_RARG_NOT_ABSOLUTE	gettext(\
150 	"Argument to -R must be absolute path: %s")
151 
152 #define	MSG_LOCK_WFLAG_ERROR	gettext(\
153 	"Argument to -W has problem with wait interval <%s>: %s")
154 
155 #define	MSG_LOCK_pFLAG_ERROR	gettext(\
156 	"Argument to -p has problem with process i.d. value <%s>: %s")
157 
158 #define	MSG_LOCK_zFLAG_ERROR	gettext(\
159 	"Argument to -p has problem with zone i.d. value <%s>: %s")
160 
161 #define	MSG_LOCK_nFLAG_ERROR	gettext(\
162 	"Argument to -n has problem with maximum number of retries " \
163 	"value <%s>: %s")
164 
165 #define	MSG_LOCK_es_TOGETHER	gettext(\
166 	"lock: The -e and -s options cannot be used together: "\
167 	"specify only one.\n")
168 
169 #define	MSG_LOCK_ak_TOGETHER	gettext(\
170 	"lock: The -k option cannot be used with the -a option.\n")
171 
172 #define	MSG_LOCK_e_without_a	gettext(\
173 	"lock: The -e option can only be used with the -a option.\n")
174 
175 #define	MSG_LOCK_s_without_a	gettext(\
176 	"lock: The -s option can only be used with the -a option.\n")
177 
178 #define	MSG_LOCK_ACQUIRE_KEYMISMATCH	gettext(\
179 	"cannot acquire %s lock on <%s>: object locked and specified key " \
180 	"does not match")
181 
182 #define	MSG_LOCK_ACQUIRE_ERROR	gettext(\
183 	"cannot determine if object <%s> key <%s> is locked: %s")
184 
185 #define	MSG_LOCK_ACQUIRE_TIMEDOUT	gettext(\
186 	"cannot acquire %s lock on <%s> key <%s>: object locked, no key " \
187 	"was specified, and the wait timed out")
188 
189 #define	MSG_LOCK_ACQUIRE_WAITING	gettext(\
190 	"object <%s> is locked: waiting for object to become available")
191 
192 #define	MSG_LOCK_ACQUIRE_REOPEN_FAILED	gettext(\
193 	"cannot reopen lock file after waiting for lock on object " \
194 	"<%s> to be released")
195 
196 #define	MSG_LOCK_RELEASE_NOTLOCKED	gettext(\
197 	"cannot release lock on <%s> key <%s>: object not locked and " \
198 	"a key was specified")
199 
200 #define	MSG_LOCK_RELEASE_LOCKED		gettext(\
201 	"cannot release lock on <%s> key <%s>: object locked but no " \
202 	"key was specified")
203 
204 #define	MSG_LOCK_RELEASE_NOTFOUND	gettext(\
205 	"cannot release lock on <%s> key <%s>: object is not locked")
206 
207 #define	MSG_LOCK_RELEASE_KEYMISMATCH	gettext(\
208 	"cannot release lock on <%s>: object locked and specified key " \
209 	"does not match")
210 
211 #define	MSG_LOCK_RELEASE_ERROR		gettext(\
212 	"cannot determine if object <%s> key <%s> is locked")
213 
214 #define	MSG_LOCK_EXEC_ACCESS	gettext(\
215 	"cannot execute command <%s>: %s")
216 
217 #define	MSG_LOCK_EXEC_NOINPUT	gettext(\
218 	"cannot open input file <%s>: %s")
219 
220 #define	MSG_LOCK_EXEC_NOPIPE	gettext(\
221 	"cannot create pipe: %s")
222 
223 #define	MSG_LOCK_FINDLOCK_LSEEK_FAILURE	gettext(\
224 	"cannot find lock <%s> key <%s>: lseek failure: %s")
225 
226 #define	MSG_LOCK_ADDLOCK_PWRITE_FAILURE	gettext(\
227 	"cannot create %s lock for object <%s>: pwrite failure: %s")
228 
229 #define	MSG_LOCK_ADDLOCK_LSEEK_FAILURE	gettext(\
230 	"cannot create %s lock for object <%s>: lseek failure: %s")
231 
232 #define	MSG_LOCK_INCLOCK_PWRITE_FAILURE	gettext(\
233 	"cannot increment %s lock for object <%s>: pwrite failure: %s")
234 
235 #define	MSG_LOCK_DECLOCK_PWRITE_FAILURE	gettext(\
236 	"cannot decrement %s lock for object <%s>: pwrite failure: %s")
237 
238 #define	MSG_LOCK_DECLOCK_PREAD_FAILURE	gettext(\
239 	"cannot decrement %s lock for object <%s>: pread failure: %s")
240 
241 #define	MSG_LOCK_DECLOCK_LSEEK_FAILURE	gettext(\
242 	"cannot decrement %s lock for object <%s>: lseek failure: %s")
243 
244 #define	MSG_LOCK_DECLOCK_FTRUNCATE_FAILURE	gettext(\
245 	"cannot decrement %s lock for object <%s>: ftruncate failure: %s")
246 
247 /*
248  * i18n:
249  * next two messages grouped together
250  */
251 
252 #define	MSG_LOCK_ACQUIRE_BUSY_QUASI	gettext(\
253 	"cannot acquire %s lock on <%s> key <%s>: object matches wildcard " \
254 	"<%s> lock%s")
255 #define	MSG_LOCK_ACQUIRE_BUSY_FIRST	gettext(\
256 	"cannot acquire %s lock on <%s> key <%s>: object <%s> is locked <%s>%s")
257 
258 /*
259  * i18n: note this message may be appended to the previous message
260  * by supplying it to the final "%s" at the end of the line above;
261  * that is either:
262  *  cannot acquire %s lock on <%s> key <%s>: object is locked <%s>
263  * or:
264  *  cannot acquire %s lock on <%s> [...] is locked <%s> and no key specified
265  */
266 
267 #define	MSG_LOCK_ACQUIRE_BUSY_ADDITIONAL	gettext(\
268 	" and no key specified")
269 
270 /*
271  * i18n: note these two "messages" are inserted into other
272  * messages, such as:
273  * 	cannot acquire %s lock on <%s>
274  * will be either:
275  *	cannot acquire shared lock on <%s>
276  * or
277  *	cannot acquire exclusive lock on <%s>
278  */
279 
280 #define	MSG_LOCK_EXC	gettext(\
281 	"exclusive")
282 
283 #define	MSG_LOCK_SHR		gettext(\
284 	"shared")
285 
286 /*
287  * i18n: note these messages are "debugging" messages and will normally
288  * not be seen unless debugging has been enabled for problem root causing
289  * so they are not meant to be perfectly "human readable"
290  */
291 
292 #define	MSG_VALID_NOPID		gettext(\
293 	"validate lock <%s>: VALID (no pid)")
294 
295 #define	MSG_VALID_BADZID	gettext(\
296 	"validate lock <%s>: VALID (lock zid <%ld> this zid <%ld>)")
297 
298 #define	MSG_VALID_ZIDOK	gettext(\
299 	"validate lock <%s>: zone i.d.s match (lock zid <%ld> this zid <%ld>)")
300 
301 #define	MSG_VALID_OK		gettext(\
302 	"validate lock <%s> pid <%ld> path <%s>: VALID")
303 
304 #define	MSG_VALID_NOTOK		gettext(\
305 	"validate lock <%s> pid <%ld> path <%s>: NOT VALID")
306 
307 #define	MSG_LCKMCH_ENTRY	gettext(\
308 	"lockMatch: *** BEGIN *** compare objects <%s> <%s>")
309 
310 #define	MSG_LCKMCH_FSTNODE	gettext(\
311 	"lockMatch: first lock node (%d) <%s>")
312 
313 #define	MSG_LCKMCH_SCNDNODE	gettext(\
314 	"lockMatch: second lock node (%d) <%s>")
315 
316 #define	MSG_LCKMCH_NODES	gettext(\
317 	"lockMatch: first lock node <%s> prefix <%s> (%d) second lock " \
318 	" node <%s> prefix <%s> (%d)")
319 
320 #define	MSG_LCKMCH_DIRMCH	gettext(\
321 	"lockMatch: no prefix direct comparison: match: <%s> <%s>")
322 
323 #define	MSG_LCKMCH_DIRNOMCH	gettext(\
324 	"lockMatch: no prefix direct comparison: NO MATCH: <%s> <%s>")
325 
326 #define	MSG_LCKMCH_PFXMCH	gettext(\
327 	"lockMatch: prefix comparison: match: <%s> <%s>")
328 
329 #define	MSG_LCKMCH_PFXNOMCH	gettext(\
330 	"lockMatch: prefix comparison: NO MATCH: <%s> <%s>")
331 
332 #define	MSG_LCKMCH_FSTLCK	gettext(\
333 	"lockMatch: first lock index (%d) last scanned node <%s> prefix " \
334 	"<%s> (%d)")
335 
336 #define	MSG_LCKMCH_SCNDLCK	gettext(\
337 	"lockMatch: second lock index (%d) last scanned node <%s> prefix " \
338 	"<%s> (%d)")
339 
340 #define	MSG_LCKMCH_ABSNOMCH	gettext(\
341 	"lockMatch: absolute locks: NO MATCH: <%s> <%s>")
342 
343 #define	MSG_LCKMCH_OBJMCH	gettext(\
344 	"lockMatch: object locks: match: <%s> <%s>")
345 
346 #define	MSG_LCKMCH_OVLPNOMCH	gettext(\
347 	"lockMatch: nonmatching overlapping objects: <%s> <%s> before " \
348 	"(%d) <%s>")
349 
350 #define	MSG_LCKMCH_SAME	gettext(\
351 	"lockMatch: locks begin with same node - compare: <%s> <%s> at <%s>")
352 
353 #define	MSG_LCKMCH_SCNDSUB	gettext(\
354 	"lockMatch: second lock <%s> subset of <%s> at (%d) <%s>")
355 
356 #define	MSG_LCKMCH_FRSTSUB	gettext(\
357 	"lockMatch: first lock <%s> subset of <%s> at (%d) <%s>")
358 
359 #define	MSG_LCKMCH_DONTKNOW	gettext(\
360 	"lockMatch: unable to determine how to compare locks: <%s> <%s>: " \
361 	"using direct comparision")
362 
363 #define	MSG_LCKMCH_READY	gettext(\
364 	"lockMatch: comparing nodes locks <%s> <%s>")
365 
366 #define	MSG_LCKMCH_NODEFAIL	gettext(\
367 	"lockMatch: node (%d) comparison: NO MATCH: <%s> != <%s>")
368 
369 #define	MSG_LCKMCH_NODEOK	gettext(\
370 	"lockMatch: node (%d) comparision: match: <%s> == <%s>")
371 
372 #define	MSG_LCKMCH_MATCHOK	gettext(\
373 	"lockMatch: locks match: <%s> == <%s>")
374 
375 #define	MSG_LOCK_EXEC_RESULTS	gettext(\
376 	"command <%s> executed: pid <%d> errno <0x%04x> status <0x%04x> " \
377 	"final status <0x%04x> output <%s>")
378 
379 #define	MSG_LOCK_GENUID_INTERNAL	gettext(\
380 	"generated new unique key using date: %s")
381 
382 #define	MSG_LOCK_DECLOCK_DECING	gettext(\
383 	"decrement <%s> lock count record <%d> count <%d>")
384 
385 #define	MSG_LOCK_DECLOCK_DONE	gettext(\
386 	"decrement lock record <%d> count <%d> object <%s> key <%s>")
387 
388 #define	MSG_LOCK_DECLOCK_REMOVE	gettext(\
389 	"decrement lock remove record lastPos %ld last record %d " \
390 	"current record %d")
391 
392 #define	MSG_LOCK_DECLOCK_LASTONE	gettext(\
393 	"decrement lock removing <%s> lock last record <%d> " \
394 	"truncating to <%ld>")
395 
396 #define	MSG_LOCK_DECLOCK_REMOVING	gettext(\
397 	"decrement lock removing record <%d> last record <%d> " \
398 	"truncating to <%ld>")
399 
400 #define	MSG_LOCK_INCLOCK_ENTRY	gettext(\
401 	"increment <%s> lock count record <%d> count <%d>")
402 
403 #define	MSG_LOCK_INCLOCK_DONE	gettext(\
404 	"increment lock record <%d> count <%d> object <%s> key <%s>")
405 
406 #define	MSG_LOCK_ADDLOCK_ADDING	gettext(\
407 	"adding %s lock pos <%d> object <%s> key <%s> pid <%ld> zid <%ld>")
408 
409 #define	MSG_LOCK_FINDLOCK_ENTRY	gettext(\
410 	"find lock object <%s> key <%s>")
411 
412 #define	MSG_LOCK_FINDLOCK_READRECORD	gettext(\
413 	"find lock read record <%d>: count <%d> object <%s> key <%s> pid " \
414 	"<%ld> zid <%ld>")
415 
416 #define	MSG_LOCK_FINDLOCK_FOUND	gettext(\
417 	"find lock record found")
418 
419 #define	MSG_LOCK_FINDLOCK_NOTFOUND	gettext(\
420 	"find lock record not found")
421 
422 #define	MSG_LOCK_OPENFILE_ENTRY	gettext(\
423 	"open lock file root <%s> file <%s>")
424 
425 #define	MSG_LOCK_OPENFILE_SLEEPING	gettext(\
426 	"open lock file busy <%s>: sleeping <%d>")
427 
428 #define	MSG_LOCK_OPENFILE_FAILURE	gettext(\
429 	"open lock file could not be opened: %s")
430 
431 #define	MSG_LOCK_OPENFILE_SLEEP2	gettext(\
432 	"open lock file cannot obtain record lock <%s>: sleeping <%d>")
433 
434 #define	MSG_LOCK_OPENFILE_FAIL2	gettext(\
435 	"open lock file could not obtain record lock: <%s>")
436 
437 #define	MSG_LOCK_OPENFILE_SUCCESS	gettext(\
438 	"open lock file: opened and locked fd <%d>")
439 
440 #define	MSG_LOCK_STATUS_READRECORD	gettext(\
441 	"status read record <%d>: count <%d> object <%s> key <%s> pid <%ld> " \
442 	"zid <%ld>")
443 
444 #define	MSG_LOCK_STATUS_ENTRY	gettext(\
445 	"status key=<%s> object=<%s>")
446 
447 #define	MSG_LOCK_RELEASE_FOUND		gettext(\
448 	"object <%s> key <%s> is locked: decrementing lock count")
449 
450 #define	MSG_LOCK_RELEASE_ENTRY	gettext(\
451 	"release lock key=<%s> object=<%s> quiet=<%d>")
452 
453 #define	MSG_LOCK_RELEASE_FINDRESULT	gettext(\
454 	"release lock result <%d> record <%d>")
455 
456 #define	MSG_LOCK_ACQUIRE_FOUND_INC	gettext(\
457 	"object <%s> key <%s> is locked: incrementing <%s> lock count")
458 
459 #define	MSG_LOCK_ACQUIRE_ENTRY	gettext(\
460 	"acquire lock key=<%s> object=<%s> quiet=<%d> exclusive=<%d>")
461 
462 #define	MSG_LOCK_ACQUIRE_FINDRESULT	gettext(\
463 	"acquire %s lock result <%d> record <%d>")
464 
465 #define	MSG_LOCK_ACQUIRE_LOCKED_SHARED	gettext(\
466 	"object <%s> key <%s> is locked but shared: incrementing lock count")
467 
468 #define	MSG_LOCK_ACQUIRE_NOTLOCKED	gettext(\
469 	"cannot acquire %s lock on <%s> key <%s>: object not locked " \
470 	"and non-matching key specified")
471 
472 #define	MSG_LOCK_ACQUIRE_NOTFOUND	gettext(\
473 	"acquiring %s lock on object <%s>")
474 
475 #ifdef	__cplusplus
476 }
477 #endif
478 
479 #endif /* _PKGADM_MSGS_H */
480