aboutsummaryrefslogtreecommitdiff
path: root/libbb/appletlib.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-08-15 09:37:06 +0100
committerRon Yorston <rmy@pobox.com>2020-08-15 09:37:06 +0100
commitb95ed10bd31d57b1ca1fac0de273bbe98903d0b8 (patch)
tree01a6dff7cc6c330679164b59fbe67320d158c85d /libbb/appletlib.c
parentc775e9de197afe1cc0907f559f7cab36d52c93fa (diff)
downloadbusybox-w32-b95ed10bd31d57b1ca1fac0de273bbe98903d0b8.tar.gz
busybox-w32-b95ed10bd31d57b1ca1fac0de273bbe98903d0b8.tar.bz2
busybox-w32-b95ed10bd31d57b1ca1fac0de273bbe98903d0b8.zip
busybox: create custom installation directory
If a custom installation directory is specified try to create it. Don't worry if we can't, we'll find out when the links fail.
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r--libbb/appletlib.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 35f577b89..77a9c3b7d 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -768,13 +768,14 @@ static void install_links(const char *busybox,
768{ 768{
769 char *fpc; 769 char *fpc;
770 const char *appname = applet_names; 770 const char *appname = applet_names;
771 const char *sd = custom_install_dir == NULL ? get_system_drive() : NULL; 771 const char *sd = NULL;
772 int i, rc; 772 int i, rc;
773 773
774 if (custom_install_dir && !is_directory(custom_install_dir, FALSE)) 774 if (custom_install_dir != NULL) {
775 bb_error_msg_and_die("'%s' is not a directory", custom_install_dir); 775 bb_make_directory(custom_install_dir, 0755, FILEUTILS_RECUR);
776 776 }
777 if (custom_install_dir == NULL) { 777 else {
778 sd = get_system_drive();
778 for (i=1; i<ARRAY_SIZE(install_dir); ++i) { 779 for (i=1; i<ARRAY_SIZE(install_dir); ++i) {
779 fpc = xasprintf("%s%s", sd ?: "", install_dir[i]); 780 fpc = xasprintf("%s%s", sd ?: "", install_dir[i]);
780 bb_make_directory(fpc, 0755, FILEUTILS_RECUR); 781 bb_make_directory(fpc, 0755, FILEUTILS_RECUR);