Use autoconf to locate the diff and patch executables and pass those pathnames to...
authorArt Cancro <ajc@uncensored.citadel.org>
Mon, 12 Sep 2011 15:53:20 +0000 (11:53 -0400)
committerWilfried Goesgens <dothebart@citadel.org>
Fri, 16 Sep 2011 18:49:51 +0000 (18:49 +0000)
citadel/Makefile.in
citadel/configure.ac
citadel/modules/wiki/serv_wiki.c

index d727bf8f77af9e397d69dc6aac1c2f4fc9423d85..f66349272425d6d4d658f923e5a74b10282ee8cf 100644 (file)
@@ -53,7 +53,7 @@ CC=@CC@
 CFLAGS=@CFLAGS@ -I ./include/
 CPPFLAGS=@CPPFLAGS@ -I. -I ./include/
 DATABASE=@DATABASE@
-DEFS=@DEFS@
+DEFS=@DEFS@ -DDIFF=\"@DIFF@\" -DPATCH=\"@PATCH@\"
 LDFLAGS=@LDFLAGS@
 LIBS=@LIBS@
 LIBOBJS=@LIBOBJS@
@@ -65,6 +65,8 @@ SERVER_LDFLAGS=@SERVER_LDFLAGS@
 SERVER_LIBS=@SERVER_LIBS@
 SETUP_LIBS=@SETUP_LIBS@
 YACC=@YACC@
+DIFF=@DIFF@
+PATCH=@PATCH@
 LOCALEDIR=@LOCALEDIR@
 
 # End configuration section
index 12d054fa28d053f58fac22932901b85d59744f4f..11a65042e5a23f1ace604d6e291cd9f341f67bcf 100644 (file)
@@ -398,6 +398,8 @@ AC_SUBST(DEPEND_FLAG)
 
 AC_PROG_INSTALL
 AC_PROG_YACC
+AC_PATH_PROG(DIFF,diff)
+AC_PATH_PROG(PATCH,patch)
 missing_dir=`cd $ac_aux_dir && pwd`
 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
@@ -1035,8 +1037,6 @@ AC_CACHE_CHECK([under the bed], ac_cv_under_the_bed, [
 
 STRUCT_UCRED
 
-
-
 dnl Done! Now write the Makefile and sysdep.h
 AC_SUBST(RESOLV)
 AC_SUBST(chkpwd_LIBS)
@@ -1045,6 +1045,8 @@ AC_SUBST(DATABASE)
 AC_SUBST(SERVER_LDFLAGS)
 AC_SUBST(SERVER_LIBS)
 AC_SUBST(SETUP_LIBS)
+AC_SUBST(DIFF)
+AC_SUBST(PATCH)
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT(database_cleanup.sh po/citadel-setup/Makefile)
 
index f18bb4a4a30c84ad45b8b52085960b59105d3813..680f63733aed4c47088b8da5b60c075a87f8b1fb 100644 (file)
@@ -168,7 +168,7 @@ int wiki_upload_beforesave(struct CtdlMessage *msg) {
        fclose(fp);
 
        snprintf(diff_cmd, sizeof diff_cmd,
-               "diff -u %s %s >%s",
+               DIFF " -u %s %s >%s",
                diff_new_filename,
                ((old_msg != NULL) ? diff_old_filename : "/dev/null"),
                diff_out_filename
@@ -434,7 +434,7 @@ void wiki_rev_callback(char *name, char *filename, char *partnum, char *disp,
        syslog(LOG_DEBUG, "callback found rev: %s\n", this_rev);
 
        /* Perform the patch */
-       fp = popen("patch -f -s -p0 -r /dev/null >/dev/null 2>/dev/null", "w");
+       fp = popen(PATCH " -f -s -p0 -r /dev/null >/dev/null 2>/dev/null", "w");
        if (fp) {
                /* Replace the filenames in the patch with the tempfilename we're actually tweaking */
                fprintf(fp, "--- %s\n", hecbd->tempfilename);