summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade/misc.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-07-09 14:28:22 +0000
committerjkh <jkh@FreeBSD.org>1996-07-09 14:28:22 +0000
commit496e7f4568937e852ced808b4a8cd4446db07162 (patch)
tree5e7e9f24ecabadbd0814225a779cf6e4528beaaf /usr.sbin/sade/misc.c
parenta97e1fa1c1dc7804b2698668fce58aba32b2277b (diff)
downloadFreeBSD-src-496e7f4568937e852ced808b4a8cd4446db07162.zip
FreeBSD-src-496e7f4568937e852ced808b4a8cd4446db07162.tar.gz
A number of improvements in the way statistics are printed, add a "chroot"
option for installing distributions and/or packages to somewhere other than /, say for a case where you're installing to an external disk on some other machine's behalf. More miscellaneous fixes to various problems I stumbled across while adding this stuff.
Diffstat (limited to 'usr.sbin/sade/misc.c')
-rw-r--r--usr.sbin/sade/misc.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/usr.sbin/sade/misc.c b/usr.sbin/sade/misc.c
index e4a1360..1dfc30d 100644
--- a/usr.sbin/sade/misc.c
+++ b/usr.sbin/sade/misc.c
@@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
- * $Id: misc.c,v 1.20 1996/06/25 18:41:10 jkh Exp $
+ * $Id: misc.c,v 1.21 1996/07/08 08:54:30 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -203,6 +203,20 @@ safe_realloc(void *orig, size_t size)
return ptr;
}
+/* Create a path biased from the VAR_INSTALL_ROOT variable (if not /) */
+char *
+root_bias(char *path)
+{
+ static char tmp[FILENAME_MAX];
+ char *cp = variable_get(VAR_INSTALL_ROOT);
+
+ if (!strcmp(cp, "/"))
+ return path;
+ strcpy(tmp, variable_get(VAR_INSTALL_ROOT));
+ strcat(tmp, path);
+ return tmp;
+}
+
/*
* These next routines are kind of specialized just for building string lists
* for dialog_menu().
OpenPOWER on IntegriCloud