apk: support for ROOT environment variable

cute-signatures
Natanael Copa 2009-01-12 21:03:20 +00:00
parent 09385545d9
commit b8940df6b9
1 changed files with 5 additions and 1 deletions

View File

@ -20,7 +20,7 @@
#include "apk_defines.h" #include "apk_defines.h"
#include "apk_applet.h" #include "apk_applet.h"
const char *apk_root = "/"; const char *apk_root;
const char *apk_repository = NULL; const char *apk_repository = NULL;
int apk_quiet = 0, apk_progress = 0; int apk_quiet = 0, apk_progress = 0;
int apk_cwd_fd; int apk_cwd_fd;
@ -115,6 +115,10 @@ int main(int argc, char **argv)
argc -= optind; argc -= optind;
argv += optind; argv += optind;
apk_root = getenv("ROOT");
if (apk_root == NULL)
apk_root = "/";
if (applet == NULL) { if (applet == NULL) {
if (argc > 0) if (argc > 0)
applet = find_applet(argv[0]); applet = find_applet(argv[0]);