1
1
#! /usr/bin/env bash
2
2
3
- AMVERSION=" 9.4.4 "
3
+ AMVERSION=" 9.5 "
4
4
5
5
# Determine main repository and branch
6
6
AMREPO=" https://raw.githubusercontent.com/ivan-hc/AM/main"
@@ -57,8 +57,14 @@ _create_cache_dir() {
57
57
}
58
58
59
59
_clean_amcachedir () {
60
- [ " $AMCLI " = am ] && [ -d " $CACHEDIR " /am ] && rm -f " $CACHEDIR " /am/*
61
- [ -d " $CACHEDIR " /appman ] && rm -f " $CACHEDIR " /appman/*
60
+ if [ " $AMCLI " = am ] && [ -d " $CACHEDIR " /am ]; then
61
+ rm -f " $CACHEDIR " /am/* rm -f " $CACHEDIR " /am/* /* 2> /dev/null
62
+ rmdir " $CACHEDIR " /am/* 2> /dev/null
63
+ fi
64
+ if [ -d " $CACHEDIR " /appman ]; then
65
+ rm -f " $CACHEDIR " /appman/* " $CACHEDIR " /appman/* /* 2> /dev/null
66
+ rmdir " $CACHEDIR " /appman/* 2> /dev/null
67
+ fi
62
68
}
63
69
64
70
# Fit texts to an acceptable width
@@ -99,9 +105,9 @@ sed() {
99
105
fi
100
106
}
101
107
102
- # ###############################################################################
108
+ # ###############################################################################################################################################################
103
109
# AM/APPMAN
104
- # ###############################################################################
110
+ # ###############################################################################################################################################################
105
111
106
112
# "APPMAN" CORE VARIABLES AND FUNCTIONS
107
113
APPMAN_SETUP_MSG=" Before proceeding with any task, where do you want to install apps?
@@ -241,9 +247,9 @@ _icon_theme_export_to_datadir() {
241
247
[ -n " $APPMAN_APPSPATH " ] && ln -s " $APPMAN_APPSPATH " /* /icons/* .* " $DATADIR " /icons/hicolor/scalable/apps
242
248
}
243
249
244
- # ###############################################################################
250
+ # ###############################################################################################################################################################
245
251
# FINALIZE
246
- # ###############################################################################
252
+ # ###############################################################################################################################################################
247
253
248
254
AMCLIUPPER=$( echo " $AMCLI " | tr ' [:lower:]' ' [:upper:]' )
249
255
@@ -264,17 +270,17 @@ _betatester_message_on() {
264
270
fi
265
271
}
266
272
267
- # ###############################################################################
273
+ # ###############################################################################################################################################################
268
274
# APPS DATABASE
269
- # ###############################################################################
275
+ # ###############################################################################################################################################################
270
276
271
277
# Apps database in use
272
278
APPSDB=" ${APPSDB:- $AMREPO / programs/ $ARCH } "
273
279
APPSLISTDB=" ${APPSLISTDB:- $AMREPO / programs/ $ARCH -apps} "
274
280
275
- # ###############################################################################
281
+ # ###############################################################################################################################################################
276
282
# SECURITY
277
- # ###############################################################################
283
+ # ###############################################################################################################################################################
278
284
279
285
# SAFETY CHECKS
280
286
_am_dependences_check () {
@@ -352,9 +358,9 @@ elif command -v appimagelauncherd &>/dev/null; then
352
358
_blacklisted_file
353
359
fi
354
360
355
- # ###############################################################################
361
+ # ###############################################################################################################################################################
356
362
# 3RD PARTY
357
- # ###############################################################################
363
+ # ###############################################################################################################################################################
358
364
359
365
_use_newrepo () {
360
366
[ -z " $2 " ] && echo " USAGE: $AMCLI $1 [ARGUMENT]" && exit 1
@@ -413,72 +419,90 @@ _am_newrepo_check() {
413
419
414
420
_am_newrepo_check " $@ "
415
421
416
- # ###############################################################################
422
+ # ###############################################################################################################################################################
417
423
# 3RD PARTY SOURCES
418
- # ###############################################################################
424
+ # ###############################################################################################################################################################
419
425
420
426
third_party_flags_message=" "
421
427
422
- # APPBUNDLEHUB
423
- export appbundle_repo=" https://github.com/xplshn/AppBundleHUB"
424
- appbundle_readme=" https://raw.githubusercontent.com/xplshn/dbin-metadata/refs/heads/master/misc/cmd/AM-support/AM.txt"
425
-
426
- _sync_appbundle_list () {
427
- rm -f " $AMDATADIR /$ARCH -appbundle"
428
- [ -n " $appbundle_readme " ] && curl -Ls " $appbundle_readme " | grep -v " \.appimage \|?" | grep " \.appbundle " | cut -d" :" -f1 | cut -d" @" -f2 \
429
- | sed ' s/^| /◆ /g; s/ https$//g; s/ :$//g; s/ | / : /g; s/ |$/./g; s/\.\.$/./g;' | sort > " $AMDATADIR /$ARCH -appbundle" \
430
- || touch " $AMDATADIR /$ARCH -appbundle"
428
+ _third_party_lsts_filter () {
429
+ grep -v -- " ---\|^| appname" | awk -F' |' ' {print $2, $3}' | sed ' s/^/◆/g; s/ / : /g; s/ $//g'
431
430
}
432
431
433
- # TOOLPACKS
434
- toolpack_repo=" https://github.com/Azathothas/Toolpacks"
435
- toolpack_readme=" https://bin.pkgforge.dev/${ARCH} /AM.txt"
432
+ # ################################
433
+ # APPBUNDLEHUB
434
+ # ################################
435
+ export appbundle_repo=" https://github.com/xplshn/AppBundleHUB"
436
+ # export appbundle_readme="https://raw.githubusercontent.com/xplshn/dbin-metadata/master/misc/cmd/AM-support/AM.txt"
437
+ # [ -n "$appbundle_readme" ] && third_party_flags="$third_party_flags --appbundle"
438
+
439
+ # ################################
440
+ # TOOLPACKS/SOARPKGS
441
+ # ################################
442
+ export toolpack_repo=" https://github.com/pkgforge/soarpkgs (ex toolpacks)"
443
+ export toolpack_readme=" https://raw.githubusercontent.com/ivan-hc/am-extras/main/soarpkgs-toolpacks/${ARCH} .md"
436
444
[ -n " $toolpack_readme " ] && third_party_flags=" $third_party_flags --toolpack"
437
- [ -n " $toolpack_readme " ] && third_party_flags_message=" $third_party_flags_message \n
438
- ${Gold} --toolpack\033[0m
439
-
440
- ${LightBlue} $AMCLI -i --toolpack {PROGRAM}\033[0m
441
- ${LightBlue} am -i --toolpack --user {PROGRAM}\033[0m
442
- ${LightBlue} $AMCLI -l --toolpack\033[0m
443
- ${LightBlue} $AMCLI -q --toolpack {KEYWORD}\033[0m
444
445
445
- Description: This is a flag to use in \" -i\" to install Toolpack programs, in \" -l\" to list all available \
446
- Toolpacks, and \" -q\" to search the Toolpack list. Toolpack is a collection of programs external to the \" AM\" \
447
- database. Visit $toolpack_repo to learn more.
446
+ export toolpack_missing_file_msg=" \nIt appears that the selected file is not available.\n\nThis happens due to pkgforge's mirror Issue.\nLearn more: https://docs.pkgforge.dev/repositories/bincache/cache\n\nAlternatively, install \" soar\" or \" dbin\" and use those.\n\n"
448
447
449
- NOTE, for installations you can use \" .toolpack\" as the package extension instead of using the flag.
450
- "
451
-
452
- _sync_toolpacks_list () {
453
- rm -f " $AMDATADIR /$ARCH -toolpack"
454
- [ -n " $toolpack_readme " ] && curl -Ls " $toolpack_readme " | grep -v " \.appimage \|.appbundle \|?" | cut -d" :" -f1 | cut -d" @" -f2 \
455
- | sed ' s/^| /◆ /g; s/ | https$/. To install it use the "--toolpack" flag./g; s/ | / : /g' | sort > " $AMDATADIR /$ARCH -toolpack" \
456
- || touch " $AMDATADIR /$ARCH -toolpack"
457
- }
458
-
459
- # ###############################
448
+ # ################################
460
449
# ALL THE ABOVE
461
- # ###############################
450
+ # ################################
451
+ third_party_lists=" appbundle toolpack"
462
452
463
- export third_party_lists=" appbundle toolpack"
453
+ _remove_known_third_party_extensions () {
454
+ sed ' s/\.toolpack//g; s/\.dwfs.appbundle$//g; s/\.appbundle$//g'
455
+ }
464
456
465
- _completion_list_third_party () {
466
- [ -f " $AMDATADIR " /" $ARCH " -appbundle ] && awk ' {print $2}' " $AMDATADIR " /" $ARCH " -appbundle >> " $AMDATADIR " /list
467
- [ -f " $AMDATADIR " /" $ARCH " -toolpack ] && awk ' {print $2}' " $AMDATADIR " /" $ARCH " -toolpack | sed -e ' s/$/.toolpack/' >> " $AMDATADIR " /list
457
+ _files_db_third_party () {
458
+ for tp_list in $third_party_lists ; do
459
+ if test -f " $APPSPATH " /" $arg " /.am-installer/* ." $tp_list " ; then
460
+ export DB=" $tp_list "
461
+ fi
462
+ done
468
463
}
469
464
470
465
_sync_third_party_lists () {
471
- _sync_appbundle_list
472
- # _sync_toolpacks_list
466
+ for tp_list in $third_party_lists ; do
467
+ rm -f " $AMDATADIR " /" $ARCH " -" $tp_list "
468
+ tprepo_readme=" ${tp_list} _readme"
469
+ if [ -n " ${! tprepo_readme} " ]; then
470
+ curl -Ls " ${! tprepo_readme} " | _third_party_lsts_filter \
471
+ | sed " s/$/. To install it use the --$tp_list flag or the .$tp_list extension./g" | sort > " $AMDATADIR " /" $ARCH " -" $tp_list " \
472
+ || touch " $AMDATADIR " /" $ARCH " -" $tp_list "
473
+ fi
474
+ done
475
+ }
476
+
477
+ _completion_list_third_party () {
478
+ for tp_list in $third_party_lists ; do
479
+ [ -f " $AMDATADIR " /" $ARCH " -" $tp_list " ] && awk ' {print $2}' " $AMDATADIR " /" $ARCH " -" $tp_list " >> " $AMDATADIR " /list && awk ' {print $2}' " $AMDATADIR " /" $ARCH " -" $tp_list " | sed -e " s/$/.$tp_list /" >> " $AMDATADIR " /list
480
+ done
473
481
}
474
482
475
483
export awk_name=" 1" awk_description=" 2" awk_site=" 3" awk_dl=" 4" awk_ver=" 5" # Numbers to use in "awk" to determine columns
476
484
485
+ if [ -n " $third_party_flags " ]; then
486
+ for flag in $third_party_flags ; do
487
+ tpflag_name=$( echo " $flag " | tr ' -' ' \n ' | grep .)
488
+ tprepo_name=" ${tpflag_name} _repo"
489
+ third_party_flags_message=" $third_party_flags_message \n
490
+ ${Gold} --$tpflag_name \033[0m
491
+
492
+ ${LightBlue} $AMCLI -i --$tpflag_name {PROGRAM}\033[0m
493
+ ${LightBlue} am -i --$tpflag_name --user {PROGRAM}\033[0m
494
+ ${LightBlue} $AMCLI -l --$tpflag_name \033[0m
495
+
496
+ Description: This is a flag to use in \" -i\" and \" -l\" to install/list ${tpflag_name^} s from ${! tprepo_name} . You can also use it in \" -q\" as a keyword. For installations you can use .$tpflag_name as the package extension instead of using the flag.
497
+ "
498
+ done
499
+ fi
500
+
477
501
[ -z " $third_party_flags_message " ] && third_party_flags_message=" none\n"
478
502
479
- # ###############################################################################
503
+ # ###############################################################################################################################################################
480
504
# UTILITIES
481
- # ###############################################################################
505
+ # ###############################################################################################################################################################
482
506
483
507
# COMPLETION LIST
484
508
available_options=" about add apikey backup clean config disable downgrade download enable extra files hide home icons info \
@@ -623,9 +647,9 @@ _remove_info_files() {
623
647
rm -f " $AMCACHEDIR " /version-args
624
648
}
625
649
626
- # ###############################################################################
650
+ # ###############################################################################################################################################################
627
651
# APIKEY
628
- # ###############################################################################
652
+ # ###############################################################################################################################################################
629
653
630
654
ghapikey_file=" $AMDATADIR /ghapikey.txt"
631
655
# Set header authorization if GitHub API key file exists
@@ -666,9 +690,9 @@ _update_github_api_key_in_the_updater_files() {
666
690
fi
667
691
}
668
692
669
- # ###############################################################################
693
+ # ###############################################################################################################################################################
670
694
# APPMAN MODE
671
- # ###############################################################################
695
+ # ###############################################################################################################################################################
672
696
673
697
APPMAN_MSG=" $DIVIDING_LINE \n \" AM\" is running as \" AppMan\" , use ${Green} am --system\033[0m to switch it back to \" AM\" \n$DIVIDING_LINE \n"
674
698
APPMAN_MSG_OFF=" $DIVIDING_LINE \n \" AppMan Mode\" disabled! \n$DIVIDING_LINE \n"
@@ -704,9 +728,9 @@ if [ "$AMCLI" = am ]; then
704
728
fi
705
729
fi
706
730
707
- # ###############################################################################
731
+ # ###############################################################################################################################################################
708
732
# CLEAN
709
- # ###############################################################################
733
+ # ###############################################################################################################################################################
710
734
711
735
_clean_amcachedir_message () {
712
736
_clean_amcachedir
@@ -801,9 +825,9 @@ _use_clean() {
801
825
_clean_old_modules
802
826
}
803
827
804
- # ###############################################################################
828
+ # ###############################################################################################################################################################
805
829
# HIDE/UNHIDE
806
- # ###############################################################################
830
+ # ###############################################################################################################################################################
807
831
808
832
_use_hide_unhide () {
809
833
entries=" $( echo " $@ " | cut -f2- -d ' ' ) "
@@ -824,9 +848,9 @@ _use_hide_unhide() {
824
848
fi
825
849
}
826
850
827
- # ###############################################################################
851
+ # ###############################################################################################################################################################
828
852
# SYNC
829
- # ###############################################################################
853
+ # ###############################################################################################################################################################
830
854
831
855
_sync_installation_scripts () {
832
856
printf " %b\n Checking for changes of the installation scripts in the online database...\n" " $DIVIDING_LINE "
@@ -921,9 +945,9 @@ _use_sync() {
921
945
echo " $DIVIDING_LINE "
922
946
}
923
947
924
- # ###############################################################################
948
+ # ###############################################################################################################################################################
925
949
# UPDATE
926
- # ###############################################################################
950
+ # ###############################################################################################################################################################
927
951
928
952
_update_updatable_apps_msg_head () {
929
953
printf " \" %b\" CAN MANAGE UPDATES FOR THE FOLLOWING PROGRAMS:\n%b\n\n" " $AMCLIUPPER " " $DIVIDING_LINE "
@@ -1145,9 +1169,9 @@ _use_force_latest() {
1145
1169
done
1146
1170
}
1147
1171
1148
- # ###############################################################################
1172
+ # ###############################################################################################################################################################
1149
1173
# USAGE
1150
- # ###############################################################################
1174
+ # ###############################################################################################################################################################
1151
1175
1152
1176
# HANDLE ALL THE EXTERNAL MODULES
1153
1177
_use_module () {
@@ -1256,9 +1280,9 @@ case "$1" in
1256
1280
for n in $ARGPATHS ; do sed -e ' /notify-send/ s/^#*//' -i " $n /AM-updater" 2> /dev/null; done
1257
1281
;;
1258
1282
' help' |' -h' )
1259
- # ###############################################################################
1283
+ # ###############################################################################################################################################################
1260
1284
# HELP
1261
- # ###############################################################################
1285
+ # ###############################################################################################################################################################
1262
1286
1263
1287
_use_help () {
1264
1288
[ " $CLI " = am ] && [ -f " $APPMANCONFIG " /appman-mode ] && printf " %b" " $APPMAN_MSG "
@@ -1418,9 +1442,9 @@ case "$1" in
1418
1442
${LightBlue} $AMCLI -q {KEYWORD}
1419
1443
${LightBlue} $AMCLI -q --all {KEYWORD}
1420
1444
${LightBlue} $AMCLI -q --appimages {KEYWORD}
1421
- ${LightBlue} $AMCLI -q --pkg {PROGRAM1} {PROGRAM2}[0m
1445
+ ${LightBlue} $AMCLI -q --pkg {PROGRAM1} {PROGRAM2}\033 [0m
1422
1446
1423
- Description: Search for keywords in the list of available applications, add the \" --appimages\" option to list only the AppImages or add \" --pkg\" to list multiple programs at once. It can also be extended with additional flags, the \" --all\" flag allows you to consult the set of all supported databases (see third-party flags, at the bottom of this message) .
1447
+ Description: Search for keywords in the list of available applications, add the \" --appimages\" option to list only the AppImages or add \" --pkg\" to list multiple programs at once. The \" --all\" flag allows you to consult the set of all supported databases.
1424
1448
1425
1449
${Gold} remove, -r\033[0m
1426
1450
0 commit comments