mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-01-28 03:37:17 +01:00
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
The script always gets passed the package name, not the source name.
Optimize for the default case where the package name matches the
filename prefix.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 471fd0a502)
27 lines
564 B
Bash
Executable file
27 lines
564 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
sourcename="$1"; shift
|
|
|
|
for pkg in "$@"; do
|
|
case "$pkg" in
|
|
*/"${sourcename}_"*.ipk)
|
|
rm -vf "$pkg"
|
|
;;
|
|
*)
|
|
tar -Ozxf "$pkg" ./control.tar.gz 2>/dev/null | tar -Ozxf - ./control 2>/dev/null | {
|
|
packagename=
|
|
abiversion=
|
|
while read field value; do
|
|
case "$field" in
|
|
Package:) packagename="$value";;
|
|
ABIVersion:) abiversion="$value";;
|
|
esac
|
|
done
|
|
[ -n "$abiversion" ] && packagename="${packagename%%$abiversion}"
|
|
[ "$packagename" = "$sourcename" ] && rm -vf "$pkg"
|
|
}
|
|
;;
|
|
esac
|
|
done
|
|
|
|
exit 0
|