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_init : unit -> unit;
28 ph_resolve_dependencies_and_download : string list -> string list;
29 ph_list_files : string -> (string * file_type) list;
30 ph_get_file_from_package : string -> string -> string
40 let tmpdir = tmpdir ()
44 let register_package_handler name ph =
45 debug "registering package handler: %s" name;
46 handlers := (name, ph) :: !handlers
48 let handler = ref None
50 let rec check_system () =
58 (get_package_handler ()).ph_init ()
61 febootstrap: could not detect package manager used by this system or distro.
63 If this is a new Linux distro, or not Linux, or a Linux distro that uses
64 an unusual packaging format then you may need to port febootstrap. If
65 you are expecting that febootstrap should work on this system or distro
66 then it may be that the package detection code is not working.
70 and get_package_handler () =
75 get_package_handler ()
77 and get_package_handler_name () =
79 | Some (name, _) -> name
82 get_package_handler_name ()