Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replaced unnecessary negative rule in htoad_pkg with a guard

  • Loading branch information...
commit 8fa1d0141d853332c9188217763c969deeb6203c 1 parent a7f752d
Yurii Rashkovskii authored
Showing with 3 additions and 5 deletions.
  1. +3 −5 apps/htoad/src/htoad_pkg.erl
View
8 apps/htoad/src/htoad_pkg.erl
@@ -7,15 +7,13 @@
-rules([init, init_linux, ensure_package,
package_not_present, package_present]).
--neg_rule({init, [{operating_system_name, linux}]}).
-
-init(Engine, #init{}, {operating_system_name, OsName}) when not {rule, [{operating_system_name, linux}]}->
+init(Engine, #init{}, {operating_system_name, OsName}) when OsName =/= linux ->
PkgManager = pick_pkg_manager(OsName),
lager:debug("Initialized htoad_pkg (package manager: ~w)", [PkgManager]),
htoad:assert(Engine, {package_manager, PkgManager}).
-init_linux(Engine, #init{}, {operating_system_name, OsName},{linux_distribution, Linux}) ->
- PkgManager = pick_pkg_manager({OsName, Linux}),
+init_linux(Engine, #init{}, {operating_system_name, linux},{linux_distribution, Linux}) ->
+ PkgManager = pick_pkg_manager({linux, Linux}),
lager:debug("Initialized htoad_pkg (package manager: ~w)", [PkgManager]),
htoad:assert(Engine, {package_manager, PkgManager}).
Please sign in to comment.
Something went wrong with that request. Please try again.