Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pacman: recognize if a target package is provided by another package #34574

Closed
wants to merge 2 commits into from

Conversation

strangeglyph
Copy link

SUMMARY

Packages that are provided by a different package (example: 'cron' is provided by 'cronie') are not recognized by the pacman module and always assumed uninstalled. In particular, this leads to crashes when trying to install the package because pacman output is not in the expected format.

If querying package information for the target package fails, we look through all installed packages and try to find one that provides the target instead, then proceed with this package's name and version.

Fixes #24110

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

pacman

ANSIBLE VERSION
ansible 2.5.0 (devel 29b781f46e) last updated 2018/01/08 15:20:39 (GMT +200)
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/boreeas/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/boreeas/Projects/Python/ansible/lib/ansible
  executable location = ../Python/ansible/bin/ansible
  python version = 2.7.14 (default, Sep 20 2017, 01:25:59) [GCC 7.2.0]

@ansibot
Copy link
Contributor

ansibot commented Jan 8, 2018

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 bugfix_pull_request community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. labels Jan 8, 2018
@ansibot
Copy link
Contributor

ansibot commented Jan 8, 2018

The test ansible-test sanity --test pep8 [?] failed with the following error:

lib/ansible/modules/packaging/os/pacman.py:140:1: E302 expected 2 blank lines, found 1

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Jan 8, 2018
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Jan 8, 2018
@strangeglyph
Copy link
Author

bot_status

@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Jan 11, 2018
@ansibot
Copy link
Contributor

ansibot commented Jan 11, 2018

Components

lib/ansible/modules/packaging/os/pacman.py
support: community
maintainers: indrajitr

Metadata

waiting_on: maintainer
changes_requested_by: null
needs_info: False
needs_revision: False
needs_rebase: False
merge_commits: []
mergeable_state: clean
shippable_status: success
maintainer_shipits (module maintainers): 0
community_shipits (namespace maintainers): 0
ansible_shipits (core team members): 0
shipit_actors (maintainer or core team member): []
shipit_actors_other: []

click here for bot help

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jan 11, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jan 19, 2018
@ansibot ansibot added the new_contributor This PR is the first contribution by a new community member. label Jan 27, 2018
@strangeglyph
Copy link
Author

Hi @indrajitr, what's the state here? Do you need further information from me?

@resmo
Copy link
Contributor

resmo commented Feb 8, 2018

@thomwiggers could you verify if this fixes the issue you reported. Thanks.

@thomwiggers
Copy link
Contributor

@resmo Only if it's already installed.

 (e) ansible  ~  git  ansible  pacman -Qi subversion                                                                                                                                                                2   Boreeas-devel 
error: package 'subversion' was not found
 (e) ansible  ~  git  ansible  pacman -Qi svn                                                                                                                                                                       1   Boreeas-devel 
error: package 'svn' was not found
 (e) ansible  ~  git  ansible  cat /tmp/playbook.                                                                                                                                                                   1   Boreeas-devel 
cat: /tmp/playbook.: No such file or directory
 (e) ansible  ~  git  ansible  cat /tmp/playbook.yml                                                                                                                                                                1   Boreeas-devel 
- name: Deploy common configuration
  hosts: localhost
  become: true
  tasks:
    - name: Test
      pacman:
          name: svn
          state: present
 (e) ansible  ~  git  ansible  ansible-playbook -vvvv -K /tmp/playbook.yml                                                                                                                                               Boreeas-devel 
ansible-playbook 2.5.0 (Boreeas-devel fa90566200) last updated 2018/02/09 12:39:48 (GMT +200)
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/thom/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/thom/git/ansible/lib/ansible
  executable location = /home/thom/.pythonenvs/ansible/bin/ansible-playbook
  python version = 3.6.4 (default, Jan  5 2018, 02:35:40) [GCC 7.2.1 20171224]
Using /etc/ansible/ansible.cfg as config file
BECOME password: 
setting up inventory plugins
Parsed /etc/ansible/hosts inventory source with ini plugin
Loading callback plugin default of type stdout, v2.0 from /home/thom/git/ansible/lib/ansible/plugins/callback/default.py
 ________________________ 
< PLAYBOOK: playbook.yml >
 ------------------------ 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

1 plays in /tmp/playbook.yml
 ____________________________________ 
