termux-tools: termux-info: do not attempt to list sources.list.d if not available
This commit is contained in:
parent
b89f1a8225
commit
0f0c92dd3f
@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://termux.com/
|
||||
TERMUX_PKG_DESCRIPTION="Basic system tools for Termux"
|
||||
TERMUX_PKG_LICENSE="GPL-3.0"
|
||||
TERMUX_PKG_MAINTAINER="@termux"
|
||||
TERMUX_PKG_VERSION=0.142
|
||||
TERMUX_PKG_VERSION=0.143
|
||||
TERMUX_PKG_SKIP_SRC_EXTRACT=true
|
||||
TERMUX_PKG_PLATFORM_INDEPENDENT=true
|
||||
TERMUX_PKG_ESSENTIAL=true
|
||||
|
@ -32,20 +32,22 @@ repo_subscriptions() {
|
||||
echo "$main_sources"
|
||||
fi
|
||||
|
||||
local filename repo_package supl_sources
|
||||
while read -r filename; do
|
||||
repo_package=$(dpkg -S "$filename" 2>/dev/null | cut -d : -f 1)
|
||||
supl_sources=$(grep -P '^\s*deb\s' "$filename")
|
||||
if [ -d "@TERMUX_PREFIX@/etc/apt/sources.list.d" ]; then
|
||||
local filename repo_package supl_sources
|
||||
while read -r filename; do
|
||||
repo_package=$(dpkg -S "$filename" 2>/dev/null | cut -d : -f 1)
|
||||
supl_sources=$(grep -P '^\s*deb\s' "$filename")
|
||||
|
||||
if [ -n "$supl_sources" ]; then
|
||||
if [ -n "$repo_package" ]; then
|
||||
echo "# $repo_package (sources.list.d/$(basename "$filename"))"
|
||||
else
|
||||
echo "# sources.list.d/$(basename "$filename")"
|
||||
if [ -n "$supl_sources" ]; then
|
||||
if [ -n "$repo_package" ]; then
|
||||
echo "# $repo_package (sources.list.d/$(basename "$filename"))"
|
||||
else
|
||||
echo "# sources.list.d/$(basename "$filename")"
|
||||
fi
|
||||
echo "$supl_sources"
|
||||
fi
|
||||
echo "$supl_sources"
|
||||
fi
|
||||
done < <(find "@TERMUX_PREFIX@/etc/apt/sources.list.d" -maxdepth 1 ! -type d)
|
||||
done < <(find "@TERMUX_PREFIX@/etc/apt/sources.list.d" -maxdepth 1 ! -type d)
|
||||
fi
|
||||
}
|
||||
|
||||
output=""
|
||||
|
Loading…
Reference in New Issue
Block a user