Lines Matching defs:contents

4  * The contents of this file are subject to the terms of the
62 #define ERR_COMMIT "WARNING: unable to commit contents database update"
66 #define ERR_NORENAME_CONTENTS "unable to establish contents file <%s> "\
73 #define ERR_NOTMPOPEN "unable to open temporary contents file image"
75 #define ERR_CREAT_CONT "unable to create contents file <%s>: %s"
76 #define ERR_ACCESS_CONT "unable to access contents file <%s>: %s"
79 #define ERR_NOCFILE "unable to locate contents file <%s>"
82 #define ERR_NOSTAT "unable to stat contents file <%s>"
84 #define ERR_NOUPD "unable to update contents file"
85 #define ERR_DRCONTCP "unable to copy contents file to <%s>"
99 #define ERR_CFDIR "unable to locate contents file directory"
122 * Point packaging to the appropriate contents file. This is primarily used
123 * to establish a dryrun contents file. If the malloc() doesn't work, this
142 (void) snprintf(tmpcf, sizeof (tmpcf), "%s/contents", pkgadm_dir);
145 * return if a temporary contents file already exists -
154 * no temporary contents file exists - create one.
157 (void) snprintf(realcf, sizeof (realcf), "%s/contents", get_PKGADM());
160 * If there's a contents file there already, copy it
162 * server, if running, flushes the contents file.
167 /* create new contents file if one does not already exist */
181 /* contents file exists, save in pkgadm-dir */
194 * This function installs the database lock, opens the contents file for
195 * reading and creates and opens the temporary contents file for read/write.
207 char contents[PATH_MAX];
213 /* establish package administration contents directory location */
246 /* determine path to the primary contents file */
247 (void) snprintf(contents, sizeof (contents), "%s/contents", pkgadm_dir);
251 * to back up the contents file, if there is not, then do not allow
255 /* Get the contents file size */
257 if (stat64(contents, &statb) == -1) {
260 progerr(gettext(ERR_NOCFILE), contents);
268 if (statvfs64(contents, &svfsb) == -1) {
271 progerr(gettext(ERR_NOSTATV), contents);
291 * the contents file and the log file.
294 * lines added to the contents file. That data is written both to
295 * the new contents file and the log file (2 * 1.5 * map_blks).
296 * The new contents file is limited by the size of the current
297 * contents file and the increased log file.
299 * of the full contents file but then the new contents file would
300 * be zero and so we only need to add the size of the contents file.
305 /* Current contents file */
309 progerr(gettext(ERR_CFBACK), contents);
317 * open the temporary contents file without a path name - this causes
320 * contents file to be maintained in memory only - if no changes are
321 * made as the primary contents file is processed, the in memory data
335 * set size of allocation for temporary contents file - this sets the
367 * This is a simple open and lock of the contents file. It doesn't create a
368 * temporary contents file and it doesn't need to do any space checking.
374 char contents[PATH_MAX];
407 * Description: This function closes both the current and temporary contents
409 * contents file with the newly updated temporary contents file.
411 * open the real contents file for processing.
420 * comment at the end of the contents file.
422 * == 0 - the temporary contents file has NOT been changed
423 * with respect to the real contents file; do not
424 * update the real contents file with the contents
425 * of the temporary contents file.
427 * respect to the real contents file; DO update the
428 * real contents file with the contents of the
429 * temporary contents file.
434 * NOTES: If dbchg != 0, the contents file is always updated. If dbchg == 0,
435 * the contents file is updated IF the data is modified indication
436 * is set on the contents file associated with a_cfTmpVfp.
460 * contents file - if this fails, then just close the file which causes
461 * the contents file to be reopened and reread if it is needed again
470 * changes made to the current temporary contents file -
471 * remove any trailing comment lines in the temp contents file, then
472 * append updated modification info records to temp contents file
475 pe = vfpGetCurrCharPtr(*a_cfTmpVfp); /* last char in contents file */
476 ps = vfpGetFirstCharPtr(*a_cfTmpVfp); /* 1st char in contents file */
477 pl = pe; /* last match is last char in contents file */
513 /* commit temporary contents file bytes to storage */
533 * This closes the contents file and releases the lock.
642 * This function verifies that the contents file is in place.
649 char contents[PATH_MAX];
651 (void) snprintf(contents, PATH_MAX, "%s/contents", get_PKGADM());
653 return (access(contents, F_OK) == 0 ? 1 : 0);
657 * This function verifies that the contents file is in place. If it is - no
668 char contents[PATH_MAX];
671 * create full path to contents file
674 (void) snprintf(contents, sizeof (contents),
675 "%s/contents", get_PKGADM());
682 fd = open(contents, O_WRONLY | O_CREAT | O_EXCL, 0644);
688 echo(gettext("## Software contents file initialized"));
711 * if the contents file already exists, the open will
716 if (access(contents, F_OK) == 0) {
722 * means the contents file exists but it cannot be accessed
723 * or the path to the contents file cannot be accessed - in
724 * either case the contents file cannot be accessed.
728 progerr(gettext(ERR_ACCESS_CONT), contents,
736 * the contents file does not exist and it cannot be created.
739 progerr(gettext(ERR_CREAT_CONT), contents, strerror(lerrno));