db builder: allow files outside of $PREFIX

just in case!
This commit is contained in:
Lucy Phipps 2020-11-21 23:59:29 +00:00 committed by Leonid Pliushch
parent 9afbbb72de
commit 96a9fd100a
1 changed files with 3 additions and 3 deletions

View File

@ -9,9 +9,9 @@ set -e -u
: "${TERMUX_PREFIX:="/data/data/com.termux/files/usr"}"
list_files() {
dpkg-deb -c "${1}" | grep -o "${TERMUX_PREFIX//./\\.}/.\+" \
| sed -E 's@(.*) ->..*@\1@g;s@/$@@g' \
| xargs -rd\\n realpath -sm --relative-base="$TERMUX_PREFIX" --
dpkg-deb --fsys-tarfile "${1}" | tar -t | cut -b2- \
| xargs -rd\\n realpath -sm --relative-base="$TERMUX_PREFIX" -- \
| grep -vEx '[./]|/data(/data(/com\.termux(/files)?)?)?'
}
write_sql_script() {