remove ls use

This commit is contained in:
FriendlyNeighborhoodShane 2021-06-24 17:32:24 +05:30
parent 00726d9684
commit ce7dbe90ad
3 changed files with 12 additions and 10 deletions

View File

@ -25,7 +25,7 @@ echo "-- Minimal MicroG Build Script --";
echo "-- The Essentials only MicroG pack --";
modname="MinMicroG";
for bin in cp grep ls mv rm sed zip; do
for bin in cp find grep mv rm sed zip; do
command -v "$bin" >/dev/null || abort "No $bin found";
done;
@ -41,7 +41,8 @@ if [ "$1" = "all" ]; then
echo " ";
echo " - Building all packages...";
echo " ";
for var in $(find "$confdir" -name "defconf-*.txt" | sed -e "s|^$confdir/defconf-||g" -e "s|.txt$||g"); do
varlist="$(find "$confdir" -type f -name "defconf-*.txt" -exec expr {} : ".*/defconf-\(.*\)\.txt$" ';')";
for var in $varlist; do
echo " - Executing build for $var...";
"$workdir/build.sh" "$var";
done;

View File

@ -19,23 +19,24 @@ unzipmaps() {
# Get update delta
updatedelta() {
newlog=""
oldlogs=""
for log in $(ls -td "$reldir"/update-*.log); do
[ "$(basename "$log")" = "update-$updatetime.log" ] && newlog="$(basename "$log")" || oldlogs="$oldlogs $(basename "$log")";
newlog="";
oldlogs="";
loglist="$(find "$reldir" -type f -name "update-*.log" -exec expr {} : ".*/update-\([0-9]\{14\}\)\.log$" ';' | sort -nr)";
for log in $loglist; do
[ "$log" = "$updatetime" ] && newlog="$log" || oldlogs="$oldlogs $log";
done;
[ "$newlog" ] && [ "$oldlogs" ] || return 0;
echo " ";
echo " - Checking resdl delta between updates...";
for entry in $(grep -oE "FILE: [^,;]*" "$reldir/$newlog" | cut -d" " -f2); do
line="$(grep "FILE: $entry," "$reldir/$newlog")";
for entry in $(grep -oE "FILE: [^,;]*" "$reldir/update-$newlog.log" | cut -d" " -f2); do
line="$(grep "FILE: $entry," "$reldir/update-$newlog.log")";
file="$entry";
url="$(echo "$line" | grep -oE "URL: [^,;]*" | cut -d" " -f2)";
oldurl="";
for log in $oldlogs; do
oldurl="$(grep "FILE: $file," "$reldir/$log" | grep -oE "URL: [^,;]*" | cut -d" " -f2)";
oldurl="$(grep "FILE: $file," "$reldir/update-$log.log" | grep -oE "URL: [^,;]*" | cut -d" " -f2)";
[ "$oldurl" ] && break;
done;
[ "$oldurl" ] || oldurl="None";

View File

@ -39,7 +39,7 @@ echo "-- Minimal MicroG Update Script --";
echo "-- The Essentials Only MicroG Pack --";
# Bin check
for bin in chmod cp curl grep head jq mv rm sort tr unzip; do
for bin in chmod cp curl find grep head jq mv rm sort tr unzip; do
command -v "$bin" >/dev/null || abort "No $bin found";
done;