{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/3888","labels_url":"https://api.github.com/repos/saltstack/salt/issues/3888/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/3888/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/3888/events","html_url":"https://github.com/saltstack/salt/issues/3888","id":11524814,"number":3888,"title":"FreeBSD pkg installs fail when using origin names","user":{"login":"geoffgarside","id":2704,"avatar_url":"https://avatars.githubusercontent.com/u/2704?v=3","gravatar_id":"","url":"https://api.github.com/users/geoffgarside","html_url":"https://github.com/geoffgarside","followers_url":"https://api.github.com/users/geoffgarside/followers","following_url":"https://api.github.com/users/geoffgarside/following{/other_user}","gists_url":"https://api.github.com/users/geoffgarside/gists{/gist_id}","starred_url":"https://api.github.com/users/geoffgarside/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoffgarside/subscriptions","organizations_url":"https://api.github.com/users/geoffgarside/orgs","repos_url":"https://api.github.com/users/geoffgarside/repos","events_url":"https://api.github.com/users/geoffgarside/events{/privacy}","received_events_url":"https://api.github.com/users/geoffgarside/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Feature","name":"Feature","color":"009800"}],"state":"closed","locked":false,"assignee":{"login":"terminalmage","id":328598,"avatar_url":"https://avatars.githubusercontent.com/u/328598?v=3","gravatar_id":"","url":"https://api.github.com/users/terminalmage","html_url":"https://github.com/terminalmage","followers_url":"https://api.github.com/users/terminalmage/followers","following_url":"https://api.github.com/users/terminalmage/following{/other_user}","gists_url":"https://api.github.com/users/terminalmage/gists{/gist_id}","starred_url":"https://api.github.com/users/terminalmage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terminalmage/subscriptions","organizations_url":"https://api.github.com/users/terminalmage/orgs","repos_url":"https://api.github.com/users/terminalmage/repos","events_url":"https://api.github.com/users/terminalmage/events{/privacy}","received_events_url":"https://api.github.com/users/terminalmage/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestones/Approved","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars.githubusercontent.com/u/507599?v=3","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":2515,"closed_issues":2542,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2015-09-03T02:54:09Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2013-02-28T23:27:52Z","updated_at":"2015-09-03T03:02:24Z","closed_at":"2015-09-03T02:54:09Z","body":"When you install a package on a FreeBSD server using an origin name, such as `sysutils/dmidecode` salt installs the package, but fails to detect it.\r\n\r\nThis is probably more of a gotcha than an issue, but using origin names is sometimes more convenient, especially for things like python ports which get \"pyXX-\" prefixed to the name where XX is the python version.\r\n\r\nHere is an example SLS pair\r\n```\r\n# top.sls\r\nbase:\r\n  '*':\r\n    - core\r\n\r\n# core.sls\r\ndmidecode:\r\n  - pkg:\r\n    - installed\r\n    - name: sysutils/dmidecode\r\n```\r\n\r\nThis is partly due to the way in which `pkg info` and `pkg_info` will list installed ports, they don't include the origin name. Using `pkg query` its possible to print the installed ports by origin name along with the version.\r\n\r\nWhen the `pkg_resource.find_changes` method is called its obviously looking for `sysutils/dmidecode` and not `dmidecode` and so fails.\r\n\r\nI've no idea how you'd want to handle this if I'm perfectly honest.\r\n\r\nSome of the relevant parts from `salt-call -l debug` shown below\r\n```\r\n[INFO    ] Executing command '/usr/sbin/pkg info' in directory '/root'\r\n[DEBUG   ] output: ca_root_nss-3.14.3             The root certificate bundle from the Mozilla Project\r\ncurl-7.24.0_2                  Non-interactive tool to get files from FTP, GOPHER, HTTP(S) servers\r\ncvsps-2.1_1                    Create patchset information from CVS\r\ndmidecode-2.11                 A tool for dumping DMI (SMBIOS) contents in human-readable format\r\nexpat-2.0.1_2                  XML 1.0 parser written in C\r\ngettext-0.18.1.1               GNU gettext package\r\ngit-1.8.1.3                    Distributed source code management tool\r\ngmp-5.1.1                      A free library for arbitrary precision arithmetic\r\nlibiconv-1.14                  A character set conversion library\r\nopenssl-1.0.1_8                SSL and crypto library\r\np5-Error-0.17019               Perl module to provide Error/exception support for perl: Error\r\np5-Net-SMTP-SSL-1.01_1         An SMTP client supporting SSL\r\nperl-5.14.2_2                  Practical Extraction and Report Language\r\npkg-1.0.8                      New generation package manager\r\npy27-Babel-0.9.6               A collection of tools for internationalizing Python applications\r\npy27-Jinja2-2.6_1              Fast and easy to use stand-alone template engine\r\npy27-MarkupSafe-0.15           Implements a XML/HTML/XHTML Markup safe string for Python\r\npy27-m2crypto-0.21.1           Crypto and SSL toolkit for Python\r\npy27-msgpack-0.2.2             MessagePack (de)serializer for Python\r\npy27-pycrypto-2.6_1            The Python Cryptography Toolkit\r\npy27-pyzmq-2.2.0               Python bindings for ZeroMQ\r\npy27-salt-0.13.1               Distributed remote execution and configuration management system\r\npy27-setuptools-0.6c11_3       Download, build, install, upgrade, and uninstall Python packages\r\npy27-yaml-3.10                 Python YAML parser\r\npython27-2.7.3_6               An interpreted object-oriented programming language\r\nswig-1.3.40                    Simplified Wrapper and Interface Generator\r\nzmq-2.2.0                      Open source message queue optimised for performance\r\n[ERROR   ] Installed Packages:\r\ndmidecode changed from absent to 2.11\r\n\r\n... snipped ...\r\n\r\n----------\r\n    State: - pkg\r\n    Name:      sysutils/dmidecode\r\n    Function:  installed\r\n        Result:    False\r\n        Comment:   The following package(s) failed to install/update: sysutils/dmidecode.\r\n        Changes:   dmidecode: {'new': '2.11', 'old': ''}\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/137310655","html_url":"https://github.com/saltstack/salt/issues/3888#issuecomment-137310655","issue_url":"https://api.github.com/repos/saltstack/salt/issues/3888","id":137310655,"user":{"login":"bertjwregeer","id":649426,"avatar_url":"https://avatars.githubusercontent.com/u/649426?v=3","gravatar_id":"","url":"https://api.github.com/users/bertjwregeer","html_url":"https://github.com/bertjwregeer","followers_url":"https://api.github.com/users/bertjwregeer/followers","following_url":"https://api.github.com/users/bertjwregeer/following{/other_user}","gists_url":"https://api.github.com/users/bertjwregeer/gists{/gist_id}","starred_url":"https://api.github.com/users/bertjwregeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bertjwregeer/subscriptions","organizations_url":"https://api.github.com/users/bertjwregeer/orgs","repos_url":"https://api.github.com/users/bertjwregeer/repos","events_url":"https://api.github.com/users/bertjwregeer/events{/privacy}","received_events_url":"https://api.github.com/users/bertjwregeer/received_events","type":"User","site_admin":false},"created_at":"2015-09-03T03:02:24Z","updated_at":"2015-09-03T03:02:24Z","body":"@terminalmage Solves a problem I had ;-)"}}