Permalink
Browse files

archlinux: Add pacman configuration option.

  • Loading branch information...
1 parent cfc8764 commit bfecae4c70a42d5b14f61a6601a7cd7dd88fac0b Evaggelos Balaskas committed with rwmjones Dec 21, 2012
Showing with 23 additions and 1 deletion.
  1. +8 −0 src/febootstrap.pod
  2. +7 −0 src/febootstrap_cmdline.ml
  3. +3 −0 src/febootstrap_cmdline.mli
  4. +5 −1 src/febootstrap_pacman.ml
View
@@ -91,6 +91,14 @@ written (C<hostfiles> and C<base.img>). The default directory is the
current directory. Note that if this files exist already in the
output directory then they will be overwritten.
+=item B<--pacman-config CONFIGFILE>
+
+(ArchLinux package handler only). Use an alternate configuration file
+instead of C</etc/pacman.conf>. If you also want to specify alternate
+repositories then you can put them in this file directly or add a
+C<reposdir> option to this file. For more information on the file
+format see L<pacman.conf(5)>.
+
=item B<--save-temps>
Don't remove temporary files and directories on exit. This is useful
@@ -27,6 +27,7 @@ let use_installed = ref false
let verbose = ref false
let warnings = ref true
let yum_config = ref None
+let pacman_config = ref None
let print_version () =
printf "%s %s\n" Config.package_name Config.package_version;
@@ -38,6 +39,9 @@ let add_exclude re =
let set_yum_config str =
yum_config := Some str
+let set_pacman_config str =
+ pacman_config := Some str
+
let argspec = Arg.align [
"--exclude", Arg.String add_exclude,
"regexp Exclude packages matching regexp";
@@ -47,6 +51,8 @@ let argspec = Arg.align [
" Suppress warnings";
"-o", Arg.Set_string outputdir,
"outputdir Set output directory (default: \".\")";
+ "--pacman-config", Arg.String set_pacman_config,
+ "file Set alternate pacman configuration file";
"--save-temp", Arg.Set save_temps,
" Don't delete temporary files and directories on exit.";
"--save-temps", Arg.Set save_temps,
@@ -96,5 +102,6 @@ let use_installed = !use_installed
let verbose = !verbose
let warnings = !warnings
let yum_config = !yum_config
+let pacman_config = !pacman_config
let debug fs = ksprintf (fun str -> if verbose then print_endline str) fs
@@ -50,3 +50,6 @@ val warnings : bool
val yum_config : string option
(** Yum configuration file. *)
+
+val pacman_config : string option
+ (**pacman configuration file. *)
@@ -52,11 +52,15 @@ let pacman_resolve_dependencies_and_download names =
(* Download the packages. I could use wget `pacman -Sp`, but this
* narrows the pacman -Sy window
*)
+
List.iter (
fun pkg ->
let cmd =
- sprintf "umask 0000; cd %s && mkdir -p var/lib/pacman && fakeroot pacman -Syw --noconfirm --cachedir=$(pwd) --root=$(pwd) %s"
+ sprintf "umask 0000; cd %s && mkdir -p var/lib/pacman && fakeroot pacman%s -Syw --noconfirm --cachedir=$(pwd) --root=$(pwd) %s"
(Filename.quote tmpdir)
+ (match pacman_config with
+ | None -> ""
+ | Some filename -> " --config " ^ filename)
pkg in
if Sys.command cmd <> 0 then (
(* The package is not in the main repos, check the aur *)

0 comments on commit bfecae4

Please sign in to comment.