commit de922d98cc49885762b0ae94e8001771413c855e
parent d12e6b3f58677f132a4497298e49203130b261f9
Author: Dylan Araps <dylan.araps@gmail.com>
Date: Wed, 22 Apr 2020 07:45:58 +0300
kiss: Abort install if file missing in manifest
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/kiss b/kiss
@@ -983,6 +983,12 @@ pkg_install() {
[ -f "$tar_dir/$pkg_name/$pkg_db/$pkg_name/manifest" ] ||
die "'${tar_file##*/}' is not a valid KISS package"
+ # Ensure that the tarball's manifest is correct by checking that
+ # each file and directory inside of it actually exists.
+ while read -r line; do [ -e "$tar_dir/$pkg_name/$line" ] ||
+ die "File $line missing from tarball but mentioned in manifest"
+ done < "$tar_dir/$pkg_name/$pkg_db/$pkg_name/manifest"
+
# Make sure that all run-time dependencies are installed prior to
# installing the package.
[ -f "$tar_dir/$pkg_name/$pkg_db/$pkg_name/depends" ] &&