From: Richard W.M. Jones Date: Thu, 1 Sep 2011 09:23:36 +0000 (+0100) Subject: debian: Detect apt-cache in configure. X-Git-Tag: 3.10~5 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=e4c7daf8bcdcf094719b3169ed79aece64a933bd;p=febootstrap.git debian: Detect apt-cache in configure. --- 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