| Summary: | check_system_crontabs in fcron fails because it calls the "wrong" sed | ||
|---|---|---|---|
| Product: | Gentoo/Alt | Reporter: | Tiziano Müller (RETIRED) <dev-zero> |
| Component: | FreeBSD | Assignee: | Wolfram Schlich (RETIRED) <wschlich> |
| Status: | RESOLVED NEEDINFO | ||
| Severity: | normal | CC: | bsd+disabled |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | FreeBSD | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
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 :( something like the following should work:
SED=$(which gsed 2>/dev/null)
SED=${SED:-sed}
... and otherwise (probably the better solution) would be to patch check_system_crontabs to only use POSIX-conform options :-) 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. |
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 ;-)