summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Nolte <erik_nolte@acm.org>2011-10-06 14:55:36 -0600
committerRichard W.M. Jones <rjones@redhat.com>2011-10-14 10:58:24 +0100
commit20a67e4e844a5be640edf3f7f183a89a083e92d0 (patch)
tree7c162802eb596c5ebb15516207fbd40c2c89f7e6 /src
parent65125379903231f1b0c2ccd0929123317c80bcc2 (diff)
downloadfebootstrap-20a67e4e844a5be640edf3f7f183a89a083e92d0.tar.gz
febootstrap-20a67e4e844a5be640edf3f7f183a89a083e92d0.tar.xz
febootstrap-20a67e4e844a5be640edf3f7f183a89a083e92d0.zip
Find package dependencies fix for pacman.
Since the pactree utility only accepts one package name, we must iterate through the packages rather than specify them all on the command line. To avoid errors when febootstrap is run on a system with outdated packages, use ls and awk on the febootstrap package cache directory rather than using the host's outdated pacman database.
Diffstat (limited to 'src')
-rw-r--r--src/febootstrap_pacman.ml15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/febootstrap_pacman.ml b/src/febootstrap_pacman.ml
index 657f4d7..bd12f69 100644
--- a/src/febootstrap_pacman.ml
+++ b/src/febootstrap_pacman.ml
@@ -34,7 +34,7 @@ let pacman_detect () =
let pacman_resolve_dependencies_and_download names =
let cmd =
- sprintf "pactree -u %s | sort -u"
+ sprintf "(for p in %s; do pactree -u $p; done) | awk '{print $1}' | sort -u"
(String.concat " " (List.map Filename.quote names)) in
let pkgs = run_command_get_lines cmd in
@@ -83,13 +83,12 @@ let pacman_list_files ?(use_installed=false) pkg =
let pkgdir = tmpdir // pkg ^ ".d" in
mkdir pkgdir 0o755;
let cmd =
- sprintf "pacman -Q %s | awk '{print $2}'"
- pkg in
- let ver = List.hd (run_command_get_lines cmd) in
- let cmd =
- sprintf "umask 0000; fakeroot tar -xf %s-%s* -C %s"
- (Filename.quote tmpdir // pkg ) ver (Filename.quote pkgdir) in
- run_command cmd;
+ sprintf "ls -1 %s/%s-*.pkg.* | awk '/\\/%s-[^/-]*-[^/-]*-[^/-]*$/ { print $0 }'"
+ tmpdir pkg pkg in
+ let pkgfile = List.hd (run_command_get_lines cmd) in
+ let cmd = sprintf "umask 0000; fakeroot tar -xf %s -C %s"
+ (Filename.quote pkgfile) (Filename.quote pkgdir) in
+ run_command cmd;
let cmd = sprintf "cd %s && find ." pkgdir in
let lines = run_command_get_lines cmd in