| Summary: | unwanted execution in eclasses (makes it slow) | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Robin Johnson <robbat2> |
| Component: | Current packages | Assignee: | Mamoru KOMACHI (RETIRED) <usata> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | jakub, qa |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
Correct.
Correction for second instance:
This is hairy in BASH. Zsh would be better, but the gentoo developer community apparently has a fair amount of learning before that transition can feasibly start.
PVTMP=${PV%.*}
PVP=(${PV%%.*} ${PVTMP#*.} ${PV##*.})
Note that the above fix only works with three octet version numbers.
In zsh, we'd have an easy answer that would handle all cases.
IFStmp=$IFS; IFS='-._'; PVP=($=PV)); IFS=$IFStmp
(That translates to: Backup the word separator characters. Set the word separator characters to '-', '.', and '_'; then wordsplit PV into array PVP. Restore the word separator charactors. The same concept in bash only returns the major portion.)
kernel-2.eclass:
KV_MAJOR=${KV%%.*}
KV_MINOR=${KV%.*}
KV_MINOR=${KV_MINOR#*.}
KV_PATCH=${KV##*.}
Note: in zsh, the middle variable becomes
KV_MINOR=${${KV%.*}#*.}
I'm not confirming this bug only because I'm new here and do not know if this is reserved for core developers.
This bug is irrelevant after 1 1/2 years, except for cannadic.eclass which is still not fixed. usata: please fix cannadic.eclass I fixed this antarus: thanks. |
cannadic.eclass: DICSDIRFILE="$(echo ${FILESDIR}/*.dics.dir)" fix: DICSDIRFILE="${FILESDIR}/*.dics.dir" gnome.org.eclass, gst-plugins.eclass, gtk-engines.eclass PVP=($(echo " $PV " | sed 's:[-\._]: :g')) kernel-2.eclass: KV_MAJOR=$(echo ${KV} | cut -d. -f1) KV_MINOR=$(echo ${KV} | cut -d. -f2) KV_PATCH=$(echo ${KV} | cut -d. -f3)