Skip to content

Commit 0fbfc3d

Browse files
ivan-hcweb-flow
andauthored
Change metapkgs detection and do cleanup (#2401)
* A new way to list metapackages (#2400) * Create AMico.yml * Update AMico.yml * Update AMico.yml * Update AMico.yml (sync lists) [78c07be] * Update AMico.yml (sync lists) [78c07be] (sync lists) [e819bb1] * Update lister.sh * Update lister.sh (sync lists) [7889734] * Update lister.sh * Update lister.sh (sync lists) [cc5bccd] * Update lister.sh * Update lister.sh (sync lists) [03c3853] * Update lister.sh * Delete .github/workflows/AMico.yml --------- Co-authored-by: web-flow <noreply@github.com> * Update install.am: change metapkgs detection and do cleanup * Update database.am, change metapkgs detection method * Move metapackages list to APP-MANAGER * Update am2pla-site * Add the metapkg detection to -d or "download" --------- Co-authored-by: web-flow <noreply@github.com>
1 parent b9abc6b commit 0fbfc3d

75 files changed

Lines changed: 277 additions & 9973 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

APP-MANAGER

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
AMVERSION="10.2.1-3"
3+
AMVERSION="10.2.1-4"
44

55
# Determine main repository and branch
66
AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main"
@@ -974,6 +974,9 @@ _completion_lists() {
974974
done
975975
}
976976

977+
# List of metapackages
978+
export METAPACKAGES="kdegames kdeutils node platform-tools"
979+
977980
# List of apps from archived repositories or not updated for more than a year
978981
archived_apps_source="$AMREPO/programs/archived-apps"
979982
obsolete_apps_source="$AMREPO/programs/obsolete-apps"

modules/database.am

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,6 @@ _about_status() {
5050
fi
5151
done
5252
fi
53-
# Determine if the referenced app is a metapackage or part of it
54-
METAPACKAGES="kdegames kdeutils node platform-tools"
55-
for m in $METAPACKAGES; do
56-
metaargpath=$(echo "$ARGPATHS" | grep "/$m$")
57-
if grep -q "$arg : .*\"$m\"" "$AMDATADIR/$ARCH-apps"; then
58-
if test -f "$metaargpath/remove"; then
59-
app_status="installed\033[0m, as part of ${Green}$m\033[0m\n\n NOTE, run ${RED}$AMCLI -a $m\033[0m instead"
60-
appname="$m"
61-
fi
62-
elif [ "$arg" = "$m" ] && [ -d "$metaargpath" ]; then
63-
app_status="installed\033[0m" || app_status="not installed\n"
64-
fi
65-
done
6653
if echo "$app_status" | grep -q "^installed"; then
6754
printf $" STATUS: %b\n" "${LightBlue}$app_status"
6855
else
@@ -142,6 +129,14 @@ _about_description() {
142129

143130
_about() {
144131
if echo "$SCRIPTNAMES" | grep -q "^$arg$" || grep -q "^$arg$" "$AMDATADIR/list" || echo "$ARGPATHS" | grep -q "/$arg$"; then
132+
[ ! -f "$AMDATADIR/$ARCH-apps" ] && _completion_lists
133+
# Determine if the program is part of a metapackage
134+
for m in $METAPACKAGES; do
135+
if sort "$AMDATADIR/$ARCH-apps" | grep -q "$arg : .*\"$m\""; then
136+
printf " %b ==> %b\n\n" "$arg" "$m" | tr '[:lower:]' '[:upper:]'
137+
arg="$m"
138+
fi
139+
done
145140
printf " PACKAGE: %b%b\033[0m\n" "${Green}" "$arg"
146141
_about_status
147142
if echo "$app_status" | grep -q "^installed"; then
@@ -742,7 +737,13 @@ _list() {
742737
fi
743738
APPSNUMBER=$((ITEMSNUMBER - LIBNUMBER))
744739
# Determine the number of available apps from the list
745-
AVAILABLE_APPS_NUMBER=$(grep -v "\"kdegames\"\|\"kdeutils\"\|\"node\"\|\"platform-tools\"" "$AMDATADIR/$ARCH-apps" | grep -e "^◆.*$" -c)
740+
[ ! -f "$AMDATADIR/$ARCH-apps" ] && _completion_lists
741+
AVAILABLE_APPS_NUMBER=$(grep -e "^◆.*$" -c "$AMDATADIR/$ARCH-apps")
742+
# Do not include metapackages in the count
743+
for m in $METAPACKAGES; do
744+
METAPKGS_NUMBER=$(grep -e "^◆ .*\"$m\".*$" -c "$AMDATADIR/$ARCH-apps")
745+
AVAILABLE_APPS_NUMBER=$((AVAILABLE_APPS_NUMBER - METAPKGS_NUMBER))
746+
done
746747
if ! test -f "$AMDATADIR/$ARCH-appimages"; then
747748
_online_check
748749
_sync_appimages_list

0 commit comments

Comments
 (0)