From acb2b7b45ad87d0f163fd1793d07d8ea9851f9be Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 18 Oct 2010 20:03:40 +0200 Subject: ct new: Support directories / subdirectories. Make checklinks use absolute links for this. --- bin/ct | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/ct b/bin/ct index f5f7100..4458c2f 100755 --- a/bin/ct +++ b/bin/ct @@ -417,8 +417,8 @@ function priority_name { function run_checklinks { if [[ -e links ]] { ${self_path}/bin/checklinks ${*} ${CL_OPTIONS} \ - --parameter package=${${PWD#${HOME}}#/##} \ - --parameter etc=${${PWD#${HOME}}#/##}/etc + --parameter package=${PWD} \ + --parameter etc=${PWD}/etc } elif [[ -d etc && ${MAGIC_ETC} == 1 ]] { ${self_path}/bin/checklinks --ct-auto ${CL_OPTIONS} ${*} } @@ -889,17 +889,19 @@ function pkg_new { file=${HOME}/${file} } - if [[ -x ${file} ]]; then + if [[ -x ${file} && ! -d ${file} ]]; then mkdir -p ${pd}/bin mv -i ${file} ${pd}/bin && \ info "OK ${file} -> ${pd}/bin/${file:r}\n" - elif [[ ! -d ${file} && ${file} =~ ${HOME}/'[^/]+$' ]]; then + elif [[ ${file} == ${HOME}/.* ]]; then mkdir -p ${pd}/etc - mv -i ${file} ${pd}/etc/${file#${HOME}/.} && \ - info "OK ${file} -> ${pd}/etc/${file#${HOME}/.}\n" + mv -i ${file} ${pd}/etc/${file:t} && \ + info "OK ${file} -> ${pd}/etc/${file:t}\n" + + echo "soft ${file#${HOME}/} \$etc/${file:t}" >> ${pd}/links else -- cgit v1.2.3