git.annexia.org
/
febootstrap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 3.8.
[febootstrap.git]
/
febootstrap_yum_rpm.ml
diff --git
a/febootstrap_yum_rpm.ml
b/febootstrap_yum_rpm.ml
index
ca38fe8
..
f6644b8
100644
(file)
--- a/
febootstrap_yum_rpm.ml
+++ b/
febootstrap_yum_rpm.ml
@@
-43,6
+43,8
@@
import sys
yb = yum.YumBase ()
yb.preconf.debuglevel = %d
yb.preconf.errorlevel = %d
yb = yum.YumBase ()
yb.preconf.debuglevel = %d
yb.preconf.errorlevel = %d
+if %s:
+ yb.preconf.fn = %S
yb.setCacheDir ()
# Look up the base packages from the command line.
yb.setCacheDir ()
# Look up the base packages from the command line.
@@
-74,7
+76,12
@@
for pkg in deps.keys ():
f.write (\"%%s %%s %%s %%s %%s\\n\" %%
(pkg.name, pkg.epoch, pkg.version, pkg.release, pkg.arch))
f.close ()
f.write (\"%%s %%s %%s %%s %%s\\n\" %%
(pkg.name, pkg.epoch, pkg.version, pkg.release, pkg.arch))
f.close ()
-" (if verbose then 1 else 0) (if verbose then 1 else 0) tmpfile in
+"
+ (if verbose then 1 else 0)
+ (if verbose then 1 else 0)
+ (match yum_config with None -> "False" | Some _ -> "True")
+ (match yum_config with None -> "" | Some filename -> filename)
+ tmpfile in
run_python py names;
let chan = open_in tmpfile in
let lines = input_all_lines chan in
run_python py names;
let chan = open_in tmpfile in
let lines = input_all_lines chan in
@@
-138,8
+145,10
@@
f.close ()
exit 1
);
exit 1
);
- let cmd = sprintf "yumdownloader%s --destdir %s %s"
+ let cmd = sprintf "yumdownloader%s
%s
--destdir %s %s"
(if verbose then "" else " --quiet")
(if verbose then "" else " --quiet")
+ (match yum_config with None -> ""
+ | Some filename -> sprintf " -c %s" filename)
(Filename.quote tmpdir)
(String.concat " " (List.map Filename.quote pkgnames)) in
run_command cmd;
(Filename.quote tmpdir)
(String.concat " " (List.map Filename.quote pkgnames)) in
run_command cmd;
@@
-154,7
+163,7
@@
f.close ()
let rec yum_rpm_list_files pkg =
(* Run rpm -qlp with some extra magic. *)
let cmd =
let rec yum_rpm_list_files pkg =
(* Run rpm -qlp with some extra magic. *)
let cmd =
- sprintf "rpm -q --qf '[%%{FILENAMES} %%{FILEFLAGS:fflags} %%{FILEMODES}\\n]' -p %s"
+ sprintf "rpm -q --qf '[%%{FILENAMES} %%{FILEFLAGS:fflags} %%{FILEMODES}
%%{FILESIZES}
\\n]' -p %s"
pkg in
let lines = run_command_get_lines cmd in
pkg in
let lines = run_command_get_lines cmd in
@@
-162,15
+171,16
@@
let rec yum_rpm_list_files pkg =
filter_map (
fun line ->
match string_split " " line with
filter_map (
fun line ->
match string_split " " line with
- | [filename; flags; mode] ->
+ | [filename; flags; mode
; size
] ->
let test_flag = String.contains flags in
let mode = int_of_string mode in
let test_flag = String.contains flags in
let mode = int_of_string mode in
+ let size = int_of_string size in
if test_flag 'd' then None (* ignore documentation *)
else
Some (filename, {
ft_dir = mode land 0o40000 <> 0;
ft_ghost = test_flag 'g'; ft_config = test_flag 'c';
if test_flag 'd' then None (* ignore documentation *)
else
Some (filename, {
ft_dir = mode land 0o40000 <> 0;
ft_ghost = test_flag 'g'; ft_config = test_flag 'c';
- ft_mode = mode;
+ ft_mode = mode;
ft_size = size;
})
| _ ->
eprintf "febootstrap: bad output from rpm command: '%s'" line;
})
| _ ->
eprintf "febootstrap: bad output from rpm command: '%s'" line;
@@
-190,7
+200,8
@@
let rec yum_rpm_list_files pkg =
let dirs =
List.map (fun name ->
name, { ft_dir = true; ft_ghost = false;
let dirs =
List.map (fun name ->
name, { ft_dir = true; ft_ghost = false;
- ft_config = false; ft_mode = 0o40755 }) dirs in
+ ft_config = false; ft_mode = 0o40755;
+ ft_size = 0 }) dirs in
let devs = [ "/dev/null"; "/dev/full"; "/dev/zero"; "/dev/random";
"/dev/urandom"; "/dev/tty"; "/dev/console";
"/dev/ptmx"; "/dev/stdin"; "/dev/stdout"; "/dev/stderr" ] in
let devs = [ "/dev/null"; "/dev/full"; "/dev/zero"; "/dev/random";
"/dev/urandom"; "/dev/tty"; "/dev/console";
"/dev/ptmx"; "/dev/stdin"; "/dev/stdout"; "/dev/stderr" ] in
@@
-198,7
+209,8
@@
let rec yum_rpm_list_files pkg =
let devs =
List.map (fun name ->
name, { ft_dir = false; ft_ghost = false;
let devs =
List.map (fun name ->
name, { ft_dir = false; ft_ghost = false;
- ft_config = false; ft_mode = 0o644 }) devs in
+ ft_config = false; ft_mode = 0o644;
+ ft_size = 0 }) devs in
dirs @ devs @ files
) else files in
dirs @ devs @ files
) else files in