Skip to content

Fix dev package os dependencies #221

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

Merged
merged 1 commit into from
Jun 18, 2018

Conversation

noelmcloughlin
Copy link
Contributor

This PR resolves #195. Tested on Centos7

A separate pkg.installed state is needed because fromrepo does not apply to this state.

 ID: install-postgres-dev-osdependencies
    Function: pkg.installed
      Result: True
     Comment: All specified packages are already installed
     Started: 16:25:56.087576
    Duration: 1405.037 ms
     Changes:   
----------
          ID: install-postgres-dev-package
    Function: pkg.installed
        Name: postgresql95-devel
      Result: True
     Comment: All specified packages are already installed
     Started: 16:25:57.493600
    Duration: 36.49 ms
     Changes:   
----------
          ID: install-postgres-libpq-dev
    Function: pkg.installed
        Name: libpqxx-devel
      Result: True
     Comment: All specified packages are already installed
     Started: 16:25:57.530417
    Duration: 36.693 ms
     Changes:   
----------
          ID: postgresql-ecg-altinstall
    Function: alternatives.install
        Name: ecg
      Result: True
     Comment: onlyif condition is false
     Started: 16:25:57.568191
    Duration: 1078.137 ms
     Changes:   

@noelmcloughlin noelmcloughlin changed the title Handle postgres dev package dependencies Fix dev package os dependencies Jun 11, 2018
@noelmcloughlin noelmcloughlin force-pushed the devpkg branch 3 times, most recently from 1e78a4e to ddafa8c Compare June 15, 2018 13:22
Copy link
Contributor

@vutny vutny left a comment

Choose a reason for hiding this comment

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

It would be better to set pkg_dev_deps setting specifically fo RedHat OS family, wouldn't it? And leave the parameter as empty list for all other platforms.

That way we could omit so deep level of if statements.

postgres/dev.sls Outdated
@@ -3,12 +3,22 @@
{% if grains.os not in ('Windows', 'MacOS',) %}

{% if postgres.pkg_dev %}

{% if grains.os_family == 'RedHat' and postgres.version|int >= 10 %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is that really applicable for PG 10 only? I haven't looked for it myself, so just wondering.

postgres/dev.sls Outdated
@@ -3,12 +3,22 @@
{% if grains.os not in ('Windows', 'MacOS',) %}

{% if postgres.pkg_dev %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, by properly setting the scope of pkg_libpq_dev for certain operating systems, we could avoid other checks within the state.

@noelmcloughlin noelmcloughlin force-pushed the devpkg branch 5 times, most recently from 7ce3707 to b8f6ffa Compare June 16, 2018 16:55
@noelmcloughlin
Copy link
Contributor Author

I've tidied up the jinja2 in dev.sls and included in osfamilymap.yaml. tested on Fedora 27. This change is probably fine for any PG version so I removed the version 10 check. thanks @vutny

Copy link
Contributor

@vutny vutny left a comment

Choose a reason for hiding this comment

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

Thank you @noelmcloughlin , this is much better!

@aboe76
Copy link
Contributor

aboe76 commented Jun 18, 2018

@vutny and @noelmcloughlin can we merge

@vutny
Copy link
Contributor

vutny commented Jun 18, 2018

@aboe76 Yes, go for it!

@aboe76 aboe76 merged commit 501b0b6 into saltstack-formulas:master Jun 18, 2018
@aboe76
Copy link
Contributor

aboe76 commented Jun 18, 2018

woot merged

@noelmcloughlin noelmcloughlin deleted the devpkg branch June 18, 2018 23:10
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.

postgresql.dev dependency hell on RedHat
3 participants