[MacPorts] PortfileRecipes modified

MacPorts noreply at macports.org
Wed Feb 3 18:46:53 PST 2016


Page "PortfileRecipes" was changed by ryandesign at macports.org
Diff URL: <https://trac.macports.org/wiki/PortfileRecipes?action=diff&version=92>
Revision 92
Comment: add symlink-exists section
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: PortfileRecipes
=========================================================================
--- PortfileRecipes (version: 91)
+++ PortfileRecipes (version: 92)
@@ -834,3 +834,22 @@
 * wxwidgets-3
 * wxwidgets-3.1
 * zlib
+
+
+== Checking for a symlink's existence == #symlink-exists
+
+Checking for a file's existence is easy:
+
+{{{
+if {[file exists ${f}]} {
+    ...
+}
+}}}
+
+But if `${f}` is a symlink, `file exists` will check for the existence of the file the symlink points to. If you want to check for the existence of the symlink itself, use:
+
+{{{
+if {![catch {file type ${f}}]} {
+    ...
+}
+}}}
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/PortfileRecipes>
MacPorts <https://www.macports.org/>
Ports system for OS X

This is an automated message. Someone added your email address to be
notified of changes on 'PortfileRecipes' page.
If it was not you, please report to .


More information about the macports-changes mailing list