From e4c7daf8bcdcf094719b3169ed79aece64a933bd Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Sep 2011 10:23:36 +0100 Subject: [PATCH] debian: Detect apt-cache in configure. --- config.ml.in | 1 + configure.ac | 1 + febootstrap_debian.ml | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config.ml.in b/config.ml.in index a8c008a..fc8fbfe 100644 --- a/config.ml.in +++ b/config.ml.in @@ -23,6 +23,7 @@ let yum = "@YUM@" let rpm = "@RPM@" let yumdownloader = "@YUMDOWNLOADER@" let aptitude = "@APTITUDE@" +let apt_cache = "@APT_CACHE@" let dpkg = "@DPKG@" let pacman = "@PACMAN@" let host_cpu = "@host_cpu@" diff --git a/configure.ac b/configure.ac index 1ba8e99..6f0cdc7 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,7 @@ AC_CHECK_PROG(YUMDOWNLOADER,[yumdownloader],[yumdownloader],[no]) dnl For Debian handler. AC_CHECK_PROG(APTITUDE,[aptitude],[aptitude],[no]) +AC_CHECK_PROG(APT_CACHE,[apt-cache],[apt-cache],[no]) AC_CHECK_PROG(DPKG,[dpkg],[dpkg],[no]) dnl For ArchLinux handler. diff --git a/febootstrap_debian.ml b/febootstrap_debian.ml index 4aa7389..06fcbc3 100644 --- a/febootstrap_debian.ml +++ b/febootstrap_debian.ml @@ -30,11 +30,12 @@ let tmpdir = tmpdir () let debian_detect () = file_exists "/etc/debian_version" && - Config.aptitude <> "no" && Config.dpkg <> "no" + Config.aptitude <> "no" && Config.apt_cache <> "no" && Config.dpkg <> "no" let debian_resolve_dependencies_and_download names = let cmd = - sprintf "apt-cache depends --recurse -i %s | grep -v '^[<[:space:]]'" + sprintf "%s depends --recurse -i %s | grep -v '^[<[:space:]]'" + Config.apt_cache (String.concat " " (List.map Filename.quote names)) in let pkgs = run_command_get_lines cmd in -- 1.8.3.1