From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] update-check: download each url once
Date: Tue, 11 Jun 2019 22:11:35 +0200 [thread overview]
Message-ID: <20190611201135.JB8mwn2PCoULSpJ-ZaIpunR7XrHPOxysM0Mlc8b5Qns@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-6395@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 466 bytes --]
There is an updated pull request by Chocimier against master on the void-packages repository
https://github.com/Chocimier/void-packages-org update-check-fetch-once
https://github.com/void-linux/void-packages/pull/6395
update-check: download each url once
Speed up for packages with multiple downloads from same location or having homepage and distfiles at gitlab or github.
A patch file from https://github.com/void-linux/void-packages/pull/6395.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-fetch-once-6395.patch --]
[-- Type: application/text/x-diff, Size: 1624 bytes --]
From f6dc1f0a5bcbaa426419263819592db2d03386bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Mon, 31 Dec 2018 12:34:10 +0100
Subject: [PATCH] update-check: download each url once
---
common/xbps-src/shutils/update_check.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e2cdee3d0fc..445600a2fe9 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -5,6 +5,7 @@ update_check() {
local update_override=$XBPS_SRCPKGDIR/$XBPS_TARGET_PKG/update
local original_pkgname=$pkgname
local urlpfx urlsfx
+ local -A fetchedurls
if [ -r $update_override ]; then
. $update_override
@@ -138,11 +139,19 @@ update_check() {
rx=${pattern:-$rx}
rx=${rx:-'(?<!-)\b\Q'"$pkgname"'\E[-_]?((src|source)[-_])?\K([^-/_\s]*?\d[^-/_\s]*?)(?=(?:[-_.](?:src|source|orig))?\.(?:[jt]ar|shar|t[bglx]z|tbz2|zip))\b'}
+ if [ "${fetchedurls[$url]}" ]; then
+ if [ -n "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
+ echo "already fetched $url" 1>&2
+ fi
+ continue
+ fi
+
if [ -n "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
echo "fetching $url" 1>&2
fi
curl -H 'Accept: text/html,application/xhtml+xml,application/xml,text/plain,application/rss+xml' -A "xbps-src-update-check/$XBPS_SRC_VERSION" --max-time 10 -Lsk "$url" |
grep -Po -i "$rx"
+ fetchedurls[$url]=yes
done |
tr _ . |
sort -Vu |
next prev parent reply other threads:[~2019-06-11 20:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-6395@inbox.vuxu.org>
2019-05-09 8:09 ` voidlinux-github
2019-05-09 8:09 ` voidlinux-github
2019-05-09 8:11 ` voidlinux-github
2019-05-09 8:11 ` voidlinux-github
2019-06-01 18:58 ` voidlinux-github
2019-06-01 18:59 ` voidlinux-github
2019-06-01 19:01 ` voidlinux-github
2019-06-11 20:11 ` voidlinux-github [this message]
2019-06-11 20:11 ` [PR PATCH] [Updated] " voidlinux-github
2019-06-11 20:15 ` voidlinux-github
2019-06-12 16:06 ` [PR PATCH] [Merged]: " voidlinux-github
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190611201135.JB8mwn2PCoULSpJ-ZaIpunR7XrHPOxysM0Mlc8b5Qns@z \
--to=voidlinux-github@inbox.vuxu.org \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).