sqg: Remove duplicate lines in custom queue.

Signed-off-by: Willy Sudiarto Raharjo <willysr@sbopkg.org>
This commit is contained in:
Willy Sudiarto Raharjo 2022-10-15 19:00:13 +07:00
parent 8bf4e6a23a
commit 720a874d60
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
2 changed files with 8 additions and 1 deletions

View File

@ -199,6 +199,11 @@ build_queuefile_custom () {
fi
done
)
# Remove all duplicates while preserving the order of lines
# Reference: https://unix.stackexchange.com/questions/194780/remove-duplicate-lines-while-keeping-the-order-of-the-lines
cat -n "$QUEUEDIR/$QUEUENAME.sqf" | sort -k2 | uniq -f1 | sort -k1 | cut -f2- > "$QUEUEDIR/$QUEUENAME.tmp"
mv "$QUEUEDIR/$QUEUENAME.tmp" "$QUEUEDIR/$QUEUENAME.sqf"
}
#

View File

@ -1,10 +1,12 @@
SBOPKG NEWS
sbopkg-devel (2022-03-16 11:56 UTC)
sbopkg-devel (2022-10-15 11:59 UTC)
MODIFICATIONS
* Update renames
* sqg: Fix repo detection when people switch from stable to master or vice versa
Patch by Jeremy Hansen (#77)
* sqg: Fix duplicate lines when executing custom queue (partial fix for #83)
Reported by Jeremy Hansen
sbopkg 0.38.2 (2022-03-10 16:29 UTC)
FEATURES