rohrpost

A commandline mail client to change the world as we see it.
git clone git://r-36.net/rohrpost
Log | Files | Refs | LICENSE

commit 7af39f6d1c4402ff037e189c5fc9a4f50b1a8b69
parent 04f3d98fbe666032554a5fc6d7437962dd8c7b8a
Author: Christoph Lohmann <20h@r-36.net>
Date:   Wed, 26 Dec 2012 17:31:36 +0100

Fixing lstat and allow template moving by rpinit.

Diffstat:
Makefile | 9+++++++++
cfg.c | 2+-
config.mk | 1+
path.c | 2+-
tmpl/compose.sh | 0
tmpl/flag.sh | 0
tmpl/fwd.sh | 0
tmpl/inc.sh | 0
tmpl/news.sh | 0
tmpl/print.sh | 0
tmpl/repl.sh | 0
tmpl/scan.sh | 0
tmpl/view.sh | 0
13 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile @@ -82,6 +82,13 @@ install: all bin fi \ done; \ true; + @echo installing shared files to ${DESTDIR}${SHAREPREFIX} + @mkdir -p ${DESTDIR}${SHAREPREFIX} + @cp -rf tmpl ${DESTDIR}${SHAREPREFIX} + @chmod 644 ${DESTDIR}${SHAREPREFIX}/tmpl/* + @echo correcting the share prefix in rpinit + @sed "s,SHAREPREFIX,${SHAREPREFIX},g" < bin/rpinit > ${DESTDIR}${PREFIX}/bin/rpinit + @chmod 755 ${DESTDIR}${PREFIX}/bin/rpinit uninstall: clean @echo removing executable files from ${DESTDIR}${PREFIX}/bin @@ -93,6 +100,8 @@ uninstall: clean [ -e ${DESTDIR}${PREFIX}/bin/${NAME} ] && \ rm ${DESTDIR}${PREFIX}/bin/${NAME}; \ true; + @echo removing shared files from ${DESTDIR}${PREFIX} + @rm -rf ${DESTDIR}${PREFIX} .PHONY: all options clean dist install uninstall bin binclean diff --git a/cfg.c b/cfg.c @@ -56,7 +56,7 @@ config_default(char *cfgn) path = path_mkrppath(NULL); if (chdir(path) < 0) edie("chdir"); - if (stat("default", &sbuf) >= 0) { + if (lstat("default", &sbuf) >= 0) { if (remove("default") < 0) edie("remove"); } diff --git a/config.mk b/config.mk @@ -6,6 +6,7 @@ VERSION = 0.4 # paths PREFIX = /usr/local +SHAREPREFIX= ${PREFIX}/share/${NAME} MANPREFIX = ${PREFIX}/share/man # includes and libs diff --git a/path.c b/path.c @@ -93,7 +93,7 @@ path_mkbasepath(char *cfgn) path = path_mkrppath(NULL); if (chdir(path) < 0) edie("chdir"); - if (stat("default", &sbuf) < 0) { + if (lstat("default", &sbuf) < 0) { if (cfgn == NULL || !strcmp(cfgn, "default")) { die("You are trying to create a 'default'" " configuration while no other configuration" diff --git a/tmpl/compose.sh b/tmpl/compose.sh diff --git a/tmpl/flag.sh b/tmpl/flag.sh diff --git a/tmpl/fwd.sh b/tmpl/fwd.sh diff --git a/tmpl/inc.sh b/tmpl/inc.sh diff --git a/tmpl/news.sh b/tmpl/news.sh diff --git a/tmpl/print.sh b/tmpl/print.sh diff --git a/tmpl/repl.sh b/tmpl/repl.sh diff --git a/tmpl/scan.sh b/tmpl/scan.sh diff --git a/tmpl/view.sh b/tmpl/view.sh