• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

/usr/bin is the "standard" place for gnu grep on linux, so i'd like to change the default to work with that.

crawford, do you think $cfg{RCS}{grep}{BinDir} is an appropriate name for this setting?

Index: lib/TWiki.cfg
===================================================================
--- lib/TWiki.cfg       (revision 4663)
+++ lib/TWiki.cfg       (working copy)
@@ -443,7 +443,8 @@
 # %ARG|T% must <em>NOT</em> be enclosed in any kind of quotes.</strong>
 # Otherwise the quotes will be treated as part of the parameter value.

-$cfg{RCS}{BinDir} = "/usr/bin" unless defined($cfg{RCS}{BinDir});
+$cfg{RCS}{BinDir} ||= '/usr/bin';
+$cfg{RCS}{grep}{BinDir} ||= '/bin';
 unless( defined($cfg{RCS}{ExtOption})) {
     $cfg{RCS}{ExtOption} = "";
     $cfg{RCS}{ExtOption} = "-x,v" if $cfg{OS} eq "WINDOWS";
@@ -484,11 +485,11 @@
 # to -i for case-sensitive search or to the empty string otherwise.
 # Similarly for %DET, which controls whether matching lines are required.
 # (see the documentation on these options with GNU grep for details).
-$cfg{RCS}{EgrepCmd} = "$cfg{RCS}{BinDir}/egrep" . ' %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';
+$cfg{RCS}{EgrepCmd} = "$cfg{RCS}{grep}{BinDir}/egrep" . ' %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';

 # **PATH**
 # Full path to GNU-compatible fgrep program. This is used for searching.
-$cfg{RCS}{FgrepCmd} = "$cfg{RCS}{BinDir}/fgrep" . ' %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';
+$cfg{RCS}{FgrepCmd} = "$cfg{RCS}{grep}{BinDir}/fgrep" . ' %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';

 # **COMMAND**
 # RcsWrap initialise a file as binary.

Not really, no. Use flat full path names, to avoid complicating configure. We should avoid adding "temporaryies" to TWiki.cfg until someone works out how to handle them in the configure interface. CC
on TWiki:Codev.TWikiIRC, this is what crawford and sven advocated instead: simply typing in the default path for egrep and fgrep into the command line directly. i don't actually like this, as it's a form of code duplication (egrep and frep are extremely likely to be in the same place), but it's not a big enough deal to argue over. plus, as crawford says, when (shared) temporaries are dealt with, this will go away anyway...
Index: TWiki.cfg
===================================================================
--- TWiki.cfg   (revision 4677)
+++ TWiki.cfg   (working copy)
@@ -443,7 +443,7 @@
 # %ARG|T% must <em>NOT</em> be enclosed in any kind of quotes.</strong>
 # Otherwise the quotes will be treated as part of the parameter value.

-$cfg{RCS}{BinDir} = "/usr/bin" unless defined($cfg{RCS}{BinDir});
+$cfg{RCS}{BinDir} ||= '/usr/bin';
 unless( defined($cfg{RCS}{ExtOption})) {
     $cfg{RCS}{ExtOption} = "";
     $cfg{RCS}{ExtOption} = "-x,v" if $cfg{OS} eq "WINDOWS";
@@ -484,11 +484,11 @@
 # to -i for case-sensitive search or to the empty string otherwise.
 # Similarly for %DET, which controls whether matching lines are required.
 # (see the documentation on these options with GNU grep for details).
-$cfg{RCS}{EgrepCmd} = "$cfg{RCS}{BinDir}/egrep" . ' %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';
+$cfg{RCS}{EgrepCmd} = "/bin/egrep" . ' %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';

 # **PATH**
 # Full path to GNU-compatible fgrep program. This is used for searching.
-$cfg{RCS}{FgrepCmd} = "$cfg{RCS}{BinDir}/fgrep" . ' %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';
+$cfg{RCS}{FgrepCmd} = "/bin/fgrep" . ' %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';

 # **COMMAND**
 # RcsWrap initialise a file as binary.

TWiki:Main.WillNorris

ItemTemplate
Summary provide better default path for the =grep=s
ReportedBy TWiki:Main.WillNorris
Codebase

AppliesTo

Priority Enhancement
CurrentState Closed
WaitingFor

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2005-07-21 - TWikiGuest
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback