Skip to content

Commit

Permalink
added check not to install mono and gecko if there is an indication t…
Browse files Browse the repository at this point in the history
…hat they are already there; fixed misprints in outputs
  • Loading branch information
mars4science committed Oct 4, 2023
1 parent e200961 commit a2566d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions install_wine-gecko.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

path_to_gecko="${software_path_root}/wine-gecko"
# man bash -e file True if file exists
if [ ! -e "$path_to_gecko" ]; then echo >&2 "wine-gecko path $path_to_gecko not found, exiting with error"; exit 1; fi
if [ ! -e "$path_to_gecko" ]; then echo >&2 "wine-gecko: path $path_to_gecko where files to be copied were programmed to take from was not found, exiting with error"; exit 1; fi

wine --version
if [ $? -ne 0 ]; then echo "wine not found, exiting gecko install"; exit 1 ; fi
Expand All @@ -32,6 +32,9 @@ else
path_to_install=/usr/share/wine/gecko # this is one of places wine searches for gecko regardless of folder where wine itself is
fi

# check if was added already, currently not programmed to replace
if [ -e "${path_to_install}" ]; then echo "wine-gecko: path $path_to_install where files were programmed to be copied to already exists, exiting"; exit 2; fi

# looks like where is no "wine" way to find out where wine configs are, so just put from experience with Linun Mint:

# man bash
Expand All @@ -54,7 +57,7 @@ if [ $Eval5 -eq 0 ];then
# below checks resuls of ? I guess, not errors on archive extract
# if [ $? ];then echo "copied gecko to $path_to_install"; else echo "error: maybe NOT copied gecko to $path_to_install"; fi
echo "copied (installed) gecko to $path_to_install"
elif [ $Eval6 -eq 0 -o $Eval7 -eq 0 ];then # 6 mono is latest as of 2022/1/21
elif [ $Eval6 -eq 0 -o $Eval7 -eq 0 ];then # 6 gecko is latest as of 2022/1/21
sudo mkdir --parents $path_to_install
find $path_to_gecko/6.0 -name '*.xz' -exec sudo tar --extract --warning=no-timestamp --warning=no-timestamp -f "{}" --atime-preserve --one-top-level="$path_to_install" \;
# if [ $? ];then echo "copied gecko to $path_to_install"; else echo "error: maybe NOT copied gecko to $path_to_install"; fi
Expand Down
7 changes: 5 additions & 2 deletions install_wine-mono.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

path_to_mono="${software_path_root}/wine-mono"
# man bash -e file True if file exists
if [ ! -e "$path_to_mono" ]; then echo >&2 "wine-mono path $path_to_mono not found, exiting with error"; exit 1; fi
if [ ! -e "$path_to_mono" ]; then echo >&2 "wine-mono: path $path_to_mono where files to be copied were programmed to take from was not found, exiting with error"; exit 1; fi

wine --version
if [ $? -ne 0 ]; then echo "wine not found, exiting gecko install"; exit 1 ; fi
if [ $? -ne 0 ]; then echo "wine not found, exiting mono install"; exit 1 ; fi

wine_version=$(wine --version | awk 'BEGIN {FS = "-"}{print $2}')

Expand All @@ -16,6 +16,9 @@ else
path_to_install=/usr/share/wine/mono # this is one of places wine searches for mono regardless of folder where wine itself is
fi

# check if was added already, currently not programmed to replace
if [ -e "${path_to_install}" ]; then echo "wine-mono: path $path_to_install where files were programmed to be copied to already exists, exiting"; exit 2; fi

# mono version for wine versions taken from table on https://wiki.winehq.org/Mono
if [ "$wine_version" = "7.22" ] ; then mono_archive=wine-mono-7.4.0-x86.tar.xz ;
elif [ "$wine_version" = "7.0" ] ; then mono_archive=wine-mono-7.0.0-x86.tar.xz ;
Expand Down

0 comments on commit a2566d8

Please sign in to comment.