Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 126843

Summary: baselayout-1.11.x depscan.sh incorrectly checks for changed scripts
Product: Gentoo Linux Reporter: John Waymouth <gentoo.org>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: major CC: toralf
Priority: High    
Version: 2006.0   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description John Waymouth 2006-03-19 11:27:53 UTC
I've found that changing the depend statement in a hand-rolled init script and then running depscan.sh doesn't seem to pick up the change.  Depscan.sh seems not to check for changed scripts correctly.  Here's the relavent section from the script:

# Only update if files have actually changed
if ! ${update} ; then
        for config in /etc/conf.d /etc/init.d /etc/rc.conf ; do
                if [[ ${config} -nt "${mysvcdir}/depcache" ]] ; then
                        update=true     
                        break
                fi
        done
fi

This checks if the directory init.d itself is newer than the depcache file.  The directory's modified time will only update when a new script is added to /etc/init.d, not when an existing one is changed.  I don't think this was the intent when this was written, or if it is, it's rather stupid.

The fix is simple, just change the for line to this:

        for config in /etc/conf.d/* /etc/init.d/* /etc/rc.conf ; do

My installed baselayout version is 1.11.14-r6.

Also of note, before I fixed this bug on my system, whenever I ran my initscript with the "ineed" parameter to test my dependency changes, I got this message:

 * Re-caching dependency info (mtimes differ)...

but it didn't actually seem to recache.
Comment 1 SpanKY gentoo-dev 2006-03-19 19:18:18 UTC
this has been fixed in 1.12 and newer already
Comment 2 John Waymouth 2006-03-19 19:21:53 UTC
Neato.  I didn't check, it's masked.  Incidentally, I think we went to the same college.
Comment 3 SpanKY gentoo-dev 2006-03-21 19:33:37 UTC
back ported the current code from trunk to the 1.11.x branch
Comment 4 SpanKY gentoo-dev 2006-04-18 16:46:20 UTC
*** Bug 127419 has been marked as a duplicate of this bug. ***