You are here: Foswiki>Tasks Web>Item801 (05 Jul 2015, GeorgeClark)Edit Attach

Item801: Configure needs to more reliably set the grep & rcs program path, and handle configuration issues

pencil
Priority: Urgent
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component: Configure, PlatformFreeBSD, PlatformOSX
Branches: master
Reported By: SvenDowideit
Waiting For:
Last Change By: GeorgeClark
Task originally reported: on OSX, when grep is not found, the user gets a really bad and confusing error message

Could not perform search. Error was: exec failed: Inappropriate ioctl for device

thats super naf.

-- SvenDowideit - 19 Jan 2009

Another approach is to create default values in configure for different platforms. We know that on OS X grep is at /usr/bin/grep.

-- ArthurClemens - 07 Feb 2009

Come on. This is no near bring a release blocker.

Nothing prevent you from fixing a bug that is rated low or normal.

When people define the field correctly all works as it should. I cannot see that this is anywhere near being a release blocker.

-- KennethLavrsen - 10 Feb 2009

Perhaps its not a blocker, but the default value does not work. You have to know that you must set a different value. And that is not expected behaviour.

-- ArthurClemens - 11 Feb 2009

I have grep installed, at /usr/bin/grep and it is in the PATH.

I see this error message when running test suites.

-- MartinCleaver - 17 Mar 2009

I'm escalating this for 1.2. There is an issue that we have executable code in Foswiki.spec that attempts to guess the location of grep. If the $^O doesn't match, then the path won't be set correctly. Foswiki.spec and $^O results:
# bodgey up a default location for grep
# **STRING HIDDEN**
$Foswiki::cfg{_grepProgram} = '/bin/grep';
$Foswiki::cfg{_grepProgram} = '/usr/bin/grep' if ( $^O eq 'darwin' );
$Foswiki::cfg{_grepProgram} = 'c:/PROGRA~1/GnuWin32/bin/grep' if ( $^O eq 'MSWin32' );

[gac@foswiki ~]$ perl -e 'print "$^O\n";'
freebsd

So FreeBSD falls through the cracks, $^O is 'freebsd', and the correct location, like darwin, is '/usr/bin/grep'. Also the windows location is unlikely to exist.

Use the bootstrap! A better solution would be to use either CPAN:File::Which (yet another CPAN dependency) or a perl search of the path for grep. Now that we have the Bootstrap code, this would be better than logic in Foswiki.spec.

Also, other issues:
  • {_grepProgram} is type "HIDDEN" in the spec file, which doesn't seem to actually hide the field.
  • It's blank (on trunk.foswiki.org) but doesn't flag any errors. (trunk is only running because the original settings like {Store}{EgrepCmd} fully specify the path.)

-- GeorgeClark - 04 Nov 2014

Closed this before it was really ready....

-- CrawfordCurrie - 27 Nov 2014

Reopening this, as we fixed grep & egrep, but left all the RCS programs hardcoded to /usr/bin/rcs. They have the same issues.

-- GeorgeClark - 10 Apr 2015

ItemTemplate edit

Summary Configure needs to more reliably set the grep & rcs program path, and handle configuration issues
ReportedBy SvenDowideit
Codebase 1.0.0, trunk
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component Configure, PlatformFreeBSD, PlatformOSX
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:e0e4c2c430f0 distro:89141cc6dd12 distro:c715da1255a8 distro:661d67b936a2 distro:dc55210a28e0
TargetRelease major
ReleasedIn 2.0.0
CheckinsOnBranches master
trunkCheckins
masterCheckins distro:e0e4c2c430f0 distro:89141cc6dd12 distro:c715da1255a8 distro:661d67b936a2 distro:dc55210a28e0
ItemBranchCheckins
Release01x01Checkins
Topic revision: r16 - 05 Jul 2015, GeorgeClark - This page was cached on 30 Aug 2016 - 07:08.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License