MinMicroG/conf/config.txt

67 lines
2.6 KiB
Plaintext
Raw Normal View History

2019-11-12 18:57:20 +00:00
user_conf() {
for dir in "$(dirname "$0")" "$(dirname "$zipfile")" "$moddir" "/data/adb"; do
[ -f "$dir/includelist.txt" ] || [ -f "$dir/excludelist.txt" ] && {
2019-11-12 18:57:20 +00:00
ui_print " ";
if [ -f "$dir/includelist.txt" ]; then
2019-11-12 18:57:20 +00:00
ui_print "Processing include config from $dir...";
2020-03-07 07:24:03 +00:00
includelist="$(cat "$dir/includelist.txt" | sed -e 's|\#.*||g' -e 's|[^a-zA-Z0-9.-]| |g')";
else
2019-11-12 18:57:20 +00:00
ui_print "Processing exclude config from $dir...";
2020-03-07 07:24:03 +00:00
excludelist="$(cat "$dir/excludelist.txt" | sed -e 's|\#.*||g' -e 's|[^a-zA-Z0-9.-]| |g')";
fi;
2019-11-12 18:57:20 +00:00
break;
}
done;
[ "$includelist" ] && {
new_stuff="";
new_stuff_arch="";
new_stuff_sdk="";
new_stuff_arch_sdk="";
for include in $includelist; do
2019-11-12 18:57:20 +00:00
log "Including keyword $include";
new_stuff="$new_stuff $(echo "$stuff" | grep -oi "[ ]*[^ ]*$include[^ ]*[ ]*")";
new_stuff_arch="$new_stuff_arch $(echo "$stuff_arch" | grep -oi "[ ]*[^ ]*$include[^ ]*[ ]*")";
new_stuff_sdk="$new_stuff_sdk $(echo "$stuff_sdk" | grep -oi "[ ]*[^ ]*$include[^ ]*[ ]*")";
new_stuff_arch_sdk="$new_stuff_arch_sdk $(echo "$stuff_arch_sdk" | grep -oi "[ ]*[^ ]*$include[^ ]*[ ]*")";
done;
stuff="$new_stuff";
stuff_arch="$new_stuff_arch";
stuff_sdk="$new_stuff_sdk";
stuff_arch_sdk="$new_stuff_arch_sdk";
}
[ "$excludelist" ] && {
new_stuff="$stuff";
new_stuff_arch="$stuff_arch";
new_stuff_sdk="$stuff_sdk";
new_stuff_arch_sdk="$stuff_arch_sdk";
for exclude in $excludelist; do
2019-11-12 18:57:20 +00:00
log "Including keyword $include";
new_stuff="$(echo "$new_stuff" | sed "s|[ ]*[^ ]*$exclude[^ ]*[ ]*| |ig")";
new_stuff_arch="$(echo "$new_stuff_arch" | sed "s|[ ]*[^ ]*$exclude[^ ]*[ ]*| |ig")";
new_stuff_sdk="$(echo "$new_stuff_sdk" | sed "s|[ ]*[^ ]*$exclude[^ ]*[ ]*| |ig")";
new_stuff_arch_sdk="$(echo "$new_stuff_arch_sdk" | sed "s|[ ]*[^ ]*$exclude[^ ]*[ ]*| |ig")";
done;
stuff="$new_stuff";
stuff_arch="$new_stuff_arch";
stuff_sdk="$new_stuff_sdk";
stuff_arch_sdk="$new_stuff_arch_sdk";
}
[ "$includelist" ] || [ "$excludelist" ] && {
2019-11-12 18:57:20 +00:00
stuff="$(echo "$stuff" | sed 's| |\n|g' | tr -s '\n' | sort -u | sed 's|^| |g')
";
stuff_arch="$(echo "$stuff_arch" | sed 's| |\n|g' | tr -s '\n' | sort -u | sed 's|^| |g')
";
stuff_sdk="$(echo "$stuff_sdk" | sed 's| |\n|g' | tr -s '\n' | sort -u | sed 's|^| |g')
";
stuff_arch_sdk="$(echo "$stuff_arch_sdk" | sed 's| |\n|g' | tr -s '\n' | sort -u | sed 's|^| |g')
";
}
[ "$stuff" ] || [ "$stuff_arch" ] || [ "$stuff_sdk" ] || [ "$stuff_arch_sdk" ] || abort "Nothing left to install after config";
2019-11-12 18:57:20 +00:00
}