Lines Matching refs:basedir
48 static char *orig_basedir = NULL; /* The unadjusted basedir */
49 static char *basedir = NULL; /* basedir (cmb w/ inst rt if req) */
70 static int base_sepr = 1; /* separator length btwn basedir & path */
83 #define ERR_ADMIN_INVAL "Invalid basedir entry in admin file."
299 * be a subset of the original argument unless basedir = '/' in
324 * If the basedir path was built legally, then moving
347 * new space and provides a new copy of the original basedir path which
377 /* ask for the basedir */
389 basedir, NULL, gettext(MSG_HELP),
399 * Set the basedir and client_basedir based on install root and config
412 * If there are no relocatable files basedir is probably meaningless
449 (basedir = getenv("BASEDIR"))) != 0) {
451 getenv("PKG"), basedir, orig_basedir);
474 basedir = getenv("BASEDIR");
475 if (basedir && *basedir)
476 orig_basedir = expand_path(basedir);
485 basedir = pkgparam(pkginst, "BASEDIR");
486 if (basedir && *basedir)
487 orig_basedir = expand_path(basedir);
495 * basedir is if there's an install root meaning there's
496 * really a basedir relative to this host or this package is
498 * interested in the prior basedir. So we next check for a
499 * prior basedir and then an install root.
501 basedir = pkgparam(pkginst, "BASEDIR");
502 if (basedir && *basedir)
503 orig_basedir = expand_path(basedir);
507 * If we have a basedir *only because*
522 basedir = fixpath(orig_basedir);
525 * If basedir == "/" then there's no need for a "/" between
528 if (strcmp(basedir, "/") == 0)
576 mkbasedir(int flag, char *basedir)
585 if (is_a_basedir() && isdir(basedir)) {
590 if (access(basedir, F_OK) == 0) {
591 ptext(stderr, gettext(MSG_ISAFILE), basedir);
603 if (unlink(basedir) == -1) {
605 basedir);
610 ptext(stderr, gettext(MSG_MUSTEXIST), basedir);
620 if (access(basedir, F_OK) == 0 || mkpath(basedir)) {
621 progerr(gettext(ERR_MKBASE), basedir);
650 client_basedir = strdup(basedir);
695 return (basedir);
705 * This function returns the basedir that is appropriate for this package's
714 return (basedir);
755 putparam("BASEDIR", basedir);
763 * possible path (with install_root and basedir prepended. The pointers
784 * 1. Prepend the basedir to the path (the basedir is guaranteed to exist
787 * 2. Prepend the install_root (not the basedir) to the path
805 * basedir and the path with the '+ 1'. If there is a
806 * relative path, then there is always a basedir. The
810 orig_offset_rel = (is_a_basedir()) ? (strlen(basedir) +
816 * directory or the absolute path. Once the basedir has
850 rel_fmt[base_sepr], basedir, path);