Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: Re: update-check: download each url once
Date: Sat, 01 Jun 2019 20:59:56 +0200	[thread overview]
Message-ID: <20190601185956.3B02A-DavK8pSF9SDWsNqynDa87OR1R4idsl-XrX5Tg@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: 740 bytes --]

New comment by pullmoll on void-packages repository

https://github.com/void-linux/void-packages/pull/6395#issuecomment-497969538
Comment:
I just now stumbled across this PR. Since `xbps-src` expects `bash` I think you could simplify the code by using an associative array of URLs. Something along the lines:
```
local -A fetchedurls
…
        if [ "${fechedurls[$url]}" = "ok" ]; then
            if [ -n "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
                echo "already fetched $url" 1>&2
            fi
            continue
        fi
        …
        fetchedurls[$url]="ok"
```

You could this way even store an error state (e.g. wrong or missing checksum) and report that on a second try for the same `$url`.

  parent reply	other threads:[~2019-06-01 18:59 UTC|newest]

Thread overview: 10+ 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 ` [PR PATCH] [Updated] " voidlinux-github
2019-05-09  8:09 ` voidlinux-github
2019-05-09  8:11 ` voidlinux-github
2019-06-01 18:58 ` voidlinux-github
2019-06-01 18:59 ` voidlinux-github [this message]
2019-06-01 19:01 ` voidlinux-github
2019-06-11 20:11 ` [PR PATCH] [Updated] " voidlinux-github
2019-06-11 20:11 ` 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=20190601185956.3B02A-DavK8pSF9SDWsNqynDa87OR1R4idsl-XrX5Tg@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).