Ticket #21170: gcc_select.patch
File gcc_select.patch, 2.0 KB (added by akimd (Akim Demaille), 15 years ago) |
---|
-
gcc_select
old new 2 2 # 3 3 # $Id: portdestroot.tcl 27199 2007-07-24 09:09:43Z mww@macports.org $ 4 4 # 5 # Copyright (c) 2007 The MacPorts Project5 # Copyright (c) 2007, 2009 The MacPorts Project 6 6 # Copyright (c) 2007 Markus W. Weissmann <mww@macports.org> 7 7 # All rights reserved. 8 8 # … … 89 89 90 90 # perform an action (command) or just display it 91 91 action() { 92 if [ "rm" == ${1} ]; then 93 if [ 1 == ${noexec} ]; then 94 echo "rm -f ${2}" 95 else 96 rm -f ${2} 97 fi 98 elif [ "ln" == ${1} ]; then 99 if [ 1 == ${noexec} ]; then 100 echo "ln -sf ${2} ${3}" 101 else 102 ln -sf ${2} ${3} 103 fi 104 else 105 return 1 106 fi 92 case ${1}:${noexec} in 93 (rm:1) echo "rm -f ${2}";; 94 (rm:*) rm -f ${2};; 95 (ln:1) echo "ln -sf ${2} ${3}";; 96 (rm:*) ln -sf ${2} ${3};; 97 (*) return 1;; 98 esac 107 99 } 108 100 109 101 # change symlinks … … 118 110 119 111 empty=0 120 112 # test if line starts with '-' -> dont link, just rm original 121 if [ "-" == $(echo ${src} | colrm 2) ]; then 113 case ${src} in 114 (-*) 122 115 # source is unavailable for this file 123 action "rm" "${DESTDIR}${PREFIX}/${target}" 124 elif [ "/" == $(echo ${src} | colrm 2) ]; then116 action "rm" "${DESTDIR}${PREFIX}/${target}";; 117 (/*) 125 118 # source has an absolute path 126 action "ln" "${src}" "${DESTDIR}${PREFIX}/${target}"127 else119 action "ln" "${src}" "${DESTDIR}${PREFIX}/${target}";; 120 (*) 128 121 # source has relative path 129 122 action "ln" "${PREFIX}/${src}" "${DESTDIR}${PREFIX}/${target}" 130 fi 123 esac 131 124 let "error = error + ${?}" 132 125 let "i = i + 1" 133 126 done … … 181 174 182 175 # execute selection 183 176 select_version ${1} 184 if [ 0 != ${?} ]; then 185 echo "there were ${?} errors selecting version \"${version}\"!" 177 status=${?} 178 if [ 0 != ${status} ]; then 179 echo "there were ${status} errors selecting version \"${version}\"!" 186 180 exit 5 187 181 fi 188 182 189 183 exit 0 190