summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-10-18 14:11:14 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-10-18 14:11:14 +0100
commit1e70cc1d9b1630766431bafe35668c3828df578a (patch)
treeb05c91b380745e587339f5bfe4646ceb9f2c35b6 /src
parent2b1631439dc8dc4c6b8d7d78a5f3a5b2c08d83fd (diff)
downloadfebootstrap-1e70cc1d9b1630766431bafe35668c3828df578a.tar.gz
febootstrap-1e70cc1d9b1630766431bafe35668c3828df578a.tar.xz
febootstrap-1e70cc1d9b1630766431bafe35668c3828df578a.zip
debian: Get installed package list in the ph_init handler.
Use the Debian ph_init handler to get the list of installed packages.
Diffstat (limited to 'src')
-rw-r--r--src/febootstrap_debian.ml23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/febootstrap_debian.ml b/src/febootstrap_debian.ml
index e4b42af..85c9b7e 100644
--- a/src/febootstrap_debian.ml
+++ b/src/febootstrap_debian.ml
@@ -28,25 +28,20 @@ open Febootstrap_cmdline
(* Create a temporary directory for use by all the functions in this file. *)
let tmpdir = tmpdir ()
-let get_installed_pkgs =
- let pkgs = ref None in
- let rec f () =
- match !pkgs with
- | None ->
- pkgs :=
- Some (run_command_get_lines
- "dpkg-query --show --showformat='${Package}\\n'");
- f ()
- | Some pkgs -> pkgs
- in
- f
-
let debian_detect () =
file_exists "/etc/debian_version" &&
Config.aptitude <> "no" && Config.apt_cache <> "no" && Config.dpkg <> "no"
+let installed_pkgs = ref []
+
let debian_init () =
- ()
+ installed_pkgs :=
+ run_command_get_lines "dpkg-query --show --showformat='${Package}\\n'"
+
+let get_installed_pkgs () =
+ match !installed_pkgs with
+ | [] -> assert false
+ | pkgs -> pkgs
let rec debian_resolve_dependencies_and_download names =
let cmd =