diff options
| author | Sam James <sam@gentoo.org> | 2023-06-02 20:59:51 +0100 |
|---|---|---|
| committer | Sam James <sam@gentoo.org> | 2023-06-02 22:46:29 +0100 |
| commit | d9278cc22a2e84f19bb758b569870470c69562e2 (patch) | |
| tree | 5e6e34c4132aff053d363ea23b0671ff21cc43bb /app-shells/bash/bash-9999.ebuild | |
| parent | 2c66442506f517d0180eea89cf500fbcb432d93d (diff) | |
| download | gentoo-d9278cc22a2e84f19bb758b569870470c69562e2.tar.gz gentoo-d9278cc22a2e84f19bb758b569870470c69562e2.tar.bz2 gentoo-d9278cc22a2e84f19bb758b569870470c69562e2.zip | |
app-shells/bash: optimise SRC_URI generation
Thanks to radhermit's new pkgcraft tooling. Also, thanks to ztrawhcse for suggestions.
Before:
```
app-shells/bash-5.2_p15-r3::.: 61.224122ms
app-shells/bash-5.1_p16-r4::.: 65.001125ms
app-shells/bash-5.1_p16-r5::.: 65.480029ms
```
After:
```
app-shells/bash-5.2_p15-r3::/home/sam/g/: 10.449073ms
app-shells/bash-5.1_p16-r4::/home/sam/g/: 10.505063ms
app-shells/bash-5.1_p16-r5::/home/sam/g/: 10.523583ms
```
This also gets us to approximately the same speed (almost within rounding
error) of pre-d3c19b7974aeb4ac2a1351a019e80625b4111c4b (where we removed eval
usage).
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-shells/bash/bash-9999.ebuild')
| -rw-r--r-- | app-shells/bash/bash-9999.ebuild | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/app-shells/bash/bash-9999.ebuild b/app-shells/bash/bash-9999.ebuild index 82dfe5fb1c66..af8066bbfd29 100644 --- a/app-shells/bash/bash-9999.ebuild +++ b/app-shells/bash/bash-9999.ebuild @@ -53,17 +53,24 @@ elif is_release ; then patch_url= my_patch_index= + upstream_url_base="mirror://gnu/bash" + mirror_url_base="ftp://ftp.cwru.edu/pub/bash" + for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do - for url in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do - patch_url=$(printf "${url}/${PN}-$(ver_cut 1-2)-patches/${my_p}-%03d" ${my_patch_index}) - SRC_URI+=" ${patch_url}" - SRC_URI+=" verify-sig? ( ${patch_url}.sig )" - done + printf -v mangled_patch_ver ${my_p}-%03d ${my_patch_index} + patch_url="${upstream_url_base}/${MY_P}-patches/${mangled_patch_ver}" + + SRC_URI+=" ${patch_url}" + SRC_URI+=" verify-sig? ( ${patch_url}.sig )" + + # Add in the mirror URL too. + SRC_URI+=" ${patch_url/${upstream_url_base}/${mirror_url_base}}" + SRC_URI+=" verify-sig? ( ${patch_url/${upstream_url_base}/${mirror_url_base}} )" - MY_PATCHES+=( "${DISTDIR}"/$(printf ${my_p}-%03d ${my_patch_index}) ) + MY_PATCHES+=( "${DISTDIR}"/${mangled_patch_ver} ) done - unset my_pn patch_url my_patch_index + unset my_p patch_url my_patch_index upstream_url_base mirror_url_base fi else SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" |
