2 * Copyright (C) 2009-2010 Red Hat Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 open Febootstrap_utils
23 open Febootstrap_cmdline
25 type package_handler = {
26 ph_detect : unit -> bool;
27 ph_resolve_dependencies_and_download : string list -> string list;
28 ph_list_files : string -> (string * file_type) list;
29 ph_get_file_from_package : string -> string -> string
38 let tmpdir = tmpdir ()
42 let register_package_handler name ph =
43 debug "registering package handler: %s" name;
44 handlers := (name, ph) :: !handlers
46 let handler = ref None
58 febootstrap: could not detect package manager used by this system or distro.
60 If this is a new Linux distro, or not Linux, or a Linux distro that uses
61 an unusual packaging format then you may need to port febootstrap. If
62 you are expecting that febootstrap should work on this system or distro
63 then it may be that the package detection code is not working.
67 let rec get_package_handler () =
72 get_package_handler ()
74 let rec get_package_handler_name () =
76 | Some (name, _) -> name
79 get_package_handler_name ()