Skip to content

Commit 45af725

Browse files
authored
Update database.am - "files", mark datbase-less apps as "unknown"
see #1622 (comment)
1 parent adc088d commit 45af725

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

modules/database.am

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ _files_sizes() {
289289

290290
# Function to determine file's database
291291
_files_db() {
292+
DB=""
292293
if test -f "$APPSPATH"/"$arg"/.am-installer/*.*; then
293294
_files_db_third_party
294295
elif [ "$arg" = am ]; then
@@ -298,6 +299,7 @@ _files_db() {
298299
else
299300
DB="am"
300301
fi
302+
[ -z "$DB" ] && DB="unknown"
301303
echo "$arg | $DB" >> "$AMCACHEDIR"/files-db
302304
}
303305

@@ -332,12 +334,12 @@ _files() {
332334
rm -f "$AMCACHEDIR"/files-args
333335
for arg in $INSTALLED_APPS; do
334336
if test -f ./"$arg"/remove 2>/dev/null; then
335-
APPVERSION=$(grep -w "$arg |" "$AMCACHEDIR"/version-args | tr ' ' '\n' | tail -1)
337+
APPVERSION=$(grep -w "$arg |" "$AMCACHEDIR"/version-args | awk '{print $4}')
336338
[ -f ./"$arg"/AM-LOCK ] && APPVERSION="$APPVERSION🔒"
337339
echo "$APPVERSION" | grep -q "🔒$" && APPLOCKED=1
338-
APPTYPE=$(grep -w "$arg |" "$AMCACHEDIR"/files-type | tr ' ' '\n' | tail -1)
339-
APPSYZE=$(grep -w "$arg |" "$AMCACHEDIR"/files-sizes | tr ' ' '\n' | tail -1)
340-
APPDB=$(grep -w "$arg |" "$AMCACHEDIR"/files-db | tr ' ' '\n' | tail -1)
340+
APPTYPE=$(grep -w "$arg |" "$AMCACHEDIR"/files-type | awk '{print $4}')
341+
APPSYZE=$(grep -w "$arg |" "$AMCACHEDIR"/files-sizes | awk '{print $4}')
342+
APPDB=$(grep -w "$arg |" "$AMCACHEDIR"/files-db | awk '{print $4}')
341343
if [ -n "$CHECK_SUPPORTED_THIRD_PARTY_APPS" ]; then
342344
echo "$arg | $APPDB | $APPVERSION | $APPTYPE | $APPSYZE" >> "$AMCACHEDIR"/files-args
343345
else

0 commit comments

Comments
 (0)