Skip to content

Commit b6ab149

Browse files
authored
Merge pull request #1252 from ivan-hc/dev
"AM" 9.4.1
2 parents c64ef0e + 6e036a6 commit b6ab149

File tree

3 files changed

+31
-10
lines changed

3 files changed

+31
-10
lines changed

APP-MANAGER

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
#!/usr/bin/env bash
22

3-
AMVERSION="9.4-2"
3+
AMVERSION="9.4.1"
44

55
# Determine main repository and branch
66
AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main"
77
AMBRANCH=$(basename "$AMREPO")
88
MODULES_SOURCE="$AMREPO/modules"
99

10-
# Determine catalogue in use
11-
export AMCATALOGUEMARKDOWNS="https://portable-linux-apps.github.io/apps"
12-
export AMCATALOGUEICONS="https://portable-linux-apps.github.io/icons"
13-
1410
# Determine the name of this script and its working directory
1511
export REALDIR="$PWD"
1612
DIR="$( cd "$( dirname "$0" )" && pwd )"
@@ -268,9 +264,17 @@ _betatester_message_on() {
268264
fi
269265
}
270266

267+
################################################################################
268+
# APPS DATABASE
269+
################################################################################
270+
271271
# Apps database in use
272-
APPSDB="$AMREPO/programs/$ARCH"
273-
APPSLISTDB="$AMREPO/programs/$ARCH-apps"
272+
APPSDB="${APPSDB:-$AMREPO/programs/$ARCH}"
273+
APPSLISTDB="${APPSLISTDB:-$AMREPO/programs/$ARCH-apps}"
274+
275+
# Determine catalogue in use
276+
export AMCATALOGUEMARKDOWNS="${AMCATALOGUEMARKDOWNS:-https://portable-linux-apps.github.io/apps}"
277+
export AMCATALOGUEICONS="${AMCATALOGUEICONS:-https://portable-linux-apps.github.io/icons}"
274278

275279
################################################################################
276280
# SECURITY
@@ -862,7 +866,7 @@ _use_sync() {
862866
_betatester_message_on
863867
_sync_installation_scripts
864868
_sync_databases
865-
if [ "$(realpath "$0")" != "/usr/bin/am" ]; then
869+
if [ "$(realpath "$0")" != "/usr/bin/am" ] && [ "$AMSYNC" != 1 ]; then
866870
_sync_modules
867871
_sync_amcli
868872
fi

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ You can use the command `am -a {PROGRAM}` to view the description and get the so
4747
- [How to set the path to local apps](#how-to-set-the-path-to-local-apps)
4848
- [What programs can be installed](#what-programs-can-be-installed)
4949
- [Supported third-party databases](#supported-third-party-databases)
50+
- [How to replace AM database](#how-to-replace-am-database)
5051

5152
[How to update all programs, for real!](#how-to-update-all-programs-for-real)
5253
- [How to update all installed apps](#how-to-update-all-installed-apps)
@@ -229,6 +230,22 @@ Third-party databases can show basic information normally with the option `-a` o
229230

230231
Same thing, you can use `am -i {PROGRAM}.toolpack` or `am -i --user {PROGRAM}.toolpack` to install the program without using the flag.
231232

233+
#### How to replace AM database
234+
One thing I care a lot about is **continuity**, and as I have seen over the years, not all open source developers are able to maintain a project. This could happen to me in the future. I don't want it to be that way.
235+
236+
Because of this, I have made some essential variables "customizable":
237+
- `APPSDB`, i.e. the "raw" directory of the architecture in use, containing the installation scripts (default value *https://raw.githubusercontent.com/ivan-hc/AM/main/programs/$ARCH*), this is mainly used in `-i`, `-d` and `-s`/`-u`
238+
- `APPSDBLIST`, i.e. the list of applications available for that architecture (default value *https://raw.githubusercontent.com/ivan-hc/AM/main/$ARCH-apps*), this is used every time lists are updated, for example in `-l`, `-q` and `-s`/`-u`
239+
- `AMCATALOGUEMARKDOWNS`, i.e. the pages in .md format from the catalog of applications available in this database (default value *https://portable-linux-apps.github.io/apps*), this is used in `-a`
240+
- `AMCATALOGUEICONS`, i.e. the icons in .png format available in the catalog of applications available in this database (default value *https://portable-linux-apps.github.io/icons*), this is used in `-i`, in case the installation script fails to get an icon for the application
241+
- `AMSYNC`, if set to "1" prevents AM from updating itself and updating modules when running `-s` or `-u`
242+
243+
it is enough to `export` the variables above and respect the destination file format (follow the URLs in parentheses) in case you decide to open a new community-driven database that can make up for the lack of support in this repository.
244+
245+
I did this to not tie users to this database and to allow them to use AM and all its features if I, Ivan, am unable to intervene for any reason.
246+
247+
There are many discontinuous projects. Should this become one too, it will not be obsolete.
248+
232249
------------------------------------------------------------------------
233250

234251
| [Back to "Main Index"](#main-index) |

modules/database.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ _about_description_for_third_party() {
5454
if echo "$appname" | grep -q ".appbundle$"; then
5555
readme_source="$appbundle_readme"
5656
repo_source="$appbundle_repo"
57-
else
57+
elif echo "$arg" | grep -q ".toolpack$"; then
5858
readme_source="$toolpack_readme"
5959
repo_source="$toolpack_repo"
6060
fi
61-
appname_arg=$(curl -Ls "$readme_source" | grep -i "^| $appname " | tr '|' '\n' | cut -c 2- | grep .)
61+
appname_arg=$(curl -Ls "$readme_source" 2>/dev/null | grep -i "^| $appname " | tr '|' '\n' | cut -c 2- | grep .)
6262
about_description=$(echo "$appname_arg" | awk -F: "NR==$awk_description")
6363
about_site=$(echo "$appname_arg" | awk -F: "NR==$awk_site")
6464
printf "\n%b\n\nSOURCE: %b\n\nDATABASE: %b\n" "$about_description" "$about_site" "$repo_source"

0 commit comments

Comments
 (0)