Skip to content

fix pkg.installed on freebsd#68887

Open
network-shark wants to merge 1 commit intosaltstack:3006.xfrom
network-shark:feature/fix-pkg-installed
Open

fix pkg.installed on freebsd#68887
network-shark wants to merge 1 commit intosaltstack:3006.xfrom
network-shark:feature/fix-pkg-installed

Conversation

@network-shark
Copy link
Copy Markdown
Contributor

@network-shark network-shark commented Apr 2, 2026

What does this PR do?

This PR fixes #68886

Previous Behavior

pkg.installed is was not idempotent on freebsd


root@salt:~# salt newjail2026 state.apply forgejo.init  saltenv=dev
jid: 20260402200221040413
newjail2026:
----------
          ID: install
    Function: pkg.installed
        Name: forgejo
      Result: True
     Comment: The following packages were installed/updated: forgejo=14.0.3
     Started: 22:01:36.213337
    Duration: 13513.934 ms
     Changes:
              ----------
              curl:
                  ----------
                  new:
                      8.17.0
                  old:
              forgejo:
                  ----------
                  new:
                      14.0.3
                  old:
              git:
                  ----------
                  new:
                      2.53.0
                  old:
              git-lfs:
                  ----------
                  new:
                      3.6.1_15
                  old:
              icu:
                  ----------
                  new:
                      76.1,1
                  old:
              libcroco:
                  ----------
                  new:
                      0.6.13_3
                  old:
              libnghttp2:
                  ----------
                  new:
                      1.68.0
                  old:
              libpsl:
                  ----------
                  new:
                      0.21.5_2
                  old:
              libssh2:
                  ----------
                  new:
                      1.11.1,3
                  old:
              p5-Authen-SASL:
                  ----------
                  new:
                      2.1900
                  old:
              p5-Crypt-URandom:
                  ----------
                  new:
                      0.54
                  old:
              p5-Digest-HMAC:
                  ----------
                  new:
                      1.05
                  old:
              p5-Error:
                  ----------
                  new:
                      0.17030
                  old:
              p5-IO-Socket-SSL:
                  ----------
                  new:
                      2.098
                  old:
              p5-MIME-Base32:
                  ----------
                  new:
                      1.303
                  old:
              p5-MIME-Base64:
                  ----------
                  new:
                      3.16
                  old:
              p5-Mozilla-CA:
                  ----------
                  new:
                      20250602
                  old:
              p5-Net-SSLeay:
                  ----------
                  new:
                      1.94
                  old:
              p5-URI:
                  ----------
                  new:
                      5.34
                  old:
              perl5:
                  ----------
                  new:
                      5.42.2
                  old:
              tcl86:
                  ----------
                  new:
                      8.6.17
                  old:

Second run

root@salt:~# salt newjail2026 state.apply forgejo.init  saltenv=dev
jid: 20260402200247259487
newjail2026:
----------
          ID: install
    Function: pkg.installed
        Name: forgejo
      Result: True
     Comment: The following packages were installed/updated: forgejo=14.0.3
     Started: 22:02:02.279230
    Duration: 2187.71 ms
     Changes:

Comment on lines +920 to +923
elif __grains__["os"] == "FreeBSD" and pkgver:
cver = [k for k, v in new_pkgs.items() if v["version"] == pkgver]
_ok.append(pkgname)
continue
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On first glance this does not appear like it is the correct solution. I think _fulfills_version_string should be covering this.

Copy link
Copy Markdown
Contributor Author

@network-shark network-shark Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the hint I will answer in the issue @bdrx312 . Hope to get some feedback thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants