Skip to content
Snippets Groups Projects
Commit d4597f7c authored by Kristian Klausen's avatar Kristian Klausen :tada:
Browse files

Fix that only the first attachment per task is downloaded

sort --unique combined with --numeric-sort only check if the first
number is unique ($task_id), which means that only the first attachment
is downloaded. Fixed by switching to uniq for filtering out duplicates.
parent 2ec5ff96
No related branches found
No related tags found
No related merge requests found
Pipeline #6254 canceled
......@@ -105,7 +105,7 @@ function download_attachments() {
echo "# Task id | Attachment id | Filename" > attachments/attachments.txt
fi
{ grep --extended-regexp --recursive --only-matching "href=\"https?://bugs.archlinux.org/(task/[0-9]+|)\?getfile=[0-9]+\"" || true; } | sed --regexp-extended 's/task\/([0-9]+).*getfile=([0-9]+)"/\1 \2/' | sort --numeric-sort --unique | while read -r line; do
{ grep --extended-regexp --recursive --only-matching "href=\"https?://bugs.archlinux.org/(task/[0-9]+|)\?getfile=[0-9]+\"" || true; } | sed --regexp-extended 's/task\/([0-9]+).*getfile=([0-9]+)"/\1 \2/' | sort --numeric-sort | uniq --unique | while read -r line; do
task_id="${line% *}"
attachment_id="${line#* }"
download_attachment "${task_id}" "${attachment_id}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment