summaryrefslogtreecommitdiff
path: root/src/apk.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-01-12 21:03:20 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-12 21:03:20 +0000
commitb8940df6b9b9f4aa644cb1dfa91732b451d43ffd (patch)
treef7bda798e90b3cb1ee0e808d7ec98019ea78fc12 /src/apk.c
parent09385545d99ecd20034b9c369396b20982b79351 (diff)
downloadapk-tools-b8940df6b9b9f4aa644cb1dfa91732b451d43ffd.tar.gz
apk-tools-b8940df6b9b9f4aa644cb1dfa91732b451d43ffd.tar.bz2
apk-tools-b8940df6b9b9f4aa644cb1dfa91732b451d43ffd.tar.xz
apk-tools-b8940df6b9b9f4aa644cb1dfa91732b451d43ffd.zip
apk: support for ROOT environment variable
Diffstat (limited to 'src/apk.c')
-rw-r--r--src/apk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/apk.c b/src/apk.c
index dbc2044..626c4ee 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -20,7 +20,7 @@
#include "apk_defines.h"
#include "apk_applet.h"
-const char *apk_root = "/";
+const char *apk_root;
const char *apk_repository = NULL;
int apk_quiet = 0, apk_progress = 0;
int apk_cwd_fd;
@@ -115,6 +115,10 @@ int main(int argc, char **argv)
argc -= optind;
argv += optind;
+ apk_root = getenv("ROOT");
+ if (apk_root == NULL)
+ apk_root = "/";
+
if (applet == NULL) {
if (argc > 0)
applet = find_applet(argv[0]);