From 2e79ec5aef4c270f79ef19185193313d40900ea3 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Sun, 22 Nov 2020 16:03:06 +0000 Subject: [PATCH] Revert "update scripts/bin/update-whatprovides-db" This reverts commit f493a38d3d93f9c7726d2f83e2fdd14a1abcd6f2. Script is broken in last update, at least it no longer able to process debfiles with very large amount of files. --- packages/whatprovides/build.sh | 2 -- scripts/bin/update-whatprovides-db | 12 +++--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/packages/whatprovides/build.sh b/packages/whatprovides/build.sh index 4f38500c7..27329f562 100644 --- a/packages/whatprovides/build.sh +++ b/packages/whatprovides/build.sh @@ -9,8 +9,6 @@ TERMUX_PKG_DEPENDS="bash, coreutils, curl, gawk, gzip, sqlite" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_PLATFORM_INDEPENDENT=true -# Remember to update ../../scripts/bin/update-whatprovides-db - termux_step_create_debscripts() { cat <<- EOF > ./postinst #!${TERMUX_PREFIX}/bin/sh diff --git a/scripts/bin/update-whatprovides-db b/scripts/bin/update-whatprovides-db index cbec8be41..a542b9eff 100755 --- a/scripts/bin/update-whatprovides-db +++ b/scripts/bin/update-whatprovides-db @@ -3,7 +3,7 @@ ## Script that generates or updates a Whatprovides ## database for Termux. ## -## Copy of https://github.com/termux/whatprovides/blob/8fdd508949e754e8ea758e8c1b3c063e41cce3f2/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. ## @@ -12,15 +12,9 @@ set -e -u DEBS_DIR_PATH=$(realpath "$(dirname "$0")/../../debs") list_files() { - FILES=$(dpkg-deb --fsys-tarfile "${1}" | tar -t | cut -b2- \ + 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)?)?)?') - SORTKEYS='-k1,1' - for ((x=2; x<=$(wc -L <<< "${FILES//[^\/$'\n']/}")+1; x++)); do - SORTKEYS="$SORTKEYS -k$x,$x" - done - sort -t/ $SORTKEYS <<< "$FILES" \ - | awk 'NR == 1 { p=$0; next } substr($0, 1, length(p) +1 ) != p"/" { print p } { p=$0 } END { print p }' + | grep -vEx '[./]|/data(/data(/com\.termux(/files)?)?)?' } write_sql_script() {