Update package version to 26.03.22

This commit is contained in:
2026-03-22 16:08:58 +02:00
parent e16b63be34
commit d163d38fb7
7 changed files with 38 additions and 2 deletions
+4 -1
View File
@@ -1,10 +1,13 @@
name: tide-java-utils
description: Tide Linux utility for switching between java versions
version: 25.09.19
version: 26.03.22
revision: 1
license: MIT
maintainers:
- [email protected]
architecture: any
output_architecture: any
type: source
depends:
- bash
- findutils
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
/var/lib/bpm/hook-scripts/tide-java-utils.sh
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
/var/lib/bpm/hook-scripts/tide-java-utils.sh
+9 -1
View File
@@ -10,6 +10,7 @@ function help() {
}
function get_installed_java_versions() {
[ -d /usr/lib/java ] || return
for dir in $(find /usr/lib/java/ -mindepth 1 -maxdepth 1 -not -name 'default'); do
echo $(basename "$dir")
done
@@ -52,9 +53,16 @@ case "$1" in
;;
"get-default")
echo -n "Current default java version: "
get_default_java_version || echo "None"
if ! get_default_java_version; then
echo "None"
exit 1
fi
;;
"list")
if ! get_installed_java_versions &> /dev/null; then
echo "No available java versions were found"
exit 1
fi
echo "Available java versions:"
while read line; do
echo "- $line"
+4
View File
@@ -0,0 +1,4 @@
trigger_operations: ["install", "upgrade", "remove"]
target_type: "path"
targets: ["usr/lib/java/*"]
run: "/var/lib/bpm/hook-scripts/tide-java-utils.sh"
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
if ! tide-java-utils get-default &> /dev/null; then
JAVA_PATH=`tide-java-utils list | grep '^-' | awk '{print $2}' | tail -n1` || exit 0
if [ -n "$JAVA_PATH" ]; then
JAVA_NAME=`basename "$JAVA_PATH"`
tide-java-utils set-default "$JAVA_NAME"
fi
fi
+6
View File
@@ -6,8 +6,14 @@
# This function is used to move the compiled files into the output directory
package() {
install -Dm755 "$BPM_WORKDIR"/tide-java-utils "$BPM_OUTPUT"/usr/bin/tide-java-utils
# Install shell profile to add the default java version bin directory to path
install -Dm644 "$BPM_WORKDIR"/java.profile "$BPM_OUTPUT"/etc/profile.d/java.sh
# Install bpm hook
install -Dm644 "$BPM_WORKDIR"/tide-java-utils.bpmhook "$BPM_OUTPUT"/var/lib/bpm/hooks/tide-java-utils.bpmhook
install -Dm755 "$BPM_WORKDIR"/tide-java-utils.bpmhook.sh "$BPM_OUTPUT"/var/lib/bpm/hook-scripts/tide-java-utils.sh
# Link to default java
ln -sf ../lib/java/default/bin/java "$BPM_OUTPUT"/usr/bin/java