Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 156435 - check_system_crontabs in fcron fails because it calls the "wrong" sed
Summary: check_system_crontabs in fcron fails because it calls the "wrong" sed
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: High normal (vote)
Assignee: Wolfram Schlich (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-27 11:46 UTC by Tiziano Müller (RETIRED)
Modified: 2007-03-24 00:04 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tiziano Müller (RETIRED) gentoo-dev 2006-11-27 11:46:54 UTC
I get the following error when running check_system_crontabs on freebsd:
**************************************
Rebuilding fcron systab.
sed: -e: No such file or directory
fcrontab [-n] file [user|-u user]
fcrontab { -l | -r | -e | -z } [-n] [user|-u user]
fcrontab -h
  -u user    specify user name.
  -l         list user's current fcrontab.
  -r         remove user's current fcrontab.
  -e         edit user's current fcrontab.
  -z         reinstall user's fcrontab from source code.
  -n         ignore previous version of file.
  -c f       make fcrontab use config file f.
  -d         set up debug mode.
  -h         display this help message.
  -V         display version & infos about fcrontab.
**************************************

The problem is that you assume that "sed" is GNU's sed (because of the '-e'), but on FreeBSD it isn't. A solution would be to check for "gsed" at the beginning of your script and use that if found (otherwise "sed" as usual).

After changing sed to gsed in the script, I still get:
**************************************
Rebuilding fcron systab.
fcrontab [-n] file [user|-u user]
fcrontab { -l | -r | -e | -z } [-n] [user|-u user]
fcrontab -h
  -u user    specify user name.
  -l         list user's current fcrontab.
  -r         remove user's current fcrontab.
  -e         edit user's current fcrontab.
  -z         reinstall user's fcrontab from source code.
  -n         ignore previous version of file.
  -c f       make fcrontab use config file f.
  -d         set up debug mode.
  -h         display this help message.
  -V         display version & infos about fcrontab.
**************************************
I assume that there's something else, which should be fixed. (Leaving that one for you as an exercise ;-)
Comment 1 Wolfram Schlich (RETIRED) gentoo-dev 2007-01-17 23:34:39 UTC
I have no idea on what's the proper fix to the sed-on-freebsd problem.
I cannot just change sed to gsed because gsed doesn't exist on for
example x86.
Someone from the x86-fbsd team should propose a sane solution to this.

check_system_crontabs is also using sed btw...

I wonder why fcron was keyworded ~x86-fbsd :(
Comment 2 Tiziano Müller (RETIRED) gentoo-dev 2007-01-18 15:01:35 UTC
something like the following should work:

SED=$(which gsed 2>/dev/null)
SED=${SED:-sed}
Comment 3 Tiziano Müller (RETIRED) gentoo-dev 2007-01-18 15:02:38 UTC
... and otherwise (probably the better solution) would be to patch check_system_crontabs to only use POSIX-conform options :-)
Comment 4 Wolfram Schlich (RETIRED) gentoo-dev 2007-03-24 00:04:14 UTC
You should probably notify upstream about that, so they can
fix their check_system_crontabs script wrt sed.
I did not keyword fcron ~x86-fbsd, so I'm not going to patch
that script only for this ARCH.