Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions exports/taskfiles/utils/remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ tasks:
# @param {string} FILE_SHA256 Content hash to verify the downloaded tar file against.
# @param {string} [CHECKSUM_FILE={{.OUTPUT_DIR}}.md5] File path to store the checksum of the
# downloaded tar file.
# @param {string[]} [CHECKSUM_EXCLUDE_PATTERNS] Path wildcard patterns, relative to `OUTPUT_DIR`,
# to exclude from the checksum.
Comment on lines +61 to +62
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, are they relative to OUTPUT_DIR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, CHECKSUM_EXCLUDE_PATTERNS is relative to OUTPUT_DIR. By looking at the checksum:validate task's docstring:

# @param {string[]} [EXCLUDE_PATTERNS] Path wildcard patterns, relative to any `INCLUDE_PATTERNS`,
# to exclude from the checksum.

Since OUTPUT_DIR is passed as one of the INCLUDE_PATTERNS to the checksum tasks, and the docstring states that EXCLUDE_PATTERNS are "relative to any INCLUDE_PATTERNS", the CHECKSUM_EXCLUDE_PATTERNS are indeed relative to OUTPUT_DIR.

or are you saying that this can be better expressed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, no, I just got confused with INCLUDE_PATTERNS.

# @param {string[]} [EXCLUDE_PATTERNS] Path wildcard patterns that should not be extracted.
# @param {string[]} [INCLUDE_PATTERNS] Path wildcard patterns to extract.
# @param {int} [NUM_COMPONENTS_TO_STRIP=1] Number of leading path components to strip from the
Expand All @@ -74,6 +76,8 @@ tasks:
{{default (printf "%s.tar.gz" .OUTPUT_DIR) .TAR_FILE}}

# Path patterns
CHECKSUM_EXCLUDE_PATTERNS:
ref: "default (list) .CHECKSUM_EXCLUDE_PATTERNS"
EXCLUDE_PATTERNS:
ref: "default (list) .EXCLUDE_PATTERNS"
INCLUDE_PATTERNS:
Expand All @@ -97,6 +101,8 @@ tasks:
vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"]
EXCLUDE_PATTERNS:
ref: ".CHECKSUM_EXCLUDE_PATTERNS"
cmds:
- |-
rm -rf "{{.OUTPUT_DIR}}"
Expand All @@ -123,6 +129,8 @@ tasks:
vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"]
EXCLUDE_PATTERNS:
ref: ".CHECKSUM_EXCLUDE_PATTERNS"

# Uses curl to download a zip file from the given URL and extracts its contents.
#
Expand All @@ -131,6 +139,8 @@ tasks:
# @param {string} FILE_SHA256 Content hash to verify the downloaded zip file against.
# @param {string} [CHECKSUM_FILE={{.OUTPUT_DIR}}.md5] File path to store the checksum of the
# downloaded zip file.
# @param {string[]} [CHECKSUM_EXCLUDE_PATTERNS] Path wildcard patterns, relative to `OUTPUT_DIR`,
# to exclude from the checksum.
# @param {string[]} [EXCLUDE_PATTERNS] Path wildcard patterns that should not be extracted.
# @param {string[]} [INCLUDE_PATTERNS] Path wildcard patterns to extract.
# @param {string} [ZIP_FILE={{.OUTPUT_DIR}}.zip] Path where the zip file should be stored.
Expand All @@ -145,6 +155,8 @@ tasks:
{{default (printf "%s.zip" .OUTPUT_DIR) .ZIP_FILE}}

# Path patterns
CHECKSUM_EXCLUDE_PATTERNS:
ref: "default (list) .CHECKSUM_EXCLUDE_PATTERNS"
EXCLUDE_PATTERNS:
ref: "default (list) .EXCLUDE_PATTERNS"
INCLUDE_PATTERNS:
Expand All @@ -164,6 +176,8 @@ tasks:
vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"]
EXCLUDE_PATTERNS:
ref: ".CHECKSUM_EXCLUDE_PATTERNS"
cmds:
- |-
rm -rf "{{.OUTPUT_DIR}}"
Expand All @@ -185,3 +199,5 @@ tasks:
vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"]
EXCLUDE_PATTERNS:
ref: ".CHECKSUM_EXCLUDE_PATTERNS"