Skip to content
Snippets Groups Projects
Verified Commit b4f81c1a authored by Karel Koci's avatar Karel Koci :metal: Committed by Josef Schlehofer
Browse files

updater: fix invalid shell read syntax

The IFS is for field separator not line separator thus it is used to
split read line to various variables not to read it field by field. As
an alternative separator variable is replaced by new line and thus can
be read directly line by line.
parent 8ed8eba6
No related merge requests found
......@@ -8,8 +8,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=l10n-supported
PKG_VERSION:=1.3
PKG_RELEASE:=5
PKG_VERSION:=1.3.1
PKG_RELEASE:=1
PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
......
......@@ -16,13 +16,13 @@ if ! uci -q get updater.l10n; then
fi
if [ -f "$bootstrap" ]; then
while IFS="," read -r lang; do
tr ',' '\n' < "$bootstrap" | while read -r lang; do
[ "$lang" != "en" ] || continue
uci -q batch <<-EOF
del_list updater.l10n.langs='$lang'
add_list updater.l10n.langs='$lang'
EOF
done < "$bootstrap"
done
rm -f "$bootstrap"
fi
......
......@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=pkglists
PKG_VERSION:=1.6.0
PKG_VERSION:=1.6.1
PKG_RELEASE:=1
PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
......
......@@ -10,7 +10,7 @@ set -eu
bootstrap="/usr/share/updater/bootstrap-pkgfiles"
if [ -f "$bootstrap" ]; then
while IFS="," read -r pkglist; do
tr ',' '\n' < "$bootstrap" | while read -r pkglist; do
name="${pkglist%%(*}"
options="${pkglist#*(}"; options="${options%)}"
uci -q batch <<-EOF
......@@ -20,11 +20,11 @@ if [ -f "$bootstrap" ]; then
EOF
if [ -n "$options" ]; then
uci set "pkglists.$name=$name"
echo "$options" | while IFS="|" read -r option; do
echo "$options" | tr '|' '\n' | while read -r option; do
uci set "pkglists.$name.$option=1"
done
uci commit "pkglists.$name"
fi
done < "$bootstrap"
done
rm -f "$bootstrap"
fi
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment