Ticket #21320: select-absolute-target.diff

File select-absolute-target.diff, 1.1 KB (added by jmroot (Joshua Root), 15 years ago)

proposed fix

  • select.sh

     
    133133        else
    134134            src=$(head -n ${i} ${CONFPATH}/${1} | tail -n 1)
    135135        fi
     136       
     137        if [ "/" != $(echo ${target} | colrm 2) ]; then
     138            target="${PREFIX}/${target}"
     139        fi
    136140
    137141        # test if line starts with '-' -> dont link, just rm original
    138142        if [ "-" == $(echo ${src} | colrm 2) ]; then
    139143            # source is unavailable for this file
    140             action "rm" "${PREFIX}/${target}"
     144            action "rm" "${target}"
    141145        elif [ "/" == $(echo ${src} | colrm 2) ]; then
    142146            # source has an absolute path
    143             action "ln" "${src}" "${PREFIX}/${target}"
     147            action "ln" "${src}" "${target}"
    144148        else
    145149            # source has relative path
    146             action "ln" "${PREFIX}/${src}" "${PREFIX}/${target}"
     150            action "ln" "${PREFIX}/${src}" "${target}"
    147151        fi
    148152        let "error = error + ${?}"
    149153        let "i = i + 1"