Permalink
Browse files

When APT is selected, update its repositories to ensure up-to-date lo…

…cations
  • Loading branch information...
Yurii Rashkovskii
Yurii Rashkovskii committed Apr 24, 2012
1 parent 02ca254 commit c1bf23bf40b5cd63930f0c4da7ee83a1bf343bb1
Showing with 6 additions and 2 deletions.
  1. +6 −2 apps/htoad/src/htoad_pkg_apt.erl
@@ -11,8 +11,12 @@ init(Engine, #init{}, {operating_system_name, linux}, {linux_distribution, "Debi
initialize(Engine).
initialize(Engine) ->
- lager:debug("APT has been selected as a package manager"),
- htoad:assert(Engine, {package_manager, apt}).
+ lager:debug("APT has been selected as a package manager"),
+ lager:info("Updating apt repositories"),
+ Command = #shell{ cmd = "apt-get -y update", run_as = superuser },
+ htoad:assert(Engine,
+ [Command,
+ htoad_utils:on({exit_status, Command, 0}, {package_manager, apt})]).
-define(APT_SHELL_CHECK(Package),
case Package of

0 comments on commit c1bf23b

Please sign in to comment.