-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update-check: download each url once #6395
Conversation
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="$fetchedurls\n$url" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure that works:
$ a="Hello"
$ a="$a\nWorld"
$ echo "$a"
Hello\nWorld
There's a bashism for that:
$ a="Hello"
$ a="$a"$'\n'"World"
$ echo "$a"
Hello
World
But not sure if we want that. Opinions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happens to work because variable is used with printf
, not echo
, but it will break on %
in url.
What about literal newline and echo?
fetchedurls="$fetchedurls
$url"
echo "$fetchedurls" | …
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
printf is actually a good idea:
$ a=$(print "%s\n%s" "$a" "$b")
5a23f7b
to
6dc15bb
Compare
ping |
pong |
732b66d
to
ea8112b
Compare
I just now stumbled across this PR. Since
You could this way even store an error state (e.g. bad domain name, non-transient resolver error) and report that on a second try for the same |
ea8112b
to
f6dc1f0
Compare
Agreed, associative array is good idea here. However as errors aren't printed on first try, printing on second try would be strange. |
Speed up for packages with multiple downloads from same location or having homepage and distfiles at gitlab or github.