saltstack-formulas / packages-formula

A simple 'packages manager' formula, to install/remove packages without further ado.
Apache License 2.0
11 stars 47 forks source link

pkg.installed failure on MacOS #28

Open noelmcloughlin opened 6 years ago

noelmcloughlin commented 6 years ago

Noting an error is being reported on MacOS with simple pillar data.

Pillars

packages:
  pkgs:
    wanted:
      - wget
      - curl

Failed state

          ID: pkg_req_pkgs
    Function: pkg.installed
      Result: False
     Comment: Brew command failed. Additional info follows:

              result:
                  ----------
                  pid:
                      30227
                  retcode:
                      1
                  stderr:
                      Error: No available formula with the name "tar"
                      Warning: homebrew/core is shallow clone. To get complete history run:
                        git -C "$(brew --repo homebrew/core)" fetch --unshallow

                      Error: No previously deleted formula found.
                      ==> Searching taps on GitHub...
                      Error: No formulae found in taps.
                  stdout:
                      ==> Searching for a previously deleted formula (in the last month)...
                      ==> Searching for similarly named formulae...
                      These similarly named formulae were found:
                      atari800
                      fstar
                      git-archive-all
                      gnu-tar
                      hatari
                      internetarchive
                      juju-quickstart
                      kstart
                      libtar
                      qtfaststart
                      rakudo-star
                      sagittarius-scheme
                      star
                      startup-notification
                      tarantool
                      tarsnap
                      tarsnap-gui
                      tarsnapper
                      xmlstarlet
                      To install one of them, run (for example):
                        brew install atari800
                      ==> Searching taps...
     Started: 14:57:33.937366
    Duration: 4854.738 ms
     Changes:

          ID: wanted_pkgs
    Function: pkg.installed
      Result: False
     Comment: One or more requisite failed: packages.pkgs.pkg_req_pkgs

DEBUG

Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
[ERROR   ] retcode: 1
[ERROR   ] Brew command failed. Additional info follows:

result:
    ----------
    pid:
        30227
    retcode:
        1
    stderr:
        Error: No available formula with the name "tar"
        Warning: homebrew/core is shallow clone. To get complete history run:
          git -C "$(brew --repo homebrew/core)" fetch --unshallow

        Error: No previously deleted formula found.
        ==> Searching taps on GitHub...
        Error: No formulae found in taps.
    stdout:
        ==> Searching for a previously deleted formula (in the last month)...
        ==> Searching for similarly named formulae...
        These similarly named formulae were found:
        atari800
        fstar
        git-archive-all
        gnu-tar
        hatari
        internetarchive
        juju-quickstart
        kstart
        libtar
        qtfaststart
        rakudo-star
        sagittarius-scheme
        star
        startup-notification
        tarantool
        tarsnap
        tarsnap-gui
        tarsnapper
        xmlstarlet
        To install one of them, run (for example):
          brew install atari800
        ==> Searching taps...
[INFO    ] Completed state [pkg_req_pkgs] at time 14:57:38.792104 (duration_in_ms=4854.738)

This error is not observed during a standard execution of brew install.

$ brew install wget
Updating Homebrew...
Warning: wget 1.19.5 is already installed and up-to-date
To reinstall 1.19.5, run `brew reinstall wget`
javierbertoli commented 6 years ago

@noelmcloughlin 'tar' was introduced as a required package here, which is then included by init.sls. I have no MacOS around to try, perhaps the package/formula name is different in it?

noelmcloughlin commented 6 years ago

@javierbertoli Thanks for checking, I remember that code now. Let me think about a solution for MacOs, probably Jinja conditional or osfamilymap.