summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2010-10-18 20:03:40 +0200
committerDaniel Friesel <derf@finalrewind.org>2010-10-18 20:03:40 +0200
commitacb2b7b45ad87d0f163fd1793d07d8ea9851f9be (patch)
tree95991fa742082fdbd5af77e201f31d8b486ffa6c
parentcc14672d25ec814d2db41e9b3a9376d1e2e57cd9 (diff)
ct new: Support directories / subdirectories. Make checklinks use absolute links for this.
-rwxr-xr-xbin/ct14
1 files changed, 8 insertions, 6 deletions
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