Explorar el Código

dpkg-split: Allow overridding admindir from the environment

This allows to use the correct depotdir whenever dpkg is being called
with --admindir.
Guillem Jover hace 14 años
padre
commit
e0643d20c2
Se han modificado 2 ficheros con 7 adiciones y 1 borrados
  1. 1 0
      debian/changelog
  2. 6 1
      dpkg-split/main.c

+ 1 - 0
debian/changelog

@@ -66,6 +66,7 @@ dpkg (1.16.4) UNRELEASED; urgency=low
     Closes: #675613, #676061, #676062, #676107, #676118, #676122
   * Do not reset Multi-Arch field in the update log when removing the package.
     Closes: #676496
+  * Fix dpkg-split to honour the DPKG_ADMINDIR environment variable.
 
   [ Updated man page translations ]
   * German (Helge Kreutzmann).

+ 6 - 1
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);