Skip to content

Commit

Permalink
Merge branch 'master' into epel-release-special-case
Browse files Browse the repository at this point in the history
  • Loading branch information
AltGr authored Oct 17, 2017
2 parents 2930031 + ef20ca3 commit 56556ff
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.t
script: bash ./.travis-docker.sh
env:
global:
- PACKAGE="depextx"
- PACKAGE="depext"
- PRE_INSTALL_HOOK
- POST_INSTALL_HOOK="opam depext --version && opam depext -ui ssl && opam depext -ui -j 2 -y -v pcre"
matrix:
- DISTRO=debian-stable OCAML_VERSION=4.00.1
- DISTRO=debian-testing OCAML_VERSION=4.01.0
- DISTRO=debian-unstable OCAML_VERSION=4.02.3
- DISTRO=ubuntu-12.04 OCAML_VERSION=4.02.3
- DISTRO=ubuntu-16.04 OCAML_VERSION=4.03.0
- DISTRO=ubuntu-17.04 OCAML_VERSION=4.03.0
- DISTRO=centos-6 OCAML_VERSION=4.01.0
- DISTRO=centos-7 OCAML_VERSION=4.04.0
- DISTRO=fedora-24 OCAML_VERSION=4.04.0
- DISTRO=centos-7 OCAML_VERSION=4.04.2
- DISTRO=fedora-25 OCAML_VERSION=4.04.2
- DISTRO=alpine OCAML_VERSION=4.05.0
- DISTRO=opensuse-42.2 OCAML_VERSION=4.04.0
- DISTRO=opensuse-42.2 OCAML_VERSION=4.04.2
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.0.6 (2017-07-24):
* Really fix Zypper non-interactive installation by passing
parameters in the right order (#68 by @jpdeplaix).

1.0.5 (2017-07-20):
* Pass `--non-interactive` to zypper on OpenSUSE (#67 #62 by
@yallop and @jpdeplaix)
Expand Down
30 changes: 16 additions & 14 deletions depext.ml
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ let update ~su ~interactive os distribution =
let cmd = update_command distribution in
match sudo_run_command ~su ~interactive os distribution cmd with
| Unix.WEXITED 0 ->
Printf.printf "# OS package update successful\n%!"
Printf.eprintf "# OS package update successful\n%!"
| _ -> fatal_error "OS package update failed"

let install ~su ~interactive os distribution = function
Expand All @@ -388,7 +388,7 @@ let install ~su ~interactive os distribution = function
is_success (sudo_run_command ~su ~interactive os distribution cmd))
true cmds
in
if ok then Printf.printf "# OS packages installation successful\n%!"
if ok then Printf.eprintf "# OS packages installation successful\n%!"
else fatal_error "OS package installation failed"

let run_source_scripts = function
Expand All @@ -408,7 +408,7 @@ let run_source_scripts = function
| Unix.WEXITED 0 -> ()
| _ -> fatal_error "Command %S failed" cmd)
commands;
Printf.printf "Source installation scripts run successfully\n%!"
Printf.eprintf "Source installation scripts run successfully\n%!"


(* Command-line handling *)
Expand All @@ -423,29 +423,31 @@ let main print_flags list short no_sources
let flags = archflags arch @ osflags os @ distrflags distribution in
if print_flags then
(if short then List.iter print_endline flags else
Printf.printf "# Depexts flags detected on this system: %s\n"
Printf.eprintf "# Depexts flags detected on this system: %s\n"
(String.concat " " flags);
exit 0);
if not short then
Printf.printf "# Detecting depexts using flags: %s\n%!"
Printf.eprintf "# Detecting depexts using flags: %s\n%!"
(String.concat " " flags);
let os_packages = depexts flags opam_packages in
if os_packages <> [] && not short then
Printf.printf "# The following system packages are needed:\n# - %s\n%!"
(String.concat "\n# - " os_packages)
begin
prerr_endline "# The following system packages are needed:";
Printf.printf "%s\n%!" (String.concat "\n" os_packages)
end
else if list && not short then
print_endline "# No required system packages found";
prerr_endline "# No required system packages found";
if list then exit 0;
let source_urls =
if no_sources then [] else
List.filter (fun s -> not (List.mem s os_packages))
(depexts (sourceflags @ flags) opam_packages)
in
if source_urls <> [] && not short then
Printf.printf "# The following scripts need to be run:\n# - %s\n%!"
Printf.eprintf "# The following scripts need to be run:\n# - %s\n%!"
(String.concat "\n# - " source_urls);
if os_packages = [] && source_urls = [] && not short then
Printf.printf "# No extra OS packages requirements found.\n%!";
Printf.eprintf "# No extra OS packages requirements found.\n%!";
let installed = get_installed_packages distribution os_packages in
let os_packages =
List.filter (fun p -> not (List.mem p installed)) os_packages
Expand All @@ -455,11 +457,11 @@ let main print_flags list short no_sources
List.iter print_endline source_urls)
else if installed <> [] then
if os_packages <> [] then
Printf.printf
Printf.eprintf
"# The following new OS packages need to be installed: %s\n%!"
(String.concat " " os_packages)
else
Printf.printf
Printf.eprintf
"# All required OS packages found.\n%!";
if dryrun_arg then exit (if os_packages = [] then 0 else 1);
let su = su_arg || not (has_command "sudo") in
Expand All @@ -473,7 +475,7 @@ let main print_flags list short no_sources
run_source_scripts source_urls;
let opam_cmdline = "opam"::"install":: opam_args @ opam_packages in
if install_arg && opam_packages <> [] then begin
(if not short then Printf.printf "# Now letting OPAM install the packages\n%!");
(if not short then Printf.eprintf "# Now letting OPAM install the packages\n%!");
(if !debug then Printf.eprintf "+ %s\n%!" (String.concat " " opam_cmdline));
Unix.execvp "opam" (Array.of_list opam_cmdline)
end
Expand Down Expand Up @@ -590,7 +592,7 @@ let command =
no_sources_arg $ debug_arg $ install_arg $ update_arg $ dryrun_arg $
su_arg $ interactive_arg $ opam_args $
packages_arg),
Term.info "opam-depext" ~version:"1.0.5+dev" ~doc ~man
Term.info "opam-depext" ~version:"1.0.6" ~doc ~man

let () =
Sys.catch_break true;
Expand Down

0 comments on commit 56556ff

Please sign in to comment.