scripts: ipkg-remove: handle existing .ipk files without SourceName field
authorJo-Philipp Wich <jo@mein.io>
Mon, 21 Jan 2019 15:35:40 +0000 (16:35 +0100)
committerJo-Philipp Wich <jo@mein.io>
Mon, 21 Jan 2019 15:35:40 +0000 (16:35 +0100)
Package archives built before commit e6bcf1e4ac
("build: add ABI_VERSION to binary package names") lack the SourceName
control file field which caused ipkg-remove to skip such archives.

Add fallback code that matches the files by their basename followed by
an underscore, similar to how the old cleanup code worked.

Fixes: #2067
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
scripts/ipkg-remove

index c0e0ec880f5b28188b5b05d293952a9a2cc892fd..f4957004c0ebcabba2b8d301c2888e555929f38b 100755 (executable)
@@ -10,6 +10,11 @@ for pkg in "$@"; do
                        break
                fi
        done
+       case "$pkg" in
+               */"${sourcename}_"*.ipk)
+                       rm -vf "$pkg"
+               ;;
+       esac
 done
 
 exit 0