diff options
author | Guillem Jover <guillem@debian.org> | 2012-06-07 19:02:01 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2012-06-08 08:32:10 +0200 |
commit | e0643d20c2eada5a4b0e5f49692426b1d5615f5f (patch) | |
tree | 1bbd6188105878ea4627fb664f660fca48c459b4 /dpkg-split | |
parent | 5ba5d341998646321dd7452febd15e8a780c7287 (diff) | |
download | dpkg-e0643d20c2eada5a4b0e5f49692426b1d5615f5f.tar.gz |
dpkg-split: Allow overridding admindir from the environment
This allows to use the correct depotdir whenever dpkg is being called
with --admindir.
Diffstat (limited to 'dpkg-split')
-rw-r--r-- | dpkg-split/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/dpkg-split/main.c b/dpkg-split/main.c index ee0c8ab9e..2bbb53080 100644 --- a/dpkg-split/main.c +++ b/dpkg-split/main.c @@ -107,7 +107,8 @@ static const char printforhelp[] = N_("Type dpkg-split --help for help."); struct partqueue *queue= NULL; off_t opt_maxpartsize = SPLITPARTDEFMAX; -const char *opt_depotdir = ADMINDIR "/" PARTSDIR; +static const char *admindir; +const char *opt_depotdir; const char *opt_outputfile = NULL; int opt_npquiet = 0; int opt_msdos = 0; @@ -163,6 +164,10 @@ int main(int argc, const char *const *argv) { standard_startup(); myopt(&argv, cmdinfos, printforhelp); + admindir = dpkg_db_set_dir(admindir); + if (opt_depotdir == NULL) + opt_depotdir = dpkg_db_get_path(PARTSDIR); + if (!cipaction) badusage(_("need an action option")); setvbuf(stdout,NULL,_IONBF,0); |