Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 152307 - sys-process/supervise-scripts-3.5 - svscan-add-to-inittab is broken
Summary: sys-process/supervise-scripts-3.5 - svscan-add-to-inittab is broken
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-21 17:36 UTC by Richard Scott
Modified: 2006-10-22 05:35 UTC (History)
0 users

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 Richard Scott 2006-10-21 17:36:24 UTC
+++ This bug was initially created as a clone of Bug #81743 +++

# svscan-add-to-inittab
head: `-21' option is obsolete; use `-n 21' since this will be removed in the future
tail: cannot open `+22' for reading: No such file or directory
Comment 1 Richard Scott 2006-10-21 17:36:32 UTC
It looks like that initial bug report was not directly a coreutils problem.

I have coreutils-5.94-r1 installed and I've just installed supervise-scripts-3.5 and in /usr/bin/svscan-add-to-inittab there is a reference to the tail command that has incorrect syntax.

On line 65 you have the following:

catit | tail +$lineno

Which should be:

catit | tail -n +$lineno
Comment 2 SpanKY gentoo-dev 2006-10-21 23:34:27 UTC
the ebuild should fix this already:
>>> Unpacking supervise-scripts-3.5.tar.gz to /var/tmp/portage/sys-process/supervise-scripts-3.5/work
 * Replacing obsolete head/tail with POSIX compliant ones
 *  - fixed svscan-add-to-inittab.in
Comment 3 Richard Scott 2006-10-22 05:04:16 UTC
LOL, you'd think so, but on my system a re-emerge of sys-process/supervise-scripts-3.5 over writes my local (edited) copy of /usr/bin/svscan-add-to-inittab with the broken one.

I've just been and checked the following:

# cd /usr/portage/sys-process/supervise-scripts
# ebuild supervise-scripts-3.5.ebuild unpack
# cat /var/tmp/portage/supervise-scripts-3.5/work/supervise-scripts-3.5/svscan-add-to-inittab.in | tail -n 10

and get the following output with the tail options still in the broken format :-(

{
  catit | head -$(($lineno-1))
  echo "SV:2345:respawn:$conf_bin/svscan-start /service"
  echo "SX:S016:wait:$conf_bin/svscan-stopall /service"
  catit | tail +$lineno
} >"$tmpfile"

# And move it over the existing file
ln "$filename" "$backup"
mv -f "$tmpfile" "$filename"

It looks like the file isn't changed in any way by the inherited code :-(

Hope the feedback helps narrow this one down as if the inherited code is broken then other packages may be effected too!

ok, here's a diff output from the fixed version of svscan-add-to-inittab and the original version in the tar.gz file:

< lineno=`catit | egrep -n '^[^:]*:0:wait:.*rc' | cut -d: -f1 | head -1`
---
> lineno=`catit | egrep -n '^[^:]*:0:wait:.*rc' | cut -d: -f1 | head -n 1`

The only parts that are changed are the "head" commands and not the "tail" commands!
Comment 4 SpanKY gentoo-dev 2006-10-22 05:35:51 UTC
that's because the eclass cannot handle arbitrary shell scripts

fixed in cvs