[24742] users/pipping/Portfile

source_changes at macosforge.org source_changes at macosforge.org
Wed May 2 08:29:13 PDT 2007


Revision: 24742
          http://trac.macosforge.org/projects/macports/changeset/24742
Author:   pipping at macports.org
Date:     2007-05-02 08:29:12 -0700 (Wed, 02 May 2007)

Log Message:
-----------
 * add a preliminary environment for testing a select-tool

see http://www.mail-archive.com/macports-dev@lists.macosforge.org/msg00840.html

Added Paths:
-----------
    users/pipping/Portfile

Added: users/pipping/Portfile
===================================================================
--- users/pipping/Portfile	                        (rev 0)
+++ users/pipping/Portfile	2007-05-02 15:29:12 UTC (rev 24742)
@@ -0,0 +1,43 @@
+# $Id$
+
+# the three lines below are meant to simulate a portfile, nothing else
+PortSystem 1.0
+name             nano
+version          2.0.6
+
+set port              python
+set version_i_want    "24"
+
+pre-fetch {
+  if {[catch {registry_active ${port}${version_i_want}}]} {
+    error "-> the version you're trying to make the default is not active!"
+  } else {
+    ui_msg "-> ready to make ${port}${version_i_want} the default"
+    switch ${port} {
+      python {
+        ui_msg "-> woohoo, python! (good taste)"
+        # list for debugging
+        set filehash [list ${prefix}/bin/python ${prefix}/Library/Frameworks/Python.framework/Versions/2.4/bin/python]
+        foreach {file target} $filehash {
+          if {[file exists $file]} {
+            ui_msg "-> file exists: $file"
+            if {![string equal link [file type ${file}]]} {
+              ui_msg "-> won't touch anything but a link!"
+            } else {
+              delete ${file}
+              ln -s ${target} ${file}
+            }
+          } else {
+            ln -s ${target} ${file}
+          }
+          ui_msg "-->file:   ${file}"
+          ui_msg "-->target: ${target}"
+        }
+      }
+      default {
+        ui_msg "aww, not python..."
+      }
+    }
+  }
+}
+fetch {error "don't finish"}


Property changes on: users/pipping/Portfile
___________________________________________________________________
Name: svn:keywords
   + id
Name: svn:eol-style
   + native

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


More information about the macports-changes mailing list