[chora] Diffs aren't shown

Alexander Skwar lists.ASkwar at email-server.info
Fri Apr 18 12:25:12 PDT 2003


Alexander Skwar wrote:

> Can I somehow do it so, that chora makes rcsdiff use the directory
> specified in Horde's $conf['tmpdir'] - which is none and thus should be
> php's upload_tmp_dir?

Attached is a diff which fixes this bug/problem.  It makes rcsdiff use
the directory specified in the Horde $conf['tmpdir'] variable by setting
the environment variable TMPDIR to this value.

The fix required adding a new parameter CVSLib_Diff::get and using this
value in diff.php.  The new value parameter defaults to /tmp, if not
specified.


Alexander Skwar
-- 
/* Fuck.  The f-word is here so you can grep for it :-)  */
        2.4.3 linux/include/asm-mips/mmu_context.h
-------------- next part --------------
Index: diff.php
===================================================================
RCS file: /repository/chora/diff.php,v
retrieving revision 1.67
diff -r1.67 diff.php
113c113
<              $type, $num, $ws));
---
>              $type, $num, $ws, $conf['tmpdir']));
119c119
<     echo implode("\n", CVSLib_Diff::get($CVS, $fl, $r1, $r2, $type, $num, $ws));
---
>     echo implode("\n", CVSLib_Diff::get($CVS, $fl, $r1, $r2, $type, $num, $ws, $conf['tmpdir']));
124c124
<     echo implode("\n", CVSLib_Diff::get($CVS, $fl, $r1, $r2, $type, $num, $ws));
---
>     echo implode("\n", CVSLib_Diff::get($CVS, $fl, $r1, $r2, $type, $num, $ws, $conf['tmpdir']));
133c133
<                                             $type, $num, $ws));
---
>                                             $type, $num, $ws, $conf['tmpdir']));
154c154
<                 $num, $ws));
---
>                 $num, $ws, $conf['tmpdir']));
Index: lib/CVSLib/Diff.php
===================================================================
RCS file: /repository/chora/lib/CVSLib/Diff.php,v
retrieving revision 1.27
diff -r1.27 Diff.php
28a29
>      * @param tmp  Temporary directory used by rcsdiff. Optional; Defaults to /tmp
32c33
<     function get(&$CVS, &$file, $rev1, $rev2, $type = CVSLIB_DIFF_CONTEXT, $num = 3, $ws = true)
---
>     function get(&$CVS, &$file, $rev1, $rev2, $type = CVSLIB_DIFF_CONTEXT, $num = 3, $ws = true, $tmp = '/tmp')
78a80,85
> 	$old_tmpdir = getenv('TMPDIR');
> 	if ($tmp !== '' && $tmp !== null){
> 	    putenv('TMPDIR=' . $tmp);
> 	} else {
> 	    putenv('TMPDIR=' . get_cfg_var('upload_tmp_dir'));
> 	}
79a87
> 	putenv('TMPDIR=' . $old_tmpdir);


More information about the chora mailing list