< PLAY [Deploy common configuration] >
 ------------------------------------ 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

 ________________________ 
< TASK [Gathering Facts] >
 ------------------------ 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

task path: /tmp/playbook.yml:1
Using module file /home/thom/git/ansible/lib/ansible/modules/system/setup.py
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: thom
<127.0.0.1> EXEC /bin/sh -c 'echo ~ && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/thom/.ansible/tmp/ansible-tmp-1518176534.9017236-74569779088094 `" && echo ansible-tmp-1518176534.9017236-74569779088094="` echo /home/thom/.ansible/tmp/ansible-tmp-1518176534.9017236-74569779088094 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpkeu675q0 TO /home/thom/.ansible/tmp/ansible-tmp-1518176534.9017236-74569779088094/setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/thom/.ansible/tmp/ansible-tmp-1518176534.9017236-74569779088094/ /home/thom/.ansible/tmp/ansible-tmp-1518176534.9017236-74569779088094/setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S  -p "[sudo via ansible, key=dgozgflxpviisfyepyryfyloxvxpgxor] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-dgozgflxpviisfyepyryfyloxvxpgxor; /home/thom/.pythonenvs/ansible/bin/python3 /home/thom/.ansible/tmp/ansible-tmp-1518176534.9017236-74569779088094/setup.py; rm -rf "/home/thom/.ansible/tmp/ansible-tmp-1518176534.9017236-74569779088094/" > /dev/null 2>&1'"'"' && sleep 0'
ok: [localhost]
META: ran handlers
 _____________ 
< TASK [Test] >
 ------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

task path: /tmp/playbook.yml:5
Using module file /home/thom/git/ansible/lib/ansible/modules/packaging/os/pacman.py
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: thom
<127.0.0.1> EXEC /bin/sh -c 'echo ~ && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/thom/.ansible/tmp/ansible-tmp-1518176535.51989-75415092331778 `" && echo ansible-tmp-1518176535.51989-75415092331778="` echo /home/thom/.ansible/tmp/ansible-tmp-1518176535.51989-75415092331778 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmp_yw7ubbg TO /home/thom/.ansible/tmp/ansible-tmp-1518176535.51989-75415092331778/pacman.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/thom/.ansible/tmp/ansible-tmp-1518176535.51989-75415092331778/ /home/thom/.ansible/tmp/ansible-tmp-1518176535.51989-75415092331778/pacman.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S  -p "[sudo via ansible, key=rgqxktertzjmdthmtcqihzimplodvhri] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-rgqxktertzjmdthmtcqihzimplodvhri; /home/thom/.pythonenvs/ansible/bin/python3 /home/thom/.ansible/tmp/ansible-tmp-1518176535.51989-75415092331778/pacman.py; rm -rf "/home/thom/.ansible/tmp/ansible-tmp-1518176535.51989-75415092331778/" > /dev/null 2>&1'"'"' && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible__sqwx8dl/ansible_module_pacman.py", line 475, in <module>
    main()
  File "/tmp/ansible__sqwx8dl/ansible_module_pacman.py", line 469, in main
    install_packages(module, pacman_path, p['state'], pkgs, pkg_files)
  File "/tmp/ansible__sqwx8dl/ansible_module_pacman.py", line 310, in install_packages
    installed, updated, latestError = query_package(module, pacman_path, package)
  File "/tmp/ansible__sqwx8dl/ansible_module_pacman.py", line 183, in query_package
    realname, lversion = find_provider(lstdout, name)
  File "/tmp/ansible__sqwx8dl/ansible_module_pacman.py", line 161, in find_provider
    if pkg_name == target_package or target_package in pkg_provides:
TypeError: argument of type 'NoneType' is not iterable

fatal: [localhost]: FAILED! => {
    "attempts": 1,
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible__sqwx8dl/ansible_module_pacman.py\", line 475, in <module>\n    main()\n  File \"/tmp/ansible__sqwx8dl/ansible_module_pacman.py\", line 469, in main\n    install_packages(module, pacman_path, p['state'], pkgs, pkg_files)\n  File \"/tmp/ansible__sqwx8dl/ansible_module_pacman.py\", line 310, in install_packages\n    installed, updated, latestError = query_package(module, pacman_path, package)\n  File \"/tmp/ansible__sqwx8dl/ansible_module_pacman.py\", line 183, in query_package\n    realname, lversion = find_provider(lstdout, name)\n  File \"/tmp/ansible__sqwx8dl/ansible_module_pacman.py\", line 161, in find_provider\n    if pkg_name == target_package or target_package in pkg_provides:\nTypeError: argument of type 'NoneType' is not iterable\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE",
    "rc": 0
}
	to retry, use: --limit @/tmp/playbook.retry
 ____________ 
< PLAY RECAP >
 ------------ 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

localhost                  : ok=1    changed=0    unreachable=0    failed=1  

@strangeglyph
Copy link
Author

Thanks, I missed that. New change should fix this (tested with svn uninstalled / svn installed / trying to install a non-existent package)

@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Feb 9, 2018
@ansibot
Copy link
Contributor

ansibot commented Feb 9, 2018

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/modules/packaging/os/pacman.py:164:24: ansible-format-automatic-specification Format string contains automatic field numbering specification

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Feb 9, 2018
@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Feb 9, 2018
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Feb 9, 2018
@thomwiggers
Copy link
Contributor

thomwiggers commented Feb 10, 2018

Removing the package doesn't work yet:

ansible-playbook 2.5.0 (Boreeas-devel 5cef8474fb) last updated 2018/02/10 12:40:06 (GMT +200)
  config file = /home/thom/.ansible.cfg
  configured module search path = ['/home/thom/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/thom/git/ansible/lib/ansible
  executable location = /home/thom/.pythonenvs/ansible/bin/ansible-playbook
  python version = 3.6.4 (default, Jan  5 2018, 02:35:40) [GCC 7.2.1 20171224]
Using /home/thom/.ansible.cfg as config file
[...]
TASK [Test] *********************************************************************************************************
task path: /home/thom/git/ansible/test.yml:5
Using module file /home/thom/git/ansible/lib/ansible/modules/packaging/os/pacman.py
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: thom
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1518262965.6788666-203920860699125 `" && echo ansible-tmp-1518262965.6788666-203920860699125="` echo $HOME/.ansible/tmp/ansible-tmp-1518262965.6788666-203920860699125 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpv6a1jhmn TO /home/thom/.ansible/tmp/ansible-tmp-1518262965.6788666-203920860699125/pacman.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/thom/.ansible/tmp/ansible-tmp-1518262965.6788666-203920860699125/ /home/thom/.ansible/tmp/ansible-tmp-1518262965.6788666-203920860699125/pacman.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S  -p "[sudo via ansible, key=mrynkuyoccyyxwhimcyxmrxlaotcaozo] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-mrynkuyoccyyxwhimcyxmrxlaotcaozo; /home/thom/.pythonenvs/ansible/bin/python /home/thom/.ansible/tmp/ansible-tmp-1518262965.6788666-203920860699125/pacman.py; rm -rf "/home/thom/.ansible/tmp/ansible-tmp-1518262965.6788666-203920860699125/" > /dev/null 2>&1'"'"' && sleep 0'
fatal: [localhost]: FAILED! => {
    "attempts": 1,
    "changed": false,
    "invocation": {
        "module_args": {
            "force": false,
            "name": [
                "svn"
            ],
            "recurse": false,
            "state": "absent",
            "update_cache": false,
            "upgrade": false
        }
    },
    "msg": "failed to remove svn"
}
	

@strangeglyph
Copy link
Author

Alright. Think I checked all relevant combinations of options now. Current test playbook:

- name: Test pacman module changes
  hosts: localhost
  become: true
  tasks:
    - name: prepare
      pacman:
          name: subversion
          state: absent

    - name: name=real state=absent action=remove
      pacman:
          name: subversion
          state: absent

    - name: name=real state=absent action=install
      pacman:
          name: subversion
          state: present

    - name: name=real state=present action=install
      pacman:
          name: subversion
          state: present

    - name: name=real state=present action=latest
      pacman:
          name: subversion
          state: latest

    - name: name=real state=present action=remove
      pacman:
          name: subversion
          state: absent

    - name: name=short state=absent action=remove
      pacman:
           name: svn
           state: absent

    - name: name=short state=absent action=install
      pacman:
           name: svn
           state: present

    - name: name=short state=present action=install
      pacman:
           name: svn
           state: present

    - name: name=short state=present action=latest
      pacman:
           name: svn
           state: latest

    - name: name=short state=present action=remove
      pacman:
           name: svn
           state: absent

    - name: name=bad state=absent action=remove
      pacman:
           name: not-a-real-package
           state: absent
      ignore_errors: yes

    - name: name=bad state=absent action=install
      pacman:
           name: not-a-real-package
           state: present
      ignore_errors: yes

    - name: name=bad state=absent action=latest
      pacman:
           name: not-a-real-package
           state: present
      ignore_errors: yes

@thomwiggers
Copy link
Contributor

Appears to work for me.

Copy link
Contributor

@thomwiggers thomwiggers left a comment

Choose a reason for hiding this comment

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

LGTM

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Feb 19, 2018
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bugfix_pull_request labels Mar 2, 2018
@ansibot
Copy link
Contributor

ansibot commented Nov 18, 2018

@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Nov 18, 2018
@@ -138,21 +138,62 @@ def get_version(pacman_output):
return None


def find_provider(module, pacman_path, target_package):
"""Find the package providing `target_package`"""
cmd = "%s -Q %s" % (pacman_path, target_package)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cmd = "%s -Q %s" % (pacman_path, target_package)
cmd = "%s --query %s" % (pacman_path, target_package)

I personally prefer if we use the long options.

if rc == 0:
realname = output.split()[0]
version = output.split()[1]
return (realname, version)
Copy link
Contributor

Choose a reason for hiding this comment

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

# (realname, version)
return tuple(output.split())

no need for named variables

return (realname, version)

# Unable to find package named `target_package` - scan full package dump
cmd = "%s -Qqei" % pacman_path
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cmd = "%s -Qqei" % pacman_path
cmd = "%s --query --quiet --explicit --info" % pacman_path

# some unknown error
return (None, None)

target_package = target_package.lower()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
target_package = target_package.lower()

I don't think you should do this, case is meaningful:

max@mde-oxalide % pacman -Q libreoffice-en-US
libreoffice-fresh 6.1.3-1
max@mde-oxalide % pacman -Q libreoffice-en-us
error: package 'libreoffice-en-us' was not found

return (realname, version)

# Unable to find package named `target_package` - scan full package dump
cmd = "%s -Qqei" % pacman_path
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure this is necessary ? Can you provide an example when 'pacman -Q …' isn't sufficient ?


for line in lines:
if line.startswith("Name"):
pkg_name = line.split(':', 1)[1].strip().lower()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pkg_name = line.split(':', 1)[1].strip().lower()
pkg_name = line.partition(':')[-1].strip()

idem, no need to lower.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you're going to do partition, I'd rather use the fact that it'll always return a 3-tuple instead of using -1 to index the third element. i.e.:

line.partition(':')[2]

Copy link
Contributor

Choose a reason for hiding this comment

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

@thomwiggers line.partition(':')[2] yes, I have no problem with that.

if line.startswith("Provides"):
pkg_provides = [x.strip().lower() for x in line.split(':', 1)[1].strip().split()]
if line.startswith("Version"):
pkg_version = line.split(':', 1)[1].strip()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pkg_version = line.split(':', 1)[1].strip()
pkg_version = line.partition(':')[-1].strip()

if line.startswith("Version"):
pkg_version = line.split(':', 1)[1].strip()

if pkg_name == target_package or target_package in pkg_provides:
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't work if pkg_provides contain a version:

max@mde-oxalide % pacman -Qqei perl | grep Provide
Provides        : perl-archive-tar=2.30  perl-attribute-handlers=1.01  perl-autodie=2.29  perl-autoloader=5.74  perl-autouse=1.11  perl-b-debug=1.26  perl-base=2.27  perl-bignum=0.49  perl-carp=1.50  perl-compress-raw-bzip2=2.074  perl-compress-raw-zlib=2.076  perl-config-perl-v=0.29  perl-constant=1.33  perl-cpan-meta-requirements=2.140  perl-cpan-meta-yaml=0.018  perl-cpan-meta=2.150010  perl-cpan=2.20  perl-data-dumper=2.170  perl-db_file=1.840  perl-devel-ppport=3.40  perl-devel-selfstubber=1.06  perl-digest-md5=2.55  perl-digest-sha=6.01  perl-digest=1.17_01  perl-dumpvalue=1.18  perl-encode=2.97  perl-encoding-warnings=0.13  perl-env=1.04  perl-experimental=0.019  perl-exporter=5.73  perl-extutils-cbuilder=0.280230  perl-extutils-constant=0.25  perl-extutils-install=2.14  perl-extutils-makemaker=7.34  perl-extutils-manifest=1.70  perl-extutils-parsexs=3.39  perl-file-fetch=0.56  perl-file-path=2.15  perl-file-temp=0.2304  perl-filter-simple=0.95  perl-filter-util-call=1.58  perl-getopt-long=2.5  perl-http-tiny=0.070  perl-i18n-collate=1.02  perl-i18n-langtags=0.43  perl-if=0.0608  perl-io-compress=2.074  perl-io-socket-ip=0.39  perl-io-zlib=1.10  perl-io=1.39  perl-ipc-cmd=1.00  perl-ipc-sysv=2.07  perl-json-pp=2.97001  perl-lib=0.64  perl-libnet=3.11  perl-locale-codes=3.56  perl-locale-maketext-simple=0.21_01  perl-locale-maketext=1.29  perl-math-bigint-fastcalc=0.5006  perl-math-bigint=1.999811  perl-math-bigrat=0.2613  perl-math-complex=1.5901  perl-memoize=1.03_01  perl-mime-base64=3.15  perl-module-corelist=5.20180622  perl-module-load-conditional=0.68  perl-module-load=0.32  perl-module-loaded=0.08  perl-module-metadata=1.000033  perl-net-ping=2.62  perl-params-check=0.38  perl-parent=0.236  perl-pathtools=3.74  perl-perl-ostype=1.010  perl-perlfaq=5.021011  perl-perlio-via-quotedprint=0.08  perl-pod-checker=1.73  perl-pod-escapes=1.07  perl-pod-parser=1.63  perl-pod-perldoc=3.2801  perl-pod-simple=3.35  perl-pod-usage=1.69  perl-podlators=5.006  perl-safe=2.40  perl-scalar-list-utils=1.50  perl-search-dict=1.07  perl-selfloader=1.25  perl-socket=2.027  perl-storable=3.08  perl-sys-syslog=0.35  perl-term-ansicolor=4.06  perl-term-cap=1.17  perl-term-complete=1.403  perl-term-readline=1.17  perl-test-harness=3.42  perl-test-simple=1.302133  perl-test=1.31  perl-text-abbrev=1.02  perl-text-balanced=2.03  perl-text-parsewords=3.30  perl-text-tabs=2013.0523  perl-thread-queue=3.12  perl-thread-semaphore=2.13  perl-threads-shared=1.58  perl-threads=2.22  perl-tie-file=1.02  perl-tie-refhash=1.39  perl-time-hires=1.9759  perl-time-local=1.25  perl-time-piece=1.3204  perl-unicode-collate=1.25  perl-unicode-normalize=1.26  perl-version=0.9923  perl-xsloader=0.30

pkg_version = line.split(':', 1)[1].strip()

if pkg_name == target_package or target_package in pkg_provides:
if not pkg_version:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible ?
For me it would mean that it exist a package without version.

lversion = get_version(lstdout)

rcmd = "%s -Si %s" % (pacman_path, name)
rcmd = "%s -Si %s" % (pacman_path, realname)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
rcmd = "%s -Si %s" % (pacman_path, realname)
rcmd = "%s --sync --info %s" % (pacman_path, realname)

@ansibot
Copy link
Contributor

ansibot commented Nov 26, 2018

@ansibot ansibot added the packaging Packaging category label Feb 17, 2019
@ansibot ansibot added collection Related to Ansible Collections work collection:community.general needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md labels Apr 29, 2020
@ansibot
Copy link
Contributor

ansibot commented Aug 16, 2020

Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.

For further information, please see:
https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md

@ansibot ansibot closed this Aug 16, 2020
@ansible ansible locked and limited conversation to collaborators Sep 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bot_closed bug This issue/PR relates to a bug. collection:community.general collection Related to Ansible Collections work has_issue module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_contributor This PR is the first contribution by a new community member. packaging Packaging category stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pacman doesn't support package name aliases
6 participants