commit d2902ce4e8a85246487c554b334375c147ef73ac
parent 1005678e425a1f103842891c0be1be2054944471
Author: Jaromil <jaromil@dyne.org>
Date: Fri, 2 May 2014 14:56:00 +0200
fixes to config paths creations
Diffstat:
4 files changed, 21 insertions(+), 30 deletions(-)
diff --git a/build/install-gnu.sh b/build/install-gnu.sh
@@ -32,6 +32,6 @@ cp -ra $srcdir/build/gnu/* $JARO_LIBEXEC/bin
cat <<EOF > $PREFIX/bin/jaro
#!/usr/bin/env zsh
export JAROWORKDIR=${JARO_SHARE}
-${JARO_SHARE}/jaro \${=@}
+${JARO_SHARE}/bin/jaro \${=@}
EOF
chmod +x $PREFIX/bin/jaro
diff --git a/src/jaro b/src/jaro
@@ -232,7 +232,7 @@ ${=mkdir} "$TMPDIR"
hostname=$(hostname) # gather the current hostname
# make sure we have a directory for account configurations
-{ test -d $ACCOUNTS } || { mkdir -p $ACCOUNTS }
+{ test -d "$ACCOUNTS" } || { ${=mkdir} "$ACCOUNTS" }
# make sure we have a local keyring in case system-wide not found
{ test -r "$KEYRING" } || { create_keyring "$KEYRING" }
@@ -243,33 +243,24 @@ hostname=$(hostname) # gather the current hostname
${=mkdir} "$MAILDIRS/logs"
# ${=mkdir} "$MAILDIRS/certs"
-PROCMAILDIR=$MAILDIRS/.procmail
-MUTTDIR=$MAILDIRS/.mutt
+PROCMAILDIR="$MAILDIRS/.procmail"
+{ test -d "$PROCMAILDIR" } || { ${=mkdir} "$PROCMAILDIR" }
+MUTTDIR="$MAILDIRS/.mutt"
+{ test -d "$MUTTDIR" } || { ${=mkdir} "$MUTTDIR" }
# make sure we have Filters.txt Applications.txt Mutt.txt
-if ! [ -r $MAILDIRS/Filters.txt ]; then
- cp -v doc/Filters.txt $MAILDIRS/Filters.txt
- act "Default filters created"
-else
- error "Existing configuration $MAILDIRS/Filters.txt skipped"
-fi
-
-if ! [ -r $MAILDIRS/Applications.txt ]; then
- cp -v doc/Applications.txt $MAILDIRS/Applications.txt
- act "Default helper applications settings created"
-else
- error "Existing configuration $MAILDIRS/Applications.txt skipped"
-fi
-
+{ test -r "$MAILDIRS/Filters.txt" } || {
+ cp "$WORKDIR/Filters.txt" "$MAILDIRS/Filters.txt"
+ notice "Default filters created" }
-if ! [ -r $MAILDIRS/Mutt.txt ]; then
- cp -v doc/Mutt.txt $MAILDIRS/Mutt.txt
- act "Default Mutt configuration template created"
-else
- error "Existing configuration $MAILDIRS/Mutt.txt skipped"
-fi
+{ test -r "$MAILDIRS/Applications.txt" } || {
+ cp "$WORKDIR/Applications.txt" "$MAILDIRS/Applications.txt"
+ notice "Default helper applications settings created" }
+{ test -r "$MAILDIRS/Mutt.txt" } || {
+ cp "$WORKDIR/Mutt.txt" "$MAILDIRS/Mutt.txt"
+ notice "Default Mutt configuration template created" }
# use gnome-keyring for passwords on GNU systems
GNOMEKEY=0
@@ -354,7 +345,7 @@ check_bin() {
# make sure a gnupg dir exists
{ test -r $HOME/.gnupg/pubring.gpg } || {
- mkdir -p $HOME/.gnupg
+ ${=mkdir} $HOME/.gnupg
touch $HOME/.gnupg/pubring.gpg
touch $HOME/.gnupg/secring.gpg
}
diff --git a/src/zlibs/filters b/src/zlibs/filters
@@ -112,15 +112,15 @@ text/plain; cat %s
EOF
wwwtext=w3m
- if command -v elinks; then
+ if command -v elinks > /dev/null; then
cat <<EOF >> $MUTTDIR/mailcap
text/html; elinks -dump -dump-charset %{charset} %s; nametemplate=%s.html; copiousoutput
EOF
- elif command -v w3m; then
+ elif command -v w3m > /dev/null; then
cat <<EOF >> $MUTTDIR/mailcap
text/html; w3m -I %{charset} -T text/html %s; nametemplate=%s.html; copiousoutput
EOF
- elif command -v lynx; then
+ elif command -v lynx > /dev/null; then
cat <<EOF >> $MUTTDIR/mailcap
text/html; lynx -dump -assume_charset=%{charset} %s; nametemplate=%s.html; copiousoutput
EOF
@@ -159,7 +159,7 @@ EOF
act "generating procmail and sieve filter rules"
id=$datestamp.$RANDOM
sieve=$MAILDIRS/Filters.sieve
- lock $sieve
+ newlock $sieve
rm -f $sieve
touch $sieve
chmod 600 $sieve
diff --git a/src/zlibs/locking b/src/zlibs/locking
@@ -39,7 +39,7 @@ lock() {
esac
}
-newlock() { # create locked
+newlock() { # lock file, create if not existing
func "creating locked file: $1"
touch $1
chmod 600 $1