aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/ipkg-remove
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/ipkg-remove')
-rwxr-xr-xscripts/ipkg-remove15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/ipkg-remove b/scripts/ipkg-remove
new file mode 100755
index 0000000000..c0e0ec880f
--- /dev/null
+++ b/scripts/ipkg-remove
@@ -0,0 +1,15 @@
+#!/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
+done
+
+exit 0