Files
openwrt-19.07/scripts/ipkg-remove
2025-06-24 16:03:39 +02:00

21 lines
373 B
Bash
Executable File

#!/usr/bin/env bash
sourcename="$1"; shift
for pkg in "$@"; do
tar -Ozxf "$pkg" ./control.tar.gz 2>/dev/null | tar -Ozxf - ./control 2>/dev/null | \
while read field value; do
if [ "$field" = "SourceName:" ] && [ "$value" = "$sourcename" ]; then
rm -vf "$pkg"
break
fi
done
case "$pkg" in
*/"${sourcename}_"*.ipk)
rm -vf "$pkg"
;;
esac
done
exit 0