(* 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;
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;
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
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;
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