[27124] trunk/dports/net/antinat/Portfile

source_changes at macosforge.org source_changes at macosforge.org
Thu Jul 19 22:26:12 PDT 2007


Revision: 27124
          http://trac.macosforge.org/projects/macports/changeset/27124
Author:   boeyms at macports.org
Date:     2007-07-19 22:26:12 -0700 (Thu, 19 Jul 2007)

Log Message:
-----------
* Revise net/antinat to install an example configuration file rather than a
  "live" one, and deal with the possibility that users may have altered the live
  one installed by previous versions, which would otherwise be clobbered on
  upgrade or uninstallation;
* Remove a line break from the long_description, as it seemed to be causing
  problems with the MacPorts registry for users who had installed antinat.

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

Modified: trunk/dports/net/antinat/Portfile
===================================================================
--- trunk/dports/net/antinat/Portfile	2007-07-20 05:26:04 UTC (rev 27123)
+++ trunk/dports/net/antinat/Portfile	2007-07-20 05:26:12 UTC (rev 27124)
@@ -4,6 +4,7 @@
 
 name        antinat
 version     0.90
+revision    1
 categories  net
 description A powerful, configurable and flexible SOCKS server
 long_description \
@@ -11,7 +12,7 @@
     proxy-based applications. It supports SOCKS 4, SOCKS 4a, SOCKS 5, \
     authentication, CHAP, XML firewalling, Win32, server chaining, and \
     UDP. It also contains very experimental IPv6 support.\
-    \nSOCKS can be used to overcome some limitations of NAT, including \
+    SOCKS can be used to overcome some limitations of NAT, including \
     facilities for allowing connectbacks and server-side DNS. Antinat \
     aims to be fully standards compliant, feature rich, and have a solid \
     API for writing standards-compliant client applications.
@@ -24,6 +25,31 @@
             rmd160 5af3120844025acf4ecbb1ed26490e2065701d83
 depends_lib port:expat
 destroot.destdir    prefix=${destroot}${prefix}
+post-destroot {
+    set antinat_conf ${prefix}/etc/${name}.xml
+    move ${destroot}${antinat_conf} ${destroot}${antinat_conf}.example
+# Try to cover for the fact that, in earlier revisions of this port, the
+# configuration file was installed live instead of an example, in which case an
+# upgrade will clobber any customisations that a user might have made :(
+    catch "exec port provides ${antinat_conf}" provides_output
+    set antinat_conf_is_registered_to_antinat \
+        [regexp "${antinat_conf} is provided by: ${name}" ${provides_output}]
+    set antinat_conf_differs \
+        [catch {exec cmp ${antinat_conf} ${worksrcpath}/etc/${name}.conf}]
+    if { ${antinat_conf_is_registered_to_antinat} && ${antinat_conf_differs} } {
+        copy ${antinat_conf} ${antinat_conf}.altered
+        ui_msg ""
+        ui_msg "###############################################################"
+        ui_msg "# It appears that you have altered ${antinat_conf},"
+        ui_msg "# and that upgrading or uninstalling your previous installation"
+        ui_msg "# of ${name} will clobber your copy.  It has been copied to"
+        ui_msg "# ${antinat_conf}.altered for preservation when you upgrade or"
+        ui_msg "# uninstall ${name}.  This problem should not occur with future"
+        ui_msg "# upgrades or installations of this port.\n"
+        ui_msg "###############################################################"
+        ui_msg ""
+    }
+}
 startupitem.create  yes
 startupitem.name    ${name}
 startupitem.executable  ${prefix}/bin/${name}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070719/a9a01c67/attachment.html


More information about the macports-changes mailing list