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 let names_mode = ref false
23 let outputdir = ref "."
25 let verbose = ref false
26 let warnings = ref true
28 let print_version () =
29 printf "%s %s\n" Config.package_name Config.package_version;
33 excludes := Str.regexp re :: !excludes
35 let argspec = Arg.align [
36 "--exclude", Arg.String add_exclude,
37 "regexp Exclude packages matching regexp";
38 "--names", Arg.Set names_mode,
39 " Specify set of root package names on command line";
40 "--no-warnings", Arg.Clear warnings,
42 "-o", Arg.Set_string outputdir,
43 "outputdir Set output directory (default: \".\")";
44 "-v", Arg.Set verbose,
45 " Enable verbose output";
46 "--verbose", Arg.Set verbose,
47 " Enable verbose output";
48 "-V", Arg.Unit print_version,
49 " Print package name and version, and exit";
50 "--version", Arg.Unit print_version,
51 " Print package name and version, and exit";
54 packages := str :: !packages
58 febootstrap - bootstrapping tool for creating supermin appliances
59 Copyright (C) 2009-2010 Red Hat Inc.
62 febootstrap [-o OUTPUTDIR] --names LIST OF PKGS ...
63 febootstrap [-o OUTPUTDIR] PKG FILE NAMES ...
65 For full instructions see the febootstrap(8) man page.
70 Arg.parse argspec anon_fn usage_msg;
71 if !packages = [] then (
72 eprintf "febootstrap: no packages listed on the command line\n";
76 let excludes = List.rev !excludes
77 let names_mode = !names_mode
78 let outputdir = !outputdir
79 let packages = List.rev !packages
80 let warnings = !warnings
82 let debug fs = ksprintf (fun str -> if !verbose then print_endline str) fs