Ignore:
Timestamp:
Nov 18, 2012, 8:45:44 AM (7 years ago)
Author:
ryandesign@…
Message:

muniversal: fix merge for ports installing absolute symlinks (#35226)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/_resources/port1.0/group/muniversal-1.0.tcl

    r96776 r99808  
    11# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
    2 # muniversal-1.0.tcl
    3 #
    42# $Id$
    53#
    6 # Copyright (c) 2009 The MacPorts Project,
     4# Copyright (c) 2009-2012 The MacPorts Project,
    75# All rights reserved.
    86#
     
    429427
    430428            foreach fl [glob -directory ${dir2} -tails -nocomplain *] {
    431                 if { ![file exists ${dir1}/${fl}] } {
     429                if { ![muniversal_file_or_symlink_exists ${dir1}/${fl}] } {
    432430                    # File only exists in ${dir1}
    433431                    ui_debug "universal: merge: ${prefixDir}/${fl} only exists in ${base2}"
     
    436434            }
    437435            foreach fl [glob -directory ${dir1} -tails -nocomplain *] {
    438                 if { ![file exists ${dir2}/${fl}] } {
     436                if { ![muniversal_file_or_symlink_exists ${dir2}/${fl}] } {
    439437                    # File only exists in ${dir2}
    440438                    ui_debug "universal: merge: ${prefixDir}/${fl} only exists in ${base1}"
     
    653651    }
    654652}
     653
     654# [muniversal_file_or_symlink_exists ${f}] tells you if ${f} exists. And unlike
     655# [file exists ${f}], if used on a symlink, [muniversal_file_or_symlink_exists ${f}]
     656# tells you about the symlink, not what it points to.
     657proc muniversal_file_or_symlink_exists {f} {
     658    # If [file type ${f}] throws an error, ${f} doesn't exist.
     659    if {[catch {file type ${f}}]} {
     660        return 0
     661    }
     662    # Otherwise, it does.
     663    return 1
     664}
Note: See TracChangeset for help on using the changeset viewer.