diff options
| author | Richard W.M. Jones <rjones@redhat.com> | 2010-12-03 13:17:00 +0000 |
|---|---|---|
| committer | Richard W.M. Jones <rjones@redhat.com> | 2010-12-05 09:33:25 +0000 |
| commit | 66a9d53e48f14d7fe1d9f4b801a1c5582d83efa6 (patch) | |
| tree | 555e29f52452cd88a6deb086b86bb55ab85f5fff /febootstrap_utils.mli | |
| parent | 304ee3695e41904d8b2184922732f47aa6ccc0d4 (diff) | |
| download | febootstrap-3.0.tar.gz febootstrap-3.0.tar.xz febootstrap-3.0.zip | |
Rewrite febootstrap as a general supermin appliance building tool.3.0
This complete rewrite of the building tools turns febootstrap
into a general purpose, cross-distro, supermin appliance only
build tool.
There is now only one program 'febootstrap' which is used to
build a supermin appliance from a list of packages.
Normal appliances are not supported.
The tools are incompatible with febootstrap 2.x (use the
febootstrap-2.x branch from git to get the old package).
Diffstat (limited to 'febootstrap_utils.mli')
| -rw-r--r-- | febootstrap_utils.mli | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/febootstrap_utils.mli b/febootstrap_utils.mli new file mode 100644 index 0000000..3087ee0 --- /dev/null +++ b/febootstrap_utils.mli @@ -0,0 +1,73 @@ +(* febootstrap 3 + * Copyright (C) 2009-2010 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + +(** Utilities. *) + +val file_exists : string -> bool + (** Return [true] iff file exists. *) + +val dir_exists : string -> bool + (** Return [true] iff dir exists. *) + +val uniq : ?cmp:('a -> 'a -> int) -> 'a list -> 'a list + (** Uniquify a list (the list must be sorted first). *) + +val sort_uniq : ?cmp:('a -> 'a -> int) -> 'a list -> 'a list + (** Sort and uniquify a list. *) + +val input_all_lines : in_channel -> string list + (** Input all lines from a channel, returning a list of lines. *) + +val run_command_get_lines : string -> string list + (** Run the command and read the list of lines that it prints to stdout. *) + +val run_command : string -> unit + (** Run a command using {!Sys.command} and exit if it fails. Be careful + when constructing the command to properly quote any arguments + (using {!Filename.quote}). *) + +val run_python : string -> string list -> unit + (** [run_python code args] runs Python [code] with arguments [args]. + This does not return anything, but exits with an error message + if the Python code returns an error. *) + +val tmpdir : unit -> string + (** [tmpdir ()] returns a newly created temporary directory. The + tmp directory is automatically removed when the program exits. + Note that a fresh temporary directory is returned each time you + call this function. *) + +val (//) : string -> string -> string + (** [x // y] concatenates file paths [x] and [y] into a single path. *) + +val find : string -> string -> int +(** [find str sub] searches for [sub] in [str], returning the index + or -1 if not found. *) + +val string_split : string -> string -> string list + (** [string_split sep str] splits [str] at [sep]. *) + +val string_prefix : string -> string -> bool + (** [string_prefix prefix str] returns true iff [str] starts with [prefix]. *) + +val path_prefix : string -> string -> bool + (** [path_prefix prefix path] returns true iff [path] is [prefix] or + [path] starts with [prefix/]. *) + +val filter_map : ('a -> 'b option) -> 'a list -> 'b list + (** map + filter *) |
