[108488] trunk/dports/net/openssh/Portfile

dluke at macports.org dluke at macports.org
Wed Jul 24 07:47:27 PDT 2013


Revision: 108488
          https://trac.macports.org/changeset/108488
Author:   dluke at macports.org
Date:     2013-07-24 07:47:27 -0700 (Wed, 24 Jul 2013)
Log Message:
-----------
openssh: stop overwriting ssh & sshd config files on every upgrade

Modified Paths:
--------------
    trunk/dports/net/openssh/Portfile

Modified: trunk/dports/net/openssh/Portfile
===================================================================
--- trunk/dports/net/openssh/Portfile	2013-07-24 12:58:31 UTC (rev 108487)
+++ trunk/dports/net/openssh/Portfile	2013-07-24 14:47:27 UTC (rev 108488)
@@ -5,7 +5,7 @@
 
 name                openssh
 version             6.2p2
-revision            2
+revision            3
 conflicts           ssh-copy-id
 
 categories          net
@@ -77,8 +77,19 @@
     reinplace "s|#Port 22|Port 2222|g" ${destroot}${prefix}/etc/ssh/sshd_config
     xinstall -m 755 ${worksrcpath}/contrib/ssh-copy-id ${destroot}${prefix}/bin
     xinstall -m 644 ${worksrcpath}/contrib/ssh-copy-id.1 ${destroot}${prefix}/share/man/man1
+    file rename "${destroot}${prefix}/etc/ssh/sshd_config" "${destroot}${prefix}/etc/ssh/sshd_config.example"
+    file rename "${destroot}${prefix}/etc/ssh/ssh_config" "${destroot}${prefix}/etc/ssh/ssh_config.example"
 }
 
+post-activate {
+    if {![file exists "${prefix}/etc/ssh/sshd_config"]} {
+        file copy "${prefix}/etc/ssh/sshd_config.example" "${prefix}/etc/ssh/sshd_config"
+    }
+    if {![file exists "${prefix}/etc/ssh/ssh_config"]} {
+        file copy "${prefix}/etc/ssh/ssh_config.example" "${prefix}/etc/ssh/ssh_config"
+    }
+}
+
 default_variants +xauth
 
 variant xauth description {Build with support for xauth} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130724/0e361b1c/attachment.html>


More information about the macports-changes mailing list