summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-08-10 20:26:51 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-08-10 20:30:05 +0100
commit0d57e883e1fc6a0ca7bf435ddbe0b0f9b4380295 (patch)
tree2d58d15f126e44490e601e959fcb31fa7a5e982b
parentd54a59cf7f951e57ecd641a977a60310c34fe834 (diff)
downloadfebootstrap-0d57e883e1fc6a0ca7bf435ddbe0b0f9b4380295.zip
febootstrap-0d57e883e1fc6a0ca7bf435ddbe0b0f9b4380295.tar.gz
febootstrap-0d57e883e1fc6a0ca7bf435ddbe0b0f9b4380295.tar.xz
Download archives with permissive umask (thanks David Konerding).
https://www.redhat.com/archives/libguestfs/2011-August/msg00025.html
-rw-r--r--febootstrap_debian.ml4
-rw-r--r--febootstrap_pacman.ml6
-rw-r--r--febootstrap_yum_rpm.ml2
3 files changed, 6 insertions, 6 deletions
diff --git a/febootstrap_debian.ml b/febootstrap_debian.ml
index f0d0be5..4aa7389 100644
--- a/febootstrap_debian.ml
+++ b/febootstrap_debian.ml
@@ -47,7 +47,7 @@ let debian_resolve_dependencies_and_download names =
(* Download the packages. *)
let cmd =
- sprintf "cd %s && aptitude download %s"
+ sprintf "umask 0000; cd %s && aptitude download %s"
(Filename.quote tmpdir)
(String.concat " " (List.map Filename.quote pkgs)) in
run_command cmd;
@@ -85,7 +85,7 @@ let debian_list_files pkg =
let pkgdir = tmpdir // pkg ^ ".d" in
mkdir pkgdir 0o755;
let cmd =
- sprintf "dpkg-deb --fsys-tarfile %s | (cd %s && tar xf -)"
+ sprintf "umask 0000; dpkg-deb --fsys-tarfile %s | (cd %s && tar xf -)"
(tmpdir // pkg) pkgdir in
run_command cmd;
diff --git a/febootstrap_pacman.ml b/febootstrap_pacman.ml
index 9148988..6691ebe 100644
--- a/febootstrap_pacman.ml
+++ b/febootstrap_pacman.ml
@@ -51,13 +51,13 @@ let pacman_resolve_dependencies_and_download names =
List.iter (
fun pkg ->
let cmd =
- sprintf "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 -Syw --noconfirm --cachedir=$(pwd) --root=$(pwd) %s"
(Filename.quote tmpdir)
pkg in
if Sys.command cmd <> 0 then (
(* The package is not in the main repos, check the aur *)
let cmd =
- sprintf "cd %s && wget http://aur.archlinux.org/packages/%s/%s.tar.gz && tar xf %s.tar.gz && cd %s && makepkg && mv %s-*.pkg.tar.xz %s"
+ sprintf "umask 0000; cd %s && wget http://aur.archlinux.org/packages/%s/%s.tar.gz && tar xf %s.tar.gz && cd %s && makepkg && mv %s-*.pkg.tar.xz %s"
(Filename.quote tmpdir)
pkg
pkg
@@ -84,7 +84,7 @@ let pacman_list_files pkg =
pkg in
let ver = List.hd (run_command_get_lines cmd) in
let cmd =
- sprintf "fakeroot tar -xf %s-%s* -C %s"
+ sprintf "umask 0000; fakeroot tar -xf %s-%s* -C %s"
(Filename.quote tmpdir // pkg ) ver (Filename.quote pkgdir) in
run_command cmd;
diff --git a/febootstrap_yum_rpm.ml b/febootstrap_yum_rpm.ml
index f6644b8..ca74f4a 100644
--- a/febootstrap_yum_rpm.ml
+++ b/febootstrap_yum_rpm.ml
@@ -221,7 +221,7 @@ let yum_rpm_get_file_from_package pkg file =
let outfile = tmpdir // file in
let cmd =
- sprintf "rpm2cpio %s | (cd %s && cpio --quiet -id .%s)"
+ sprintf "umask 0000; rpm2cpio %s | (cd %s && cpio --quiet -id .%s)"
(Filename.quote pkg) (Filename.quote tmpdir) (Filename.quote file) in
run_command cmd;
outfile