lib/specinfra/command/arch.rb in specinfra-1.27.3 vs lib/specinfra/command/arch.rb in specinfra-1.27.4

- old
+ new

@@ -5,24 +5,24 @@ "runuser -s /bin/sh -c \"test -#{access} #{file}\" #{user}" end def check_enabled(service, level) level = "multi-user.target" if level == 3 - "systemctl --plain list-dependencies #{level} | grep '^#{escape(service)}.service$'" + "systemctl --plain list-dependencies #{level} | grep '^● #{escape(service)}.service$'" end def check_running(service) "systemctl is-active #{escape(service)}.service" end def check_installed(package,version=nil) if version - "pacman -Q | grep #{escape(package)} #{escape(version)}" + grep = version.include?('-') ? "^#{escape(version)}$" : "^#{escape(version)}-" + "pacman -Q #{escape(package)} | awk '{print $2}' | grep '#{grep}'" else - "pacman -Q | grep #{escape(package)}" + "pacman -Q #{escape(package)}" end end - def sync_repos "pacman -Syy" end def install(package)