diff options
author | Daniel Burrows <dburrows@debian.org> | 2009-03-06 08:28:08 -0800 |
---|---|---|
committer | Daniel Burrows <dburrows@debian.org> | 2009-03-06 08:28:08 -0800 |
commit | 57975a9928e56e94e0b25e7838b0731da129a043 (patch) | |
tree | fa4fbca5196d960b70492254e9385532d3d09a38 /src/main.cc | |
parent | 0c506026e9249550aa4f0b365e8e29fe10c916b2 (diff) | |
download | aptitude-57975a9928e56e94e0b25e7838b0731da129a043.tar.gz |
Add a slightly hacky way to set RootDir before the configuration, source list, etc are read.
Diffstat (limited to 'src/main.cc')
-rw-r--r-- | src/main.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.cc b/src/main.cc index 2b21ffe9..bc0cadab 100644 --- a/src/main.cc +++ b/src/main.cc @@ -466,7 +466,13 @@ int main(int argc, char *argv[]) bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); - apt_preinit(); + // An environment variable is used mostly because of the utterly + // lame option parsing that aptitude does. A better option parser + // would pre-parse the options and remember them in a structure of + // some sort, meaning that I could parse the command-line options + // before I set up the apt configuration structures. + const char * const rootdir = getenv("APT_ROOT_DIR"); + apt_preinit(rootdir); char *status_fname=NULL; // The filename to read status information from. |