Ticket #48398: 0001-salt-Properly-install-default-configuration-files.patch

File 0001-salt-Properly-install-default-configuration-files.patch, 1.7 KB (added by raimue (Rainer Müller), 7 years ago)
  • sysutils/salt/Portfile

    From 743dbe7b151812e9aaaab47c65d90c9660d852bf Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Rainer=20M=C3=BCller?= <raimue@macports.org>
    Date: Wed, 31 May 2017 16:49:05 +0200
    Subject: [PATCH] salt: Properly install default configuration files
    
    Closes: https://trac.macports.org/ticket/48398
    ---
     sysutils/salt/Portfile | 21 ++++++++++++---------
     1 file changed, 12 insertions(+), 9 deletions(-)
    
    diff --git a/sysutils/salt/Portfile b/sysutils/salt/Portfile
    index 35de556a92..1862f57e16 100644
    a b PortSystem 1.0 
    44
    55name                salt
    66version             2017.5
     7revision            1
    78categories          sysutils
    89platforms           darwin
    910maintainers         gmail.com:jeremy.mcmillan
    if {$subport eq $name} { 
    3839                        port:py${python.version}-zmq \
    3940                        port:swig-python
    4041
    41     post-activate {
    42 
    43         file mkdir ${prefix}/etc/salt
     42    post-destroot {
     43        xinstall -d ${destroot}${prefix}/etc/salt
     44        foreach f {minion master} {
     45            xinstall -m 644 ${worksrcpath}/conf/$f ${destroot}${prefix}/etc/salt/$f.default
     46        }
     47    }
    4448
     49    post-activate {
    4550        if ![file exists /etc/salt] {
    4651            ln -s ${prefix}/etc/salt /etc/salt
    4752        }
    4853
    49         if ![file exists ${prefix}/etc/salt/minion] {
    50             copy ${worksrcpath}/conf/minion ${prefix}/etc/salt
    51         }
    52 
    53         if ![file exists ${prefix}/etc/salt/master] {
    54             copy ${worksrcpath}/conf/master ${prefix}/etc/salt
     54        foreach f {minion master} {
     55            if ![file exists ${prefix}/etc/salt/$f] {
     56                copy ${prefix}/etc/salt/$f.default ${prefix}/etc/salt/$f
     57            }
    5558        }
    5659    }
    5760