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

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_MEMORY="$RELEASEDIR_ROOT/data_memory"
DATA_HASH_FILE="$DATA_HASH_MEMORY/$VERSION-$SOURCE_BRANCH.log" DATA_HASH_FILE="$DATA_HASH_MEMORY/$VERSION-$SOURCE_BRANCH.log"
if [ ! -d "$DATA_HASH_MEMORY" ]; then mkdir -p "$DATA_HASH_MEMORY"; fi 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 [ "$DATA_HASH" != "" ]; then
if [ ! -e "$DATA_HASH_FILE" ]; then if [ -e "$DATA_HASH_FILE" ]; then
echo "$DATA_HASH $DATA_COMMIT_NR" > "$DATA_HASH_FILE" CAT_DATA_HASH_FILE="$(cat "$DATA_HASH_FILE" | head -1)"
elif [ "$(cat "$DATA_HASH_FILE" | grep "$DATA_HASH")" = "" ]; then DATA_COMMIT_PREV_NR="$(echo "$CAT_DATA_HASH_FILE" | awk '{print $2}')"
DATA_COMMIT_PREV_NR="$(cat "$DATA_HASH_FILE" | head -1 | awk '{print $2}')" DATA_COMMIT_LATEST_NR="$(echo "$CAT_DATA_HASH_FILE" | awk '{print $3}')"
if [ "$DATA_COMMIT_PREV_NR" != "" ] && [ "$DATA_COMMIT_NR" -lt "$DATA_COMMIT_PREV_NR" ]; then else
echo " warning: Detected older git revision of data than previously, $DATA_COMMIT_NR < $DATA_COMMIT_PREV_NR." 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 fi
echo "$DATA_HASH $DATA_COMMIT_NR" > "$DATA_HASH_FILE" if [ "$DATA_COMMIT_LATEST_NR" = "" ] || [ "$DATA_COMMIT_NR" -gt "$DATA_COMMIT_LATEST_NR" ]; then
else exit 0; fi DATA_COMMIT_LATEST_NR="$DATA_COMMIT_NR"
fi
echo "$DATA_HASH $DATA_COMMIT_NR $DATA_COMMIT_LATEST_NR" > "$DATA_HASH_FILE"
fi
fi fi
cd "$CURRENTDIR" cd "$CURRENTDIR"

View File

@@ -48,28 +48,7 @@ if [ "$OperatingMode" != "--tool-buginfo" ]; then
else else
LDconfigType=9 LDconfigType=9
fi fi
LibsWarnings="$LibsWarnings LibsWarnings="Found LDCONFIG variable [$LDconfigType][$LDCONFIG]..."
|| $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]"
if [ "$ARCHITECTURE" = "x86_64" ]; then GrepPattern="x86[_-]64" if [ "$ARCHITECTURE" = "x86_64" ]; then GrepPattern="x86[_-]64"
else GrepPattern="$ARCHITECTURE"; fi else GrepPattern="$ARCHITECTURE"; fi
LDCONFIG_P="$($LDCONFIG -p)"; ArchSortLibs="no" LDCONFIG_P="$($LDCONFIG -p)"; ArchSortLibs="no"
@@ -185,7 +164,6 @@ if [ "$OperatingMode" != "--tool-buginfo" ]; then
done done
fi fi
} }
# Each line /.../.../|/ . # Each line /.../.../|/ .
# First entry libs_list="...\n...\n..." , # First entry libs_list="...\n...\n..." ,
# each next libs_list="$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))" DiffTime="$(($ErrorTime-$BeginTime))"
if [ "$OperatingMode" = "--game" ]; then ShowLibsTime=35; else ShowLibsTime=45; fi if [ "$OperatingMode" = "--game" ]; then ShowLibsTime=35; else ShowLibsTime=45; fi
if [ "$DiffTime" -le "$ShowLibsTime" ] && [ -e "$GAMEDIR/$BinaryToCheck" ] && [ -x "$GAMEDIR/$BinaryToCheck" ]; then 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 echo "$LibsWarnings" | sed 's/^[\t ]*||//g' >&2; echo
if [ "$OperatingMode" != "--tool-buginfo" ]; then if [ "$OperatingMode" != "--tool-buginfo" ]; then
IgnoredLibs="$(echo "$IgnoredLibs" | sed -e 's/ */ /g' -e 's/^ //g')" IgnoredLibs="$(echo "$IgnoredLibs" | sed -e 's/ */ /g' -e 's/^ //g')"