tFixing lstat and allow template moving by rpinit. - rohrpost - A commandline mail client to change the world as we see it.
 (HTM) git clone git://r-36.net/rohrpost
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 7af39f6d1c4402ff037e189c5fc9a4f50b1a8b69
 (DIR) parent 04f3d98fbe666032554a5fc6d7437962dd8c7b8a
 (HTM) 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(-)
       ---
 (DIR) diff --git a/Makefile b/Makefile
       t@@ -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
       t@@ -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
        
 (DIR) diff --git a/cfg.c b/cfg.c
       t@@ -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");
                }
 (DIR) diff --git a/config.mk b/config.mk
       t@@ -6,6 +6,7 @@ VERSION = 0.4
        
        # paths
        PREFIX = /usr/local
       +SHAREPREFIX= ${PREFIX}/share/${NAME}
        MANPREFIX = ${PREFIX}/share/man
        
        # includes and libs
 (DIR) diff --git a/path.c b/path.c
       t@@ -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"
 (DIR) diff --git a/tmpl/compose.sh b/tmpl/compose.sh
 (DIR) diff --git a/tmpl/flag.sh b/tmpl/flag.sh
 (DIR) diff --git a/tmpl/fwd.sh b/tmpl/fwd.sh
 (DIR) diff --git a/tmpl/inc.sh b/tmpl/inc.sh
 (DIR) diff --git a/tmpl/news.sh b/tmpl/news.sh
 (DIR) diff --git a/tmpl/print.sh b/tmpl/print.sh
 (DIR) diff --git a/tmpl/repl.sh b/tmpl/repl.sh
 (DIR) diff --git a/tmpl/scan.sh b/tmpl/scan.sh
 (DIR) diff --git a/tmpl/view.sh b/tmpl/view.sh