summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-06-02 19:06:23 +0100
committerSam James <sam@gentoo.org>2023-06-02 19:39:05 +0100
commitaeada12dd9d9c0008a73a59fd37578abf3fc1f6a (patch)
tree76ab160cf568426a2a887121ba5da5386475be21 /sys-libs/ncurses
parentapp-emulation/virtualbox: fix building with dev-libs/libxml2-2.11 (diff)
downloadgentoo-aeada12dd9d9c0008a73a59fd37578abf3fc1f6a.tar.gz
gentoo-aeada12dd9d9c0008a73a59fd37578abf3fc1f6a.tar.bz2
gentoo-aeada12dd9d9c0008a73a59fd37578abf3fc1f6a.zip
sys-libs/ncurses: optimise SRC_URI generation
Thanks to radhermit's new tooling. Before: ``` sys-libs/ncurses-6.4_p20230401::.: 33.232636ms sys-libs/ncurses-6.4_p20230527::.: 55.257908ms sys-libs/ncurses-6.3_p20221203-r2::.: 137.523679ms ``` After: ``` sys-libs/ncurses-6.4_p20230401::.: 9.66169ms sys-libs/ncurses-6.4_p20230527::.: 10.019753ms sys-libs/ncurses-6.3_p20221203-r2::.: 11.878338ms ``` Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-libs/ncurses')
-rw-r--r--sys-libs/ncurses/ncurses-6.3_p20221203-r2.ebuild52
-rw-r--r--sys-libs/ncurses/ncurses-6.4_p20230401.ebuild52
-rw-r--r--sys-libs/ncurses/ncurses-6.4_p20230527.ebuild52
3 files changed, 72 insertions, 84 deletions
diff --git a/sys-libs/ncurses/ncurses-6.3_p20221203-r2.ebuild b/sys-libs/ncurses/ncurses-6.3_p20221203-r2.ebuild
index fd7f1fc9cb67..49ffaefaa688 100644
--- a/sys-libs/ncurses/ncurses-6.3_p20221203-r2.ebuild
+++ b/sys-libs/ncurses/ncurses-6.3_p20221203-r2.ebuild
@@ -105,36 +105,32 @@ if [[ ${PV} == *_p* ]] ; then
)
if [[ -z ${PATCH_DATES[@]} ]] ; then
- SRC_URI+=" https://invisible-island.net/archives/${PN}/${PV/_p*}/${P/_p/-}.patch.sh.gz"
- SRC_URI+=" verify-sig? ( https://invisible-island.net/archives/${PN}/${PV/_p*}/${P/_p/-}.patch.sh.gz.asc"
+ SRC_URI+=" https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P/_p/-}.patch.sh.gz"
+ SRC_URI+=" verify-sig? ( https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P/_p/-}.patch.sh.gz.asc"
# If we have a rollup patch, use that instead of the individual ones.
- UPSTREAM_PATCHES+=( "${WORKDIR}"/${P/_p/-}-patch.sh )
+ UPSTREAM_PATCHES+=( patch.sh )
else
- patch_url=
- my_patch_index=
-
- # We keep a bunch of mirrors here as we've had reports of invisible*.net
- # being 403 forbidden for some users.
- urls=(
- "https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P}-%s"
- "https://invisible-mirror.net/archives/${PN}/${PV/_p*}/${MY_P}-%s"
- "https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${MY_P}-%s"
- )
-
- for ((my_patch_index=0; my_patch_index < "${#PATCH_DATES[@]}"; my_patch_index++)); do
- for url in "${urls[@]}" ; do
- patch_url="$(printf ${urls} ${PATCH_DATES[${my_patch_index}]}.patch.gz)"
- SRC_URI+=" ${patch_url}"
- SRC_URI+=" verify-sig? ( ${patch_url}.asc )"
- done
-
- UPSTREAM_PATCHES+=( "${WORKDIR}"/${MY_P}-${PATCH_DATES[${my_patch_index}]}.patch )
- done
-
- unset patch_url
- unset my_patch_index
- unset urls
+ # We use a mirror as well because we've had reports of 403 forbidden for some users.
+ upstream_url_base="https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P}-"
+ upstream_m_url_base="https://invisible-mirror.net/archives/${PN}/${PV/_p*}/${MY_P}-"
+
+ # Prefix each date with the upstream location (https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P})
+ mangled_patches=( "${PATCH_DATES[@]/#/${upstream_url_base}}" )
+ # Suffix each with .patch.gz
+ mangled_patches=( "${mangled_patches[@]/%/.patch.gz}" )
+ mangled_patches_sig=( "${mangled_patches[@]/%/.asc}" )
+ # Repeat for .patch.gz.asc for verify-sig
+ SRC_URI+=" ${mangled_patches[@]}"
+ SRC_URI+=" verify-sig? ( ${mangled_patches_sig[@]} )"
+
+ # For all of the URLs, chuck in invisible-island.net too:
+ SRC_URI+=" ${mangled_patches[@]/${upstream_url_base}/${upstream_m_url_base}}"
+ SRC_URI+=" verify-sig? ( ${mangled_patches_sig[@]/${upstream_url_base}/${upstream_m_url_base}} )"
+
+ UPSTREAM_PATCHES=( "${PATCH_DATES[@]/%/.patch}" )
+
+ unset upstream_url_base upstream_m_url_base mangled_patches mangled_patches_sig
fi
SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${GENTOO_PATCH_NAME}.tar.xz"
@@ -159,7 +155,7 @@ BDEPEND="verify-sig? ( sec-keys/openpgp-keys-thomasdickey )"
S="${WORKDIR}/${MY_P}"
PATCHES=(
- "${UPSTREAM_PATCHES[@]}"
+ "${UPSTREAM_PATCHES[@]/#/${WORKDIR}/${MY_P}-}"
# When rebasing Gentoo's patchset, please use git from a clean
# src_prepare with upstream patches already applied. git am --reject
diff --git a/sys-libs/ncurses/ncurses-6.4_p20230401.ebuild b/sys-libs/ncurses/ncurses-6.4_p20230401.ebuild
index d5ee5d28cc97..0d8e53d2c0e1 100644
--- a/sys-libs/ncurses/ncurses-6.4_p20230401.ebuild
+++ b/sys-libs/ncurses/ncurses-6.4_p20230401.ebuild
@@ -54,36 +54,32 @@ if [[ ${PV} == *_p* ]] ; then
)
if [[ -z ${PATCH_DATES[@]} ]] ; then
- SRC_URI+=" https://invisible-island.net/archives/${PN}/${PV/_p*}/${P/_p/-}.patch.sh.gz"
- SRC_URI+=" verify-sig? ( https://invisible-island.net/archives/${PN}/${PV/_p*}/${P/_p/-}.patch.sh.gz.asc"
+ SRC_URI+=" https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P/_p/-}.patch.sh.gz"
+ SRC_URI+=" verify-sig? ( https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P/_p/-}.patch.sh.gz.asc"
# If we have a rollup patch, use that instead of the individual ones.
- UPSTREAM_PATCHES+=( "${WORKDIR}"/${P/_p/-}-patch.sh )
+ UPSTREAM_PATCHES+=( patch.sh )
else
- patch_url=
- my_patch_index=
-
- # We keep a bunch of mirrors here as we've had reports of invisible*.net
- # being 403 forbidden for some users.
- urls=(
- "https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P}-%s"
- "https://invisible-mirror.net/archives/${PN}/${PV/_p*}/${MY_P}-%s"
- "https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${MY_P}-%s"
- )
-
- for ((my_patch_index=0; my_patch_index < "${#PATCH_DATES[@]}"; my_patch_index++)); do
- for url in "${urls[@]}" ; do
- patch_url="$(printf ${urls} ${PATCH_DATES[${my_patch_index}]}.patch.gz)"
- SRC_URI+=" ${patch_url}"
- SRC_URI+=" verify-sig? ( ${patch_url}.asc )"
- done
-
- UPSTREAM_PATCHES+=( "${WORKDIR}"/${MY_P}-${PATCH_DATES[${my_patch_index}]}.patch )
- done
-
- unset patch_url
- unset my_patch_index
- unset urls
+ # We use a mirror as well because we've had reports of 403 forbidden for some users.
+ upstream_url_base="https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P}-"
+ upstream_m_url_base="https://invisible-mirror.net/archives/${PN}/${PV/_p*}/${MY_P}-"
+
+ # Prefix each date with the upstream location (https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P})
+ mangled_patches=( "${PATCH_DATES[@]/#/${upstream_url_base}}" )
+ # Suffix each with .patch.gz
+ mangled_patches=( "${mangled_patches[@]/%/.patch.gz}" )
+ mangled_patches_sig=( "${mangled_patches[@]/%/.asc}" )
+ # Repeat for .patch.gz.asc for verify-sig
+ SRC_URI+=" ${mangled_patches[@]}"
+ SRC_URI+=" verify-sig? ( ${mangled_patches_sig[@]} )"
+
+ # For all of the URLs, chuck in invisible-island.net too:
+ SRC_URI+=" ${mangled_patches[@]/${upstream_url_base}/${upstream_m_url_base}}"
+ SRC_URI+=" verify-sig? ( ${mangled_patches_sig[@]/${upstream_url_base}/${upstream_m_url_base}} )"
+
+ UPSTREAM_PATCHES=( "${PATCH_DATES[@]/%/.patch}" )
+
+ unset upstream_url_base upstream_m_url_base mangled_patches mangled_patches_sig
fi
fi
@@ -110,7 +106,7 @@ BDEPEND="verify-sig? ( sec-keys/openpgp-keys-thomasdickey )"
S="${WORKDIR}/${MY_P}"
PATCHES=(
- "${UPSTREAM_PATCHES[@]}"
+ "${UPSTREAM_PATCHES[@]/#/${WORKDIR}/${MY_P}-}"
# When rebasing Gentoo's patchset, please use git from a clean
# src_prepare with upstream patches already applied. git am --reject
diff --git a/sys-libs/ncurses/ncurses-6.4_p20230527.ebuild b/sys-libs/ncurses/ncurses-6.4_p20230527.ebuild
index 7f0aa8fa0754..460f89a85065 100644
--- a/sys-libs/ncurses/ncurses-6.4_p20230527.ebuild
+++ b/sys-libs/ncurses/ncurses-6.4_p20230527.ebuild
@@ -67,36 +67,32 @@ if [[ ${PV} == *_p* ]] ; then
)
if [[ -z ${PATCH_DATES[@]} ]] ; then
- SRC_URI+=" https://invisible-island.net/archives/${PN}/${PV/_p*}/${P/_p/-}.patch.sh.gz"
- SRC_URI+=" verify-sig? ( https://invisible-island.net/archives/${PN}/${PV/_p*}/${P/_p/-}.patch.sh.gz.asc"
+ SRC_URI+=" https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P/_p/-}.patch.sh.gz"
+ SRC_URI+=" verify-sig? ( https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P/_p/-}.patch.sh.gz.asc"
# If we have a rollup patch, use that instead of the individual ones.
- UPSTREAM_PATCHES+=( "${WORKDIR}"/${P/_p/-}-patch.sh )
+ UPSTREAM_PATCHES+=( patch.sh )
else
- patch_url=
- my_patch_index=
-
- # We keep a bunch of mirrors here as we've had reports of invisible*.net
- # being 403 forbidden for some users.
- urls=(
- "https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P}-%s"
- "https://invisible-mirror.net/archives/${PN}/${PV/_p*}/${MY_P}-%s"
- "https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${MY_P}-%s"
- )
-
- for ((my_patch_index=0; my_patch_index < "${#PATCH_DATES[@]}"; my_patch_index++)); do
- for url in "${urls[@]}" ; do
- patch_url="$(printf ${urls} ${PATCH_DATES[${my_patch_index}]}.patch.gz)"
- SRC_URI+=" ${patch_url}"
- SRC_URI+=" verify-sig? ( ${patch_url}.asc )"
- done
-
- UPSTREAM_PATCHES+=( "${WORKDIR}"/${MY_P}-${PATCH_DATES[${my_patch_index}]}.patch )
- done
-
- unset patch_url
- unset my_patch_index
- unset urls
+ # We use a mirror as well because we've had reports of 403 forbidden for some users.
+ upstream_url_base="https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P}-"
+ upstream_m_url_base="https://invisible-mirror.net/archives/${PN}/${PV/_p*}/${MY_P}-"
+
+ # Prefix each date with the upstream location (https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P})
+ mangled_patches=( "${PATCH_DATES[@]/#/${upstream_url_base}}" )
+ # Suffix each with .patch.gz
+ mangled_patches=( "${mangled_patches[@]/%/.patch.gz}" )
+ mangled_patches_sig=( "${mangled_patches[@]/%/.asc}" )
+ # Repeat for .patch.gz.asc for verify-sig
+ SRC_URI+=" ${mangled_patches[@]}"
+ SRC_URI+=" verify-sig? ( ${mangled_patches_sig[@]} )"
+
+ # For all of the URLs, chuck in invisible-island.net too:
+ SRC_URI+=" ${mangled_patches[@]/${upstream_url_base}/${upstream_m_url_base}}"
+ SRC_URI+=" verify-sig? ( ${mangled_patches_sig[@]/${upstream_url_base}/${upstream_m_url_base}} )"
+
+ UPSTREAM_PATCHES=( "${PATCH_DATES[@]/%/.patch}" )
+
+ unset upstream_url_base upstream_m_url_base mangled_patches mangled_patches_sig
fi
fi
@@ -123,7 +119,7 @@ BDEPEND="verify-sig? ( sec-keys/openpgp-keys-thomasdickey )"
S="${WORKDIR}/${MY_P}"
PATCHES=(
- "${UPSTREAM_PATCHES[@]}"
+ "${UPSTREAM_PATCHES[@]/#/${WORKDIR}/${MY_P}-}"
# When rebasing Gentoo's patchset, please use git from a clean
# src_prepare with upstream patches already applied. git am --reject