b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
2 | |||||
3 | sourcename="$1"; shift | ||||
4 | |||||
5 | for pkg in "$@"; do | ||||
6 | tar -Ozxf "$pkg" ./control.tar.gz 2>/dev/null | tar -Ozxf - ./control 2>/dev/null | \ | ||||
7 | while read field value; do | ||||
8 | if [ "$field" = "SourceName:" ] && [ "$value" = "$sourcename" ]; then | ||||
9 | rm -vf "$pkg" | ||||
10 | break | ||||
11 | fi | ||||
12 | done | ||||
13 | case "$pkg" in | ||||
14 | */"${sourcename}_"*.ipk) | ||||
15 | rm -vf "$pkg" | ||||
16 | ;; | ||||
17 | esac | ||||
18 | done | ||||
19 | |||||
20 | exit 0 |