# HG changeset patch # User rubidium # Date 2010-11-29 13:09:35 # Node ID e8b58a1e35fae6b3a4a6233a4d71619cc187f86c # Parent d11beffb702811d91c6ec5845761a761fa3a71a6 (svn r21352) -Codechange: remove some unneeded code from config.lib diff --git a/config.lib b/config.lib --- a/config.lib +++ b/config.lib @@ -11,8 +11,6 @@ log() { } set_default() { - released_version="" - ignore_extra_parameters="0" # We set all kinds of defaults for params. Later on the user can override # most of them; but if they don't, this default is used. @@ -990,51 +988,40 @@ check_params() { fi fi - if [ -n "$released_version" ]; then - log 1 "checking revision... release ($released_version)" - if [ -n "$revision" ] && [ "$revision" != "$released_version" ]; then - log 1 "WARNING: overriding of the revision is NOT possible for releases" - log 1 "WARNING: the given revision is IGNORED" - - sleep 5 - fi - revision=$released_version + if [ -n "$revision" ]; then + log 1 "checking revision... $revision" + log 1 "WARNING: we do not advise you to use this setting" + log 1 "WARNING: in most cases it is not safe for network use" + log 1 "WARNING: USE WITH CAUTION!" + + sleep 5 + elif [ -f "$ROOT_DIR/version" ]; then + revision="`cat $ROOT_DIR/version`" + + log 1 "checking revision... $revision" + elif [ -d "$ROOT_DIR/.svn" ] && [ -n "`svn help 2>/dev/null`" ]; then + revision="" + log 1 "checking revision... svn detection" + elif [ -d "$ROOT_DIR/.git" ] && [ -n "`git help 2>/dev/null`" ]; then + revision="" + log 1 "checking revision... git detection" + elif [ -d "$ROOT_DIR/.hg" ] && [ -n "`hg help 2>/dev/null`" ]; then + revision="" + log 1 "checking revision... hg detection" + elif [ -f "$ROOT_DIR/.ottdrev" ]; then + revision="" + log 1 "checking revision... source tarball" else - if [ -n "$revision" ]; then - log 1 "checking revision... $revision" - log 1 "WARNING: we do not advise you to use this setting" - log 1 "WARNING: in most cases it is not safe for network use" - log 1 "WARNING: USE WITH CAUTION!" - - sleep 5 - elif [ -f "$ROOT_DIR/version" ]; then - revision="`cat $ROOT_DIR/version`" - - log 1 "checking revision... $revision" - elif [ -d "$ROOT_DIR/.svn" ] && [ -n "`svn help 2>/dev/null`" ]; then - revision="" - log 1 "checking revision... svn detection" - elif [ -d "$ROOT_DIR/.git" ] && [ -n "`git help 2>/dev/null`" ]; then - revision="" - log 1 "checking revision... git detection" - elif [ -d "$ROOT_DIR/.hg" ] && [ -n "`hg help 2>/dev/null`" ]; then - revision="" - log 1 "checking revision... hg detection" - elif [ -f "$ROOT_DIR/.rev" ]; then - revision="" - log 1 "checking revision... source tarball" - else - revision="" - log 1 "checking revision... no detection" - log 1 "WARNING: there is no means to determine the version." - log 1 "WARNING: please use a subversion, mercurial, or git checkout of OpenTTD." - log 1 "WARNING: you can only join game servers that have been compiled without" - log 1 "WARNING: version detection." - log 1 "WARNING: there is a great chance you desync." - log 1 "WARNING: USE WITH CAUTION!" - - sleep 5 - fi + revision="" + log 1 "checking revision... no detection" + log 1 "WARNING: there is no means to determine the version." + log 1 "WARNING: please use a subversion, mercurial, or git checkout of OpenTTD." + log 1 "WARNING: you can only join game servers that have been compiled without" + log 1 "WARNING: version detection." + log 1 "WARNING: there is a great chance you desync." + log 1 "WARNING: USE WITH CAUTION!" + + sleep 5 fi if [ "$doc_dir" = "1" ]; then