Skip to content

Commit 4bac2e2

Browse files
committed
add error check to legacy scripts, only get seconds
1 parent 3439404 commit 4bac2e2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

post-fs-data.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ API=
66
IS64BIT=
77
libdir=
88
set -x 2>$MODPATH/debug.log
9-
echo `date`
9+
echo `date +%S`
1010
moddir=$(dirname $MODPATH)
1111
amldir=/data/adb/aml
1212

@@ -200,11 +200,11 @@ prop_process() {
200200
}
201201
legacy_script() {
202202
local RUNONCE=false COUNT=1 LIBDIR=$libdir/lib/soundfx MOD=$mod
203-
. $mod/.aml.sh
203+
(. $mod/.aml.sh) || echo "Error in $modname aml.sh script" >> $MODPATH/errors.txt
204204
for file in $files; do
205205
local NAME=$(echo "$file" | sed "s|$mod|system|")
206206
$RUNONCE || { case $file in
207-
*audio_effects*) . $mod/.aml.sh; COUNT=$(($COUNT + 1));;
207+
*audio_effects*) (. $mod/.aml.sh) || [ "$(grep -x "$modname" $MODPATH/errors.txt)" ] || echo "Error in $modname aml.sh script" >> $MODPATH/errors.txt; COUNT=$(($COUNT + 1));;
208208
esac; }
209209
done
210210
}
@@ -237,7 +237,7 @@ for mod in $(find $moddir/* -maxdepth 0 -type d); do
237237
xxd -p $libfile | tr -d '\n' | grep -q "$hexuuid"
238238
[ $? -eq 0 ] || continue
239239
builtin=true
240-
echo "$modname" >> $amldir/modlist
240+
[ "$(grep -x "$modname" $amldir/modlist)" ] || echo "$modname" >> $amldir/modlist
241241
files=$(find $mod/system -type f -name "*audio_effects*.conf" -o -name "*audio_effects*.xml" -o -name "*audio_*policy*.conf" -o -name "*audio_*policy*.xml" -o -name "*mixer_paths*.xml" -o -name "*mixer_gains*.xml" -o -name "*audio_device*.xml" -o -name "*sapa_feature*.xml" -o -name "*audio_platform_info*.xml" -o -name "*audio_configs*.xml" -o -name "*audio_device*.xml")
242242
for file in $files; do
243243
cp_mv -m $file $amldir/$modname/$(echo "$file" | sed "s|$mod/||")
@@ -250,7 +250,7 @@ for mod in $(find $moddir/* -maxdepth 0 -type d); do
250250
done
251251
if ! $builtin; then
252252
files=$(find $mod/system -type f -name "*audio_effects*.conf" -o -name "*audio_effects*.xml" -o -name "*audio_*policy*.conf" -o -name "*audio_*policy*.xml" -o -name "*mixer_paths*.xml" -o -name "*mixer_gains*.xml" -o -name "*audio_device*.xml" -o -name "*sapa_feature*.xml" -o -name "*audio_platform_info*.xml" -o -name "*audio_configs*.xml" -o -name "*audio_device*.xml")
253-
[ "$files" ] && echo "$modname" >> $amldir/modlist
253+
[ "$files" ] && [ ! "$(grep -x "$modname" $amldir/modlist)" ] && echo "$modname" >> $amldir/modlist
254254
for file in $files; do
255255
cp_mv -m $file $amldir/$modname/$(echo "$file" | sed "s|$mod/||")
256256
done
@@ -272,5 +272,5 @@ if [ -d $MODPATH/system/vendor ]; then
272272
set_perm_recursive $MODPATH/system/vendor 0 0 0755 0644 u:object_r:vendor_file:s0
273273
[ -d $MODPATH/system/vendor/etc ] && set_perm_recursive $MODPATH/system/vendor/etc 0 0 0755 0644 u:object_r:vendor_configs_file:s0
274274
fi
275-
echo `date`
275+
echo `date +%S`
276276
exit 0

0 commit comments

Comments
 (0)