diff --git a/scripts/bin/update-whatprovides-db b/scripts/bin/update-whatprovides-db index c8dd21bff..a542b9eff 100755 --- a/scripts/bin/update-whatprovides-db +++ b/scripts/bin/update-whatprovides-db @@ -3,19 +3,18 @@ ## Script that generates or updates a Whatprovides ## database for Termux. ## -## Copy of https://github.com/termux/whatprovides/blob/9afbbb72de1d89aae835d5581cef09741ff3fd10/update-whatprovides-db.sh +## Copy of https://github.com/termux/whatprovides/blob/96a9fd100a84af1bf2fd3fbeedbaab082381f5e8/update-whatprovides-db.sh ## but edited for special use in termux-packages. ## set -e -u -: "${TERMUX_PREFIX:="/data/data/com.termux/files/usr"}" DEBS_DIR_PATH=$(realpath "$(dirname "$0")/../../debs") 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="/data/data/com.termux/files/usr" -- \ + | grep -vEx '[./]|/data(/data(/com\.termux(/files)?)?)?' } write_sql_script() {