improved hints for users

This commit is contained in:
filux 2016-10-23 00:01:29 +02:00
parent d7c801d3b7
commit 0f1272f338
3 changed files with 54 additions and 32 deletions

@ -1 +1 @@
Subproject commit a1e6be21823b1c597129e3c81f4301177c32fba7
Subproject commit 0834a3d3275e1ead9a0ef73232413f2966f01297

View File

@ -53,16 +53,38 @@ elif [ "$1" = "--show-result-path2" ]; then echo "${RELEASEDIR_ROOT}/$RELEASENAM
DATA_HASH_MEMORY="$RELEASEDIR_ROOT/data_memory"
DATA_HASH_FILE="$DATA_HASH_MEMORY/$VERSION-$SOURCE_BRANCH.log"
if [ ! -d "$DATA_HASH_MEMORY" ]; then mkdir -p "$DATA_HASH_MEMORY"; fi
SyncNote() {
echo; echo " This situation is allowed for \"git submodule\", but in MG case it usually mean sync to wrong data commit. In case of wrong sync, to fix the situation someone should again commit in the megaglest-source repo the recent data HASH. If sync to older data wasn't a mistake then just ignore this warning."; echo
}
if [ "$DATA_HASH" != "" ]; then
if [ ! -e "$DATA_HASH_FILE" ]; then
echo "$DATA_HASH $DATA_COMMIT_NR" > "$DATA_HASH_FILE"
elif [ "$(cat "$DATA_HASH_FILE" | grep "$DATA_HASH")" = "" ]; then
DATA_COMMIT_PREV_NR="$(cat "$DATA_HASH_FILE" | head -1 | awk '{print $2}')"
if [ "$DATA_COMMIT_PREV_NR" != "" ] && [ "$DATA_COMMIT_NR" -lt "$DATA_COMMIT_PREV_NR" ]; then
echo " warning: Detected older git revision of data than previously, $DATA_COMMIT_NR < $DATA_COMMIT_PREV_NR."
if [ -e "$DATA_HASH_FILE" ]; then
CAT_DATA_HASH_FILE="$(cat "$DATA_HASH_FILE" | head -1)"
DATA_COMMIT_PREV_NR="$(echo "$CAT_DATA_HASH_FILE" | awk '{print $2}')"
DATA_COMMIT_LATEST_NR="$(echo "$CAT_DATA_HASH_FILE" | awk '{print $3}')"
else
echo "$DATA_HASH $DATA_COMMIT_NR $DATA_COMMIT_NR" > "$DATA_HASH_FILE"
fi
if [ -e "$DATA_HASH_FILE" ] && [ "$DATA_COMMIT_PREV_NR" != "" ]; then
if [ "$DATA_COMMIT_NR" -lt "$DATA_COMMIT_PREV_NR" ]; then
echo; echo " warning: Detected older git revision of data than previously, $DATA_COMMIT_NR < $DATA_COMMIT_PREV_NR."
SyncNote
else
if [ "$DATA_COMMIT_LATEST_NR" != "" ] && [ "$DATA_COMMIT_NR" -lt "$DATA_COMMIT_LATEST_NR" ]; then
echo; echo " warning: Detected older git revision of data than synced in the past, $DATA_COMMIT_NR < $DATA_COMMIT_LATEST_NR."
SyncNote
if [ "$DATA_COMMIT_NR" -gt "$DATA_COMMIT_PREV_NR" ]; then DATA_COMMIT_LATEST_NR="$DATA_COMMIT_NR"; fi
# ^ first sync commit -gt than the wrong one = warning seen for last time, so situation still may be not fixed, but is most likely improved and we avoid endless warnings
fi
if [ "$(echo "$CAT_DATA_HASH_FILE" | grep "$DATA_HASH")" != "" ]; then
echo; echo " NOTE: The archive wasn't created because for almost sure it would be exactly the same like last time (the same commit) and new creation date would convince many users to download it again."; echo
exit 0
fi
fi
echo "$DATA_HASH $DATA_COMMIT_NR" > "$DATA_HASH_FILE"
else exit 0; fi
if [ "$DATA_COMMIT_LATEST_NR" = "" ] || [ "$DATA_COMMIT_NR" -gt "$DATA_COMMIT_LATEST_NR" ]; then
DATA_COMMIT_LATEST_NR="$DATA_COMMIT_NR"
fi
echo "$DATA_HASH $DATA_COMMIT_NR $DATA_COMMIT_LATEST_NR" > "$DATA_HASH_FILE"
fi
fi
cd "$CURRENTDIR"

View File

@ -48,28 +48,7 @@ if [ "$OperatingMode" != "--tool-buginfo" ]; then
else
LDconfigType=9
fi
LibsWarnings="$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'"
LibsWarnings="$LibsWarnings
||
|| Found LDCONFIG variable [$LDconfigType][$LDCONFIG]...
|| OS info. [$OS_INFO], Arch.[$ARCHITECTURE], Dir.[$GAMEDIR]"
LibsWarnings="Found LDCONFIG variable [$LDconfigType][$LDCONFIG]..."
if [ "$ARCHITECTURE" = "x86_64" ]; then GrepPattern="x86[_-]64"
else GrepPattern="$ARCHITECTURE"; fi
LDCONFIG_P="$($LDCONFIG -p)"; ArchSortLibs="no"
@ -185,7 +164,6 @@ if [ "$OperatingMode" != "--tool-buginfo" ]; then
done
fi
}
# Each line /.../.../|/ .
# First entry libs_list="...\n...\n..." ,
# each next libs_list="$libs_list\n...\n..." .
@ -376,6 +354,28 @@ if [ "$ExitStatus" -ne "0" ] || [ "$OperatingMode" = "--tool-editor" ] || [ "$Op
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
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')"