| Summary: | baselayout-1.12.10-r5 - Colon missing in /etc/init.d/clock @ line 57 | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Vince C. <vincent.cadet> |
| Component: | [OLD] baselayout | Assignee: | Gentoo's Team for Core System packages <base-system> |
| Status: | RESOLVED INVALID | ||
| Severity: | normal | CC: | polynomial-c |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| URL: | http://forums.gentoo.org/viewtopic-p-4704254.html | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
the cause of Bug 193700 is that he was expecting something to happen that wasnt supposed to happen the : is not supposed to be there, read the conf.d/clock file (In reply to comment #1) > the : is not supposed to be there, read the conf.d/clock file I've read conf.d/clock file and I still don't understand what a bash variable substitution like ${TIMEZONE-Factory} would mean. Would you mind explaining it, please? (I expect ${VAR:-value} to mean "If $VAR is unset then return 'value'" so if was the initial intent, why remove the colon?) check out the bash man page
${VAR:-val} => set "VAR" to "val" if "VAR" is unset *or null*
${VAR-val} => set "VAR" to "val" if "VAR" is unset
correlate that with conf.d/clock and i think you should see why we do not want the colon there
Thanks a lot Sparky. I didn't know that syntax. Probably time to update my old bash manuals ;-) .
Note that particular syntax is not mentioned in bash man pages. I only knew of ${VAR:=default value}, which is similar, except it also sets the variable if it is NULL but it is probably not appropriate in this case.
sure it is ... right above the actual enumeration, it states: ... omitting the colon results in a test only for a parameter that is unset. (In reply to comment #5) > sure it is ... right above the actual enumeration, it states: > ... omitting the colon results in a test only for a parameter that is unset. Oops! I probably didn't pay attention to that paragraph... Thanks for pinning this. |
The line that determines whether the TIMEZONE variable is set to Factory contains a typo error (a missing colon in bash variable substitution). Reproducible: Always Steps to Reproduce: Install baselayout 1.12.10-r5 Actual Results: Actual merge suggestion with dispatch-conf. @@ -57,7 +57,7 @@ # Make sure people set their timezone ... we do it here # even though we don't actually use the variable so that # people see the warning on boot. - if [[ ${TIMEZONE:-Factory} == "Factory" ]] ; then + if [[ ${TIMEZONE-Factory} == "Factory" ]] ; then ewarn "Your TIMEZONE in /etc/conf.d/clock is still set to Factory!" fi } Note the missing colon. Expected Results: No merge needed. Might be the cause for Bug #193700.