Merge branch 'develop' of github-softcoder-megaglest:MegaGlest/megaglest-source into develop

This commit is contained in:
SoftCoder 2018-03-19 07:47:16 -07:00
commit db6b5c4355
3 changed files with 249 additions and 246 deletions

View File

@ -17,7 +17,7 @@ BugReportBoth2="$BugReportBoth"
BugReportData="https://github.com/MegaGlest/megaglest-data/issues"
EXC_BINARY="megaglest"
if [ -f "${GAMEDIR}/megaglest_shim" ]; then EXC_BINARY="megaglest_shim"
if [ -f "${GAMEDIR}/megaglest_shim" ]; then EXC_BINARY="megaglest_shim"; fi
SHORT_GAME_NAME="megaglest"
# if long game name contain spaces then write it inside quotes
@ -29,147 +29,151 @@ LIBDIR="lib"; ExitStatus=0; LibsWarnings=""; IgnoredLibs=""; FirstLnError=""
LibDir_wP="$GAMEDIR/$LIBDIR"; LIBDIR_B=".${LIBDIR}_bak"; LibDirB_wP="$GAMEDIR/$LIBDIR_B"
if [ ! -d "$LibDir_wP" ]; then mkdir "$LibDir_wP"; fi
if [ ! -d "$LibDirB_wP" ]; then mkdir "$LibDirB_wP"; fi
if [ "$1" = "--tool-editor" ] || [ "$1" = "--tool-g3dviewer" ] || [ "$1" = "--tool-buginfo" ];
then OperatingMode="$1"; else OperatingMode="--game"; fi
if [ "$1" = "--tool-editor" ] || [ "$1" = "--tool-g3dviewer" ] || [ "$1" = "--tool-buginfo" ]; then
OperatingMode="$1"; else OperatingMode="--game"
fi
BeginTime="$(date +"%s")"
if [ -e "/etc/os-release" ]; then
OS_INFO="$(cat "/etc/os-release" | grep '^PRETTY_NAME=' | awk -F '"' '{print $2}')"
else
WhichLsbRelease="$(which lsb_release 2>/dev/null)"
if [ "$WhichLsbRelease" != "" ]; then
OS_INFO="$($WhichLsbRelease -d | awk -F ':[ \t]*' '{print $2}')"
OS_INFO="$($WhichLsbRelease -d | awk -F ':[ \t]*' '{print $2}')"
fi
fi
if [ "$OperatingMode" != "--tool-buginfo" ]; then
if [ "$LDCONFIG" = "" ]; then
WhichLdconfig="$(which ldconfig 2>/dev/null)"
if [ "$WhichLdconfig" != "" ]; then
LDCONFIG="$WhichLdconfig"; LDconfigType=1
elif [ -x "/sbin/ldconfig" ]; then
LDCONFIG="/sbin/ldconfig"; LDconfigType=2
else
echo 'ERROR: Could not find the "ldconfig" command.' >&2
echo 'Please re-run using: "LDCONFIG=/path/to/ldconfig '"$0" >&2
exit 1
fi
WhichLdconfig="$(which ldconfig 2>/dev/null)"
if [ "$WhichLdconfig" != "" ]; then
LDCONFIG="$WhichLdconfig"; LDconfigType=1
elif [ -x "/sbin/ldconfig" ]; then
LDCONFIG="/sbin/ldconfig"; LDconfigType=2
else
echo 'ERROR: Could not find the "ldconfig" command.' >&2
echo 'Please re-run using: "LDCONFIG=/path/to/ldconfig '"$0" >&2
exit 1
fi
else
LDconfigType=9
LDconfigType=9
fi
LibsWarnings="Found LDCONFIG variable [$LDconfigType][$LDCONFIG]..."
if [ "$ARCHITECTURE" = "x86_64" ]; then GrepPattern="x86[_-]64"
else GrepPattern="$ARCHITECTURE"; fi
else GrepPattern="$ARCHITECTURE"; fi
LDCONFIG_P="$($LDCONFIG -p)"; ArchSortLibs="no"
LDCONFIG_P_ARCH="$(echo "$LDCONFIG_P" | grep "$GrepPattern")"
if [ "$LDCONFIG_P_ARCH" != "" ]; then
LDCONFIG_P_R_ARCH="$(echo "$LDCONFIG_P" | grep -v "$GrepPattern")"
ArchSortLibs="yes"
LDCONFIG_P_R_ARCH="$(echo "$LDCONFIG_P" | grep -v "$GrepPattern")"
ArchSortLibs="yes"
fi
if [ "$OperatingMode" = "--game" ]; then
ldd_target="$GAMEDIR/$EXC_BINARY"
else ldd_target="$GAMEDIR/$2"
fi
if [ "$OperatingMode" = "--game" ]; then ldd_target="$GAMEDIR/$EXC_BINARY"
else ldd_target="$GAMEDIR/$2"; fi
hasSOlib() {
if [ "$2" = "myarch" ]; then
if [ "$ArchSortLibs" = "yes" ]; then OS_libs_list="$LDCONFIG_P_ARCH"; else OS_libs_list="$LDCONFIG_P"; fi
else
if [ "$ArchSortLibs" = "yes" ]; then OS_libs_list="$LDCONFIG_P_R_ARCH"; else OS_libs_list=""; fi
fi
if [ "$OS_libs_list" != "" ]; then
echo "$OS_libs_list" | grep -m 1 "[^_-]$1" | cut "-d>" -f2 | cut "-d " -f2
fi
if [ "$2" = "myarch" ]; then
if [ "$ArchSortLibs" = "yes" ]; then OS_libs_list="$LDCONFIG_P_ARCH"; else OS_libs_list="$LDCONFIG_P"; fi
else
if [ "$ArchSortLibs" = "yes" ]; then OS_libs_list="$LDCONFIG_P_R_ARCH"; else OS_libs_list=""; fi
fi
if [ "$OS_libs_list" != "" ]; then
echo "$OS_libs_list" | grep -m 1 "[^_-]$1" | cut "-d>" -f2 | cut "-d " -f2
fi
}
findMissingSO() {
SO_WANTED_LIB="$1"; SO_WANTED_LIB2="$2"; SO_LIB_PATTERN="$3"
SO_LINKED_LIB="$LibDir_wP/$SO_WANTED_LIB2"
hasSO="$(hasSOlib "$SO_LIB_PATTERN" "myarch")"; CommonPart="no"
if [ ! -L "$SO_LINKED_LIB" ] && [ -e "$SO_LINKED_LIB" ]; then EmbLibExist="yes"; else EmbLibExist="no"; fi
if [ "$hasSO" != "" ] && ( [ "$6" != "|L" ] || [ "$EmbLibExist" = "no" ] ); then
CommonPart="yes"
elif [ "$SO_WANTED_LIB" = "$SO_LIB_PATTERN" ] && [ "$EmbLibExist" = "yes" ] && [ "$6" != "|H" ]; then
if [ "$6" = "|L" ]; then Emb_Keyword=" is used as"; else Emb_Keyword=" is missing in your OS, using"; fi
LibsWarnings="$LibsWarnings
||- default library ${5}[$SO_WANTED_LIB2]$Emb_Keyword embedded library."
return 0
else
hasSO="$(hasSOlib "$SO_LIB_PATTERN")"
if [ "$ArchSortLibs" = "yes" ] && [ "$hasSO" != "" ]; then
CommonPart="yes"
else
if [ "$SO_WANTED_LIB" = "$SO_LIB_PATTERN" ] && ( [ "$EmbLibExist" = "no" ] || [ "$6" = "|H" ] ); then
if [ "$6" = "|H" ] && [ "$EmbLibExist" = "yes" ]; then Emb_Keyword2=" (ae)"; else Emb_Keyword2=""; fi
LibsWarnings="$LibsWarnings
||- default library ${5}[$SO_WANTED_LIB2] is missing in your OS${Emb_Keyword2}, attempting to find and link to different version if is available..."
fi
if [ "$4" != "no" ]; then
LibsWarnings="$LibsWarnings
|| > not found !"
fi
return 1
fi
fi
if [ "$CommonPart" = "yes" ]; then
if [ "$SO_WANTED_LIB" != "$SO_LIB_PATTERN" ]; then
ln -f -s "$hasSO" "$SO_LINKED_LIB"
if [ "$?" -eq "0" ]; then
LibsWarnings="$LibsWarnings
|| new library link [.../$LIBDIR/$SO_WANTED_LIB2] pointed to [$hasSO]."
else
LibsWarnings="$LibsWarnings
|| ERROR: Detected some problems during process of creating symlink."
if [ "$FirstLnError" = "" ]; then FirstLnError="no"
LibsWarnings="$LibsWarnings
|| ... lack of write permissions in game location?"
fi
fi
else
if [ -e "$SO_LINKED_LIB" ]; then mv -f "$SO_LINKED_LIB" "$LibDirB_wP"; fi
if [ "$(echo "$c_required_libs" | grep "${SO_LIB_PATTERN}[ \t]*=>[ \t]*not found")" != "" ] && [ "$EmbLibExist" = "no" ]; then
#rare exception
LibsWarnings="$LibsWarnings
||- default library: ${5}[$SO_WANTED_LIB2] is missing in your OS, attempting to find and link to different version if is available...
|| > not found !"
fi
fi
return 0
fi
findMissingSO() {
SO_WANTED_LIB="$1"; SO_WANTED_LIB2="$2"; SO_LIB_PATTERN="$3"
SO_LINKED_LIB="$LibDir_wP/$SO_WANTED_LIB2"
hasSO="$(hasSOlib "$SO_LIB_PATTERN" "myarch")"; CommonPart="no"
if [ ! -L "$SO_LINKED_LIB" ] && [ -e "$SO_LINKED_LIB" ]; then EmbLibExist="yes"; else EmbLibExist="no"; fi
if [ "$hasSO" != "" ] && ( [ "$6" != "|L" ] || [ "$EmbLibExist" = "no" ] ); then
CommonPart="yes"
elif [ "$SO_WANTED_LIB" = "$SO_LIB_PATTERN" ] && [ "$EmbLibExist" = "yes" ] && [ "$6" != "|H" ]; then
if [ "$6" = "|L" ]; then Emb_Keyword=" is used as"; else Emb_Keyword=" is missing in your OS, using"; fi
LibsWarnings="$LibsWarnings
||- default library ${5}[$SO_WANTED_LIB2]$Emb_Keyword embedded library."
return 0
else
hasSO="$(hasSOlib "$SO_LIB_PATTERN")"
if [ "$ArchSortLibs" = "yes" ] && [ "$hasSO" != "" ]; then
CommonPart="yes"
else
if [ "$SO_WANTED_LIB" = "$SO_LIB_PATTERN" ] && ( [ "$EmbLibExist" = "no" ] || [ "$6" = "|H" ] ); then
if [ "$6" = "|H" ] && [ "$EmbLibExist" = "yes" ]; then Emb_Keyword2=" (ae)"; else Emb_Keyword2=""; fi
LibsWarnings="$LibsWarnings
||- default library ${5}[$SO_WANTED_LIB2] is missing in your OS${Emb_Keyword2}, attempting to find and link to different version if is available..."
fi
if [ "$4" != "no" ]; then
LibsWarnings="$LibsWarnings
|| > not found !"
fi
return 1
fi
fi
if [ "$CommonPart" = "yes" ]; then
if [ "$SO_WANTED_LIB" != "$SO_LIB_PATTERN" ]; then
ln -f -s "$hasSO" "$SO_LINKED_LIB"
if [ "$?" -eq "0" ]; then
LibsWarnings="$LibsWarnings
|| new library link [.../$LIBDIR/$SO_WANTED_LIB2] pointed to [$hasSO]."
else
LibsWarnings="$LibsWarnings
|| ERROR: Detected some problems during process of creating symlink."
if [ "$FirstLnError" = "" ]; then FirstLnError="no"
LibsWarnings="$LibsWarnings
|| ... lack of write permissions in game location?"
fi
fi
else
if [ -e "$SO_LINKED_LIB" ]; then mv -f "$SO_LINKED_LIB" "$LibDirB_wP"; fi
if [ "$(echo "$c_required_libs" | grep "${SO_LIB_PATTERN}[ \t]*=>[ \t]*not found")" != "" ] && [ "$EmbLibExist" = "no" ]; then
#rare exception
LibsWarnings="$LibsWarnings
||- default library: ${5}[$SO_WANTED_LIB2] is missing in your OS, attempting to find and link to different version if is available...
|| > not found !"
fi
fi
return 0
fi
}
checkLibsStatus() {
if [ "$1" != "" ]; then
check_nr=1
while [ "$check_nr" -le "2" ]; do
if [ "$check_nr" -eq "1" ]; then c_required_libs="$(ldd "$ldd_target")"; else
c_required_libs="$(LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}${LibDir_wP}" ldd "$ldd_target")"
fi
list_of_libs="$(echo "$1" | sed -e 's|\([^\]\)\.|\1\\.|g' -e 's|\[num\]|[0-9]\\+|g')"
for var in $list_of_libs; do
patterns="$(echo "$var" | sed -e 's|^ */||' -e 's|/| |g' -e 's/\(|[HL]\?\) /\1/')"
wanted_lib="$(echo "$patterns" | awk '{print $1}')"; i=2
if [ "$check_nr" -ne "1" ] && [ "$(echo "$IgnoredLibs" | grep "$wanted_lib")" != "" ]; then WantedLibIgnored="yes"
else WantedLibIgnored="no"; fi
if [ "$check_nr" -eq "1" ] || [ "$WantedLibIgnored" = "yes" ]; then
wanted_lib2="$(echo "$wanted_lib" | sed 's/\\//g')"; patterns_num="$(echo "$patterns" | wc -w)"
last_pattern="$(echo "$patterns" | awk '{print $(NF-1)}')"; end_mark="$(echo "$patterns" | awk '{print $NF}')"
if [ "$check_nr" -ne "1" ]; then foreign_dep="(sd) "; else foreign_dep=""; fi
if [ "$(echo "$c_required_libs" | grep "[^_-]$last_pattern")" != "" ]; then
if [ "$WantedLibIgnored" = "yes" ]; then IgnoredLibs="$(echo "$IgnoredLibs" | sed "s|$wanted_lib||")"; fi
for var2 in $patterns; do
if [ "$var2" = "|" ] || [ "$var2" = "|H" ] || [ "$var2" = "|L" ]; then break; fi
lib_pattern="$(echo "$var" | awk -F '/' -v ii="$i" '{print $ii}')"
if [ "$wanted_lib" != "$last_pattern" ] && [ "$i" -lt "$patterns_num" ]; then end_w="no"
else end_w="yes"; fi
findMissingSO "$wanted_lib" "$wanted_lib2" "$lib_pattern" "$end_w" "$foreign_dep" "$end_mark"
if [ "$?" -eq "0" ]; then break; else i=$((i + 1)); fi
done
elif [ "$WantedLibIgnored" = "no" ]; then
IgnoredLibs="$IgnoredLibs $wanted_lib2"
if [ -L "$LibDir_wP/$wanted_lib2" ]; then rm -f "$LibDir_wP/$wanted_lib2"; fi
fi
fi
done
check_nr=$((check_nr + 1))
done
fi
if [ "$1" != "" ]; then
check_nr=1
while [ "$check_nr" -le "2" ]; do
if [ "$check_nr" -eq "1" ]; then c_required_libs="$(ldd "$ldd_target")"; else
c_required_libs="$(LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}${LibDir_wP}" ldd "$ldd_target")"
fi
list_of_libs="$(echo "$1" | sed -e 's|\([^\]\)\.|\1\\.|g' -e 's|\[num\]|[0-9]\\+|g')"
for var in $list_of_libs; do
patterns="$(echo "$var" | sed -e 's|^ */||' -e 's|/| |g' -e 's/\(|[HL]\?\) /\1/')"
wanted_lib="$(echo "$patterns" | awk '{print $1}')"; i=2
if [ "$check_nr" -ne "1" ] && [ "$(echo "$IgnoredLibs" | grep "$wanted_lib")" != "" ]; then WantedLibIgnored="yes"
else WantedLibIgnored="no"; fi
if [ "$check_nr" -eq "1" ] || [ "$WantedLibIgnored" = "yes" ]; then
wanted_lib2="$(echo "$wanted_lib" | sed 's/\\//g')"; patterns_num="$(echo "$patterns" | wc -w)"
last_pattern="$(echo "$patterns" | awk '{print $(NF-1)}')"; end_mark="$(echo "$patterns" | awk '{print $NF}')"
if [ "$check_nr" -ne "1" ]; then foreign_dep="(sd) "; else foreign_dep=""; fi
if [ "$(echo "$c_required_libs" | grep "[^_-]$last_pattern")" != "" ]; then
if [ "$WantedLibIgnored" = "yes" ]; then IgnoredLibs="$(echo "$IgnoredLibs" | sed "s|$wanted_lib||")"; fi
for var2 in $patterns; do
if [ "$var2" = "|" ] || [ "$var2" = "|H" ] || [ "$var2" = "|L" ]; then break; fi
lib_pattern="$(echo "$var" | awk -F '/' -v ii="$i" '{print $ii}')"
if [ "$wanted_lib" != "$last_pattern" ] && [ "$i" -lt "$patterns_num" ]; then end_w="no"
else end_w="yes"; fi
findMissingSO "$wanted_lib" "$wanted_lib2" "$lib_pattern" "$end_w" "$foreign_dep" "$end_mark"
if [ "$?" -eq "0" ]; then break; else i=$((i + 1)); fi
done
elif [ "$WantedLibIgnored" = "no" ]; then
IgnoredLibs="$IgnoredLibs $wanted_lib2"
if [ -L "$LibDir_wP/$wanted_lib2" ]; then rm -f "$LibDir_wP/$wanted_lib2"; fi
fi
fi
done
check_nr=$((check_nr + 1))
done
fi
}
# Each line /.../.../|/ .
# First entry libs_list="...\n...\n..." ,
@ -270,107 +274,107 @@ if [ "$OperatingMode" != "--tool-buginfo" ]; then
/libogg.so.0/libogg.so/|/
/libGLEW.so.1.10/libGLEW.so.1.[num]/libGLEW.so/|/"
if [ "$OperatingMode" = "--game" ]; then
libs_list="$libs_list
/libopenal.so.1/libopenal.so/libopenal/|H/
/libvlccore.so.7/libvlccore.so/libvlccore/|/
/libvlc.so.5/libvlc.so/|/"
libs_list="$libs_list
/libopenal.so.1/libopenal.so/libopenal/|H/
/libvlccore.so.7/libvlccore.so/libvlccore/|/
/libvlc.so.5/libvlc.so/|/"
else
libs_list="$libs_list
/libwx_gtk2u_core-3.0.so.0/libwx_gtk2u_core-3.[num].so/|L/
/libwx_baseu-3.0.so.0/libwx_baseu-3.[num].so/|L/
/libwx_gtk2u_gl-3.0.so.0/libwx_gtk2u_gl-3.[num].so/|L/
/libgtk-x11-2.0.so.0/libgtk-x11-2.[num].so/libgtk-x11-[0-9].[num].so/libgtk-x11-[0-9]/libgtk-x11/|/
/libgdk-x11-2.0.so.0/libgdk-x11-2.[num].so/libgdk-x11-[0-9].[num].so/libgdk-x11-[0-9]/libgdk-x11/|/
/libpangocairo-1.0.so.0/libpangocairo-1.[num].so/libpangocairo-[0-9].[num].so/libpangocairo-[0-9]/libpangocairo/|/
/libgdk_pixbuf-2.0.so.0/libgdk_pixbuf-2.[num].so/libgdk_pixbuf-[0-9].[num].so/libgdk_pixbuf-[0-9]/|/
/libcairo.so.2/libcairo.so/|/
/libpango-1.0.so.0/libpango-1.[num].so/libpango-[0-9].[num].so/libpango-[0-9]/libpango-/|/
/libgobject-2.0.so.0/libgobject-2.[num].so/libgobject-[0-9].[num].so/libgobject-[0-9]/libgobject/|/
/libglib-2.0.so.0/libglib-2.[num].so/libglib-[0-9].[num].so/libglib-[0-9]/libglib-/|/
/libSM.so.6/libSM.so/|/
/libjpeg.so.8/|/
/libtiff.so.5/libtiff.so/|/
/libgmodule-2.0.so.0/libgmodule-2.[num].so/libgmodule-[0-9].[num].so/libgmodule-[0-9]/libgmodule/|/
/libatk-1.0.so.0/libatk-1.[num].so/libatk-[0-9].[num].so/libatk-[0-9]/|/
/libgio-2.0.so.0/libgio-2.[num].so/libgio-[0-9].[num].so/libgio-[0-9]/|/
/libpangoft2-1.0.so.0/libpangoft2-1.[num].so/libpangoft2-[0-9]/libpangoft2-/libpangoft/|/
/libXcomposite.so.1/libXcomposite.so/libXcomposite/|/
/libpixman-1.so.0/libpixman-1.so/libpixman-[0-9].so/libpixman/|/
/libxcb-shm.so.0/libxcb-shm.so/libxcb-shm/|/
/libxcb-render.so.0/libxcb-render.so/|/
/libthai.so.0/libthai.so/|/
/libpcre.so.3/libpcre.so/|/
/libICE.so.6/libICE.so/|/
/libuuid.so.1/libuuid.so/|/
/liblzma.so.5/liblzma.so/|/
/libjbig.so.0/libjbig.so/|/
/libselinux.so.1/libselinux.so/|/
/libharfbuzz.so.0/libharfbuzz.so/|/
/libdatrie.so.1/libdatrie.so/|/
/libgraphite2.so.3/libgraphite2.so/libgraphite[0-9].so/|/"
libs_list="$libs_list
/libwx_gtk2u_core-3.0.so.0/libwx_gtk2u_core-3.[num].so/|L/
/libwx_baseu-3.0.so.0/libwx_baseu-3.[num].so/|L/
/libwx_gtk2u_gl-3.0.so.0/libwx_gtk2u_gl-3.[num].so/|L/
/libgtk-x11-2.0.so.0/libgtk-x11-2.[num].so/libgtk-x11-[0-9].[num].so/libgtk-x11-[0-9]/libgtk-x11/|/
/libgdk-x11-2.0.so.0/libgdk-x11-2.[num].so/libgdk-x11-[0-9].[num].so/libgdk-x11-[0-9]/libgdk-x11/|/
/libpangocairo-1.0.so.0/libpangocairo-1.[num].so/libpangocairo-[0-9].[num].so/libpangocairo-[0-9]/libpangocairo/|/
/libgdk_pixbuf-2.0.so.0/libgdk_pixbuf-2.[num].so/libgdk_pixbuf-[0-9].[num].so/libgdk_pixbuf-[0-9]/|/
/libcairo.so.2/libcairo.so/|/
/libpango-1.0.so.0/libpango-1.[num].so/libpango-[0-9].[num].so/libpango-[0-9]/libpango-/|/
/libgobject-2.0.so.0/libgobject-2.[num].so/libgobject-[0-9].[num].so/libgobject-[0-9]/libgobject/|/
/libglib-2.0.so.0/libglib-2.[num].so/libglib-[0-9].[num].so/libglib-[0-9]/libglib-/|/
/libSM.so.6/libSM.so/|/
/libjpeg.so.8/|/
/libtiff.so.5/libtiff.so/|/
/libgmodule-2.0.so.0/libgmodule-2.[num].so/libgmodule-[0-9].[num].so/libgmodule-[0-9]/libgmodule/|/
/libatk-1.0.so.0/libatk-1.[num].so/libatk-[0-9].[num].so/libatk-[0-9]/|/
/libgio-2.0.so.0/libgio-2.[num].so/libgio-[0-9].[num].so/libgio-[0-9]/|/
/libpangoft2-1.0.so.0/libpangoft2-1.[num].so/libpangoft2-[0-9]/libpangoft2-/libpangoft/|/
/libXcomposite.so.1/libXcomposite.so/libXcomposite/|/
/libpixman-1.so.0/libpixman-1.so/libpixman-[0-9].so/libpixman/|/
/libxcb-shm.so.0/libxcb-shm.so/libxcb-shm/|/
/libxcb-render.so.0/libxcb-render.so/|/
/libthai.so.0/libthai.so/|/
/libpcre.so.3/libpcre.so/|/
/libICE.so.6/libICE.so/|/
/libuuid.so.1/libuuid.so/|/
/liblzma.so.5/liblzma.so/|/
/libjbig.so.0/libjbig.so/|/
/libselinux.so.1/libselinux.so/|/
/libharfbuzz.so.0/libharfbuzz.so/|/
/libdatrie.so.1/libdatrie.so/|/
/libgraphite2.so.3/libgraphite2.so/libgraphite[0-9].so/|/"
fi
#if [ "$ARCHITECTURE" = "x86_64" ]; then
#fi
IfRealLibExist() {
RealEmbLib="$LibDir_wP/$1"
if [ ! -L "$RealEmbLib" ] && [ -e "$RealEmbLib" ]; then
if [ "$2" = "remove" ]; then mv -f "$RealEmbLib" "$LibDirB_wP"; else return 0; fi
else return 1; fi
RealEmbLib="$LibDir_wP/$1"
if [ ! -L "$RealEmbLib" ] && [ -e "$RealEmbLib" ]; then
if [ "$2" = "remove" ]; then mv -f "$RealEmbLib" "$LibDirB_wP"; else return 0; fi
else return 1; fi
}
# exceptions, keep them in sync with listed libraries on 'libs_list'
if [ "$(echo "$OS_INFO" | grep 'Debian\|Ubuntu\|LinuxMint')" = "" ]; then IfRealLibExist "libSDL2-2.0.so.0" "remove"; fi
if [ "$OperatingMode" = "--game" ]; then
if [ "$(IfRealLibExist "libvlc.so.5"; echo "$?")" -ne "0" ] && [ "$(IfRealLibExist "libvlccore.so.7"; echo "$?")" -ne "0" ] && \
[ -d "$LibDir_wP/vlc" ]; then mv -f "$LibDir_wP/vlc" "$LibDirB_wP"; fi
if [ "$(IfRealLibExist "libvlc.so.5"; echo "$?")" -ne "0" ] && [ "$(IfRealLibExist "libvlccore.so.7"; echo "$?")" -ne "0" ] && \
[ -d "$LibDir_wP/vlc" ]; then mv -f "$LibDir_wP/vlc" "$LibDirB_wP"; fi
else
if [ "$(IfRealLibExist "libwx_gtk2u_core-3.0.so.0"; echo "$?")" -ne "0" ] || \
[ "$(IfRealLibExist "libwx_baseu-3.0.so.0"; echo "$?")" -ne "0" ] || \
[ "$(IfRealLibExist "libwx_gtk2u_gl-3.0.so.0"; echo "$?")" -ne "0" ]; then
IfRealLibExist "libwx_gtk2u_core-3.0.so.0" "remove"
IfRealLibExist "libwx_baseu-3.0.so.0" "remove"
IfRealLibExist "libwx_gtk2u_gl-3.0.so.0" "remove"
fi
if [ "$(IfRealLibExist "libwx_gtk2u_core-3.0.so.0"; echo "$?")" -ne "0" ] || \
[ "$(IfRealLibExist "libwx_baseu-3.0.so.0"; echo "$?")" -ne "0" ] || \
[ "$(IfRealLibExist "libwx_gtk2u_gl-3.0.so.0"; echo "$?")" -ne "0" ]; then
IfRealLibExist "libwx_gtk2u_core-3.0.so.0" "remove"
IfRealLibExist "libwx_baseu-3.0.so.0" "remove"
IfRealLibExist "libwx_gtk2u_gl-3.0.so.0" "remove"
fi
fi
lw_log="$LibDir_wP/.last_w_check.log"; li_log="$LibDir_wP/.last_i_check.log"
pw_log="$LibDir_wP/.previous_w_check.log"; pi_log="$LibDir_wP/.previous_i_check.log"
pw_err="$LibDir_wP/.previous_err_d_check.log"
LibsWarningsLogs() {
if [ "$1" = "create_new" ]; then
echo "#" > "$lw_log"; echo "#" > "$li_log"
elif [ "$1" = "save_new" ] && [ "$OperatingMode" = "--game" ]; then
echo "$LibsWarnings" | sed 's/^[\t ]*||/ ||/g' > "$lw_log"; echo "$IgnoredLibs" > "$li_log"
elif [ "$1" = "read_old" ]; then
LibsWarnings="$(cat "$pw_log")"; IgnoredLibs="$(cat "$pi_log")"
elif [ "$1" = "check_old" ]; then
if [ -f "$pw_log" ] && [ -f "$pi_log" ] && \
[ "$(find "$LibDir_wP" -name '.previous_w_check.log' -mtime -29)" ]; then return 0
else return 1; fi
elif [ "$1" = "check_current" ] || [ "$1" = "rotate" ]; then
if [ -f "$lw_log" ] && [ -f "$li_log" ]; then
if [ "$1" = "rotate" ] || [ "$(find "$LibDir_wP" -name '.last_w_check.log' -mmin +10)" ]; then
mv -f "$lw_log" "$pw_log"; mv -f "$li_log" "$pi_log"
else return 0; fi
elif [ "$1" != "rotate" ]; then return 1; fi
fi
if [ "$1" = "create_new" ]; then
echo "#" > "$lw_log"; echo "#" > "$li_log"
elif [ "$1" = "save_new" ] && [ "$OperatingMode" = "--game" ]; then
echo "$LibsWarnings" | sed 's/^[\t ]*||/ ||/g' > "$lw_log"; echo "$IgnoredLibs" > "$li_log"
elif [ "$1" = "read_old" ]; then
LibsWarnings="$(cat "$pw_log")"; IgnoredLibs="$(cat "$pi_log")"
elif [ "$1" = "check_old" ]; then
if [ -f "$pw_log" ] && [ -f "$pi_log" ] && \
[ "$(find "$LibDir_wP" -name '.previous_w_check.log' -mtime -29)" ]; then return 0
else return 1; fi
elif [ "$1" = "check_current" ] || [ "$1" = "rotate" ]; then
if [ -f "$lw_log" ] && [ -f "$li_log" ]; then
if [ "$1" = "rotate" ] || [ "$(find "$LibDir_wP" -name '.last_w_check.log' -mmin +10)" ]; then
mv -f "$lw_log" "$pw_log"; mv -f "$li_log" "$pi_log"
else return 0; fi
elif [ "$1" != "rotate" ]; then return 1; fi
fi
}
checkLibsStatus2() {
if [ -f "$pw_err" ] && [ -d "$LibDirB_wP" ]; then rm -f "$pw_err"
mv -f "$LibDirB_wP"/* "$LibDir_wP"; sleep 1s; fi
checkLibsStatus "$libs_list"; LibsWarningsLogs "save_new"; sleep 1s; LibsWarningsLogs "rotate"
if [ -f "$pw_err" ] && [ -d "$LibDirB_wP" ]; then rm -f "$pw_err"
mv -f "$LibDirB_wP"/* "$LibDir_wP"; sleep 1s; fi
checkLibsStatus "$libs_list"; LibsWarningsLogs "save_new"; sleep 1s; LibsWarningsLogs "rotate"
}
if [ "$OperatingMode" = "--game" ] && [ "$(LibsWarningsLogs "check_current"; echo "$?")" -eq "0" ]; then
LibsWarningsLogs "read_old"
LibsWarningsLogs "read_old"
elif [ "$OperatingMode" = "--game" ] && [ "$(LibsWarningsLogs "check_old"; echo "$?")" -eq "0" ]; then
( LibsWarningsLogs "create_new"; checkLibsStatus2 ) &
LibsWarningsLogs "read_old"
( LibsWarningsLogs "create_new"; checkLibsStatus2 ) &
LibsWarningsLogs "read_old"
else
checkLibsStatus2
checkLibsStatus2
fi
if [ -f "$GAMEDIR/${SHORT_GAME_NAME}-configure-desktop.sh" ]; then
"$GAMEDIR/${SHORT_GAME_NAME}-configure-desktop.sh"
rm -f "$GAMEDIR/${SHORT_GAME_NAME}-configure-desktop.sh"
"$GAMEDIR/${SHORT_GAME_NAME}-configure-desktop.sh"
rm -f "$GAMEDIR/${SHORT_GAME_NAME}-configure-desktop.sh"
fi
else
ExitStatus="$2"
@ -381,8 +385,8 @@ else
fi
if [ "$OperatingMode" = "--game" ]; then
if [ -d "$LibDir_wP" ]; then
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}${LibDir_wP}"
if [ -d "$LibDir_wP/vlc" ]; then export VLC_PLUGIN_PATH="${LibDir_wP}/vlc"; fi
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}${LibDir_wP}"
if [ -d "$LibDir_wP/vlc" ]; then export VLC_PLUGIN_PATH="${LibDir_wP}/vlc"; fi
fi
"$GAMEDIR/$EXC_BINARY" "$@"
ExitStatus="$?"
@ -392,55 +396,55 @@ if [ "$OperatingMode" = "--game" ]; then
fi
if [ "$ExitStatus" -ne "0" ] || [ "$OperatingMode" = "--tool-editor" ] || [ "$OperatingMode" = "--tool-g3dviewer" ]; then
if [ "$(echo "$@" | grep '^[ \t]*--help[ \t]*$\|^[ \t]*-h[ \t]*$')" = "" ]; then
DiffTime="$(($ErrorTime-$BeginTime))"
if [ "$OperatingMode" = "--game" ]; then ShowLibsTime=35; else ShowLibsTime=45; fi
if [ "$DiffTime" -le "$ShowLibsTime" ] && [ -e "$GAMEDIR/$BinaryToCheck" ] && [ -x "$GAMEDIR/$BinaryToCheck" ]; then
if [ "$OperatingMode" = "--game" ] || [ "$OperatingMode" = "--tool-buginfo" ]; then
echo "#" > "$pw_err"; LibsWarnings="
|| $LONG_GAME_NAME requires some libraries to be present on this operating system.
|| Missing libraries (if any) will be listed next, along with full names
|| and default versions. Use the package manager provided by your Linux
|| distribution to install them. Most Linux distributions provide a web search
|| allowing you to identify the packages containing these libraries.
|| Once you installed additional libraries, just run this script again.
||
|| Other issues preventing $LONG_GAME_NAME from starting can occur if
|| this version of game has not been tested with this version of your Linux
|| distribution. If so, we may provide compatibility updates which can be
|| downloaded and installed by running this script:
|| '${SHORT_GAME_NAME}-mini-update.sh'
||
|| If after this, $LONG_GAME_NAME still fails to start, please report a bug at
|| '$BugReportEngine'
|| or '$BugReportBoth'
||
|| OS info. [$OS_INFO], Arch.[$ARCHITECTURE], Dir.[$GAMEDIR]
|| $LibsWarnings"
fi
echo "$LibsWarnings" | sed 's/^[\t ]*||//g' >&2; echo
if [ "$OperatingMode" != "--tool-buginfo" ]; then
IgnoredLibs="$(echo "$IgnoredLibs" | sed -e 's/ */ /g' -e 's/^ //g')"
if [ "$IgnoredLibs" = "" ]; then IgnoredLibs="-none-"; fi
echo "Ignored libraries (please include in bug reports):" >&2
echo "$IgnoredLibs" >&2; echo
fi
else
BugReportInfo="$BugReportInfo
|| OS info. [$OS_INFO], Arch.[$ARCHITECTURE], Dir.[$GAMEDIR]
||
|| If you see an unknown error then please report a bug
|| here: '$BugReportBoth2',
|| or if you think that bug is related with game engine here:
|| '$BugReportEngine'"
if [ "$BugReportData" != "" ] && [ "$BugReportData" != "$BugReportBoth2" ] && [ "$BugReportData" != "$BugReportEngine" ]; then
BugReportInfo="$BugReportInfo,
|| or if you think that bug is related with game data here:
|| '$BugReportData'."
else
BugReportInfo="$BugReportInfo."
fi
echo "$BugReportInfo" | sed 's/^[\t ]*||//g' >&2; echo
fi
DiffTime="$(($ErrorTime-$BeginTime))"
if [ "$OperatingMode" = "--game" ]; then ShowLibsTime=35; else ShowLibsTime=45; fi
if [ "$DiffTime" -le "$ShowLibsTime" ] && [ -e "$GAMEDIR/$BinaryToCheck" ] && [ -x "$GAMEDIR/$BinaryToCheck" ]; then
if [ "$OperatingMode" = "--game" ] || [ "$OperatingMode" = "--tool-buginfo" ]; then
echo "#" > "$pw_err"; LibsWarnings="
|| $LONG_GAME_NAME requires some libraries to be present on this operating system.
|| Missing libraries (if any) will be listed next, along with full names
|| and default versions. Use the package manager provided by your Linux
|| distribution to install them. Most Linux distributions provide a web search
|| allowing you to identify the packages containing these libraries.
|| Once you installed additional libraries, just run this script again.
||
|| Other issues preventing $LONG_GAME_NAME from starting can occur if
|| this version of game has not been tested with this version of your Linux
|| distribution. If so, we may provide compatibility updates which can be
|| downloaded and installed by running this script:
|| '${SHORT_GAME_NAME}-mini-update.sh'
||
|| If after this, $LONG_GAME_NAME still fails to start, please report a bug at
|| '$BugReportEngine'
|| or '$BugReportBoth'
||
|| OS info. [$OS_INFO], Arch.[$ARCHITECTURE], Dir.[$GAMEDIR]
|| $LibsWarnings"
fi
echo "$LibsWarnings" | sed 's/^[\t ]*||//g' >&2; echo
if [ "$OperatingMode" != "--tool-buginfo" ]; then
IgnoredLibs="$(echo "$IgnoredLibs" | sed -e 's/ */ /g' -e 's/^ //g')"
if [ "$IgnoredLibs" = "" ]; then IgnoredLibs="-none-"; fi
echo "Ignored libraries (please include in bug reports):" >&2
echo "$IgnoredLibs" >&2; echo
fi
else
BugReportInfo="$BugReportInfo
|| OS info. [$OS_INFO], Arch.[$ARCHITECTURE], Dir.[$GAMEDIR]
||
|| If you see an unknown error then please report a bug
|| here: '$BugReportBoth2',
|| or if you think that bug is related with game engine here:
|| '$BugReportEngine'"
if [ "$BugReportData" != "" ] && [ "$BugReportData" != "$BugReportBoth2" ] && [ "$BugReportData" != "$BugReportEngine" ]; then
BugReportInfo="$BugReportInfo,
|| or if you think that bug is related with game data here:
|| '$BugReportData'."
else
BugReportInfo="$BugReportInfo."
fi
echo "$BugReportInfo" | sed 's/^[\t ]*||//g' >&2; echo
fi
fi
fi
exit "$ExitStatus"

View File

@ -2059,7 +2059,6 @@ void MenuStateConnectedGame::switchToMapGroup(int filterIndex){
int i = filterIndex;
listBoxMapFilter.setSelectedItemIndex(i);
listBoxMap.setItems(formattedPlayerSortedMaps[i]);
listBoxMap.setSelectedItemIndex(0);
// printf("switching map group to filter=%d mapgroup has %d maps. map=%s \n",i,
// (int)formattedPlayerSortedMaps[i].size(),formattedPlayerSortedMaps[i][0].c_str());
}

View File

@ -797,7 +797,7 @@ void MainWindow::onMenuFileSaveAs(wxCommandEvent &event) {
auto_ptr<wchar_t> wstr(Ansi2WideString(currentFile.c_str()));
currentFile = utf8_encode(wstr.get());
#elif wxCHECK_VERSION(2, 9, 1)
currentFile = fileDialog->GetPath().ToStdString();
currentFile = fd.GetPath().ToStdString();
#else
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(fd.GetPath());
currentFile = tmp_buf;