When booting, env-update gets run, but there is no need to run it if nothing has changed. Reproducible: Always Steps to Reproduce: 1. reboot system Actual Results: env-update gets run every time Expected Results: only run env-update if something changed
Created attachment 43990 [details, diff] bootmisc.patch Avoids running env-update if nothing has changed
It depends on bug 55329 because I use the function dependencyChanged that I defined there that properly determines if there is any change.
dont write patches unless you check cvs / latest unstable i fixed this sometime already
that may of sounded a little harsh, it wasnt meant that way ... basically patches/fixes will only be accepted if they're against cvs/1.11.x since that is the tree under development if you create a patch for 1.9.x or 1.10.x it'll be a waste of time because we wont be fixing those versions ;)
The patch was made against baselayout-1.11.6-r1.
it couldnt have been 1.11.6 runs `/sbin/env-update.sh -u` your patch doesnt show the '-u'
sorry about that, it seems I posted the wrong patch. Anyway, I see what the -u does, it fixes the problem, It clearly makes my patch obsolete. Thanks. Pleeeease check bug 55329 :) , I have been pushing it but I don't get much feedback from developers.
Your approach seems to have a problem. This loop: for config in /etc/env.d do if [ "${config}" -nt "${svcdir}/envcache" ] then update=1 break fi done gets executed only once with config = /etc/env.d You can try it with for config in /etc/env.d; do echo $config ; done So the for is equivalent to just: if [ "/etc/env.d" -nt "${svcdir}/envcache" ] then update=1 break fi Now, if you change one of the existing files inside /etc/env.d, say: touch /etc/env.d/05gcc then the date of /etc/env.d does not change and update=1 will never be executed. We did discuss that problem in bug 55329, and that was the reason I introduced the function dependencyChanged. To fix properly the problem, you need to check the date of the directory (in case something gets deleted) and each one of the scripts inside, which is what the dependencyChanged function does.
Created attachment 44059 [details, diff] env-update.sh.patch Do proper checking for directory change
Just in case, the patch does depend on bug 55329 where I define the function dependencyChanged
Created attachment 44060 [details, diff] env-update.sh.patch Simplified version
Created attachment 44150 [details, diff] env-update.sh.patch Oops, I had the wrong conditional before.
Created attachment 44152 [details, diff] env-update.sh.patch dependencyChanged is now recursive
added to cvs, thanks