diff --git a/utilities/install-lmk b/utilities/install-lmk index 0a899e4..4c3315e 100755 --- a/utilities/install-lmk +++ b/utilities/install-lmk @@ -16,7 +16,8 @@ rsync access to the build server). Options: --from Install from this directory. Defaults to - "$HOME/minebest-rsync/mtkit/minetest". + "/opt/minebest/mtkit/minetest" (from home not opt + if using Windows). --server Require a binary ending with "server" to be present in built dir. Defaults to False. --client Require a binary ending with "server" to be @@ -48,13 +49,18 @@ if sys.version_info.major < 3: FileNotFoundError = IOError ModuleNotFoundError = ImportError - -INSTALL_SRC = os.path.join(HOME, "minebest-rsync", "mtkit", "minetest") +INSTALL_SRC = os.path.join("/opt", "minebest-rsync", "mtkit", "minetest") +if platform.system() == "Windows": + INSTALL_SRC = os.path.join(HOME, "minebest-rsync", "mtkit", "minetest") # ^ Changed later if detected in current dir (in use_if_source). DETECT_KIT_SUBDIRS = ["minetest", "mtsrc"] # Use via detect_source # ^ First entry of DETECT_KIT_SUBDIRS has to be the new INSTALL_SRC! -VARIANT = "rsync" # Changed to "local" if not in universal directory! +VARIANT = "rsync" # ^ Changed to "local" if not in default INSTALL_SRC +# - "local" copy of linux-minetest-kit.zip is for end users +# - "rsync" copy from /opt/minebest/ is for maintainers +# (linux-minetest-kit.zip is built by /assemble/util/buildskipwin.sh +# and then must be manually extracted to /opt/minebest/mtkit) MINETEST_KEYWORDS = ("sandbox;world;mining;crafting;blocks;nodes;multiplayer;" "roleplaying;") diff --git a/utilities/pull-lmk b/utilities/pull-lmk index e704d61..c60d340 100755 --- a/utilities/pull-lmk +++ b/utilities/pull-lmk @@ -1,11 +1,45 @@ #!/bin/bash -rsync -rtv mtio:/opt/minebest/ ~/minebest-rsync \ +rsync -rtlv mtio:/opt/minebest/ /opt/minebest \ --exclude "mtkit/minetest/" \ --exclude "mtkit0/" \ --exclude "git-trees.save/" \ --exclude "tmp/" \ + --exclude "mtkit/" \ ; +# ^ exclude mtkit because it is downstream from linux-minetest-kit.zip +# in prod (symlink to assemble/prod)! +# (mtkit is the installed copy in the case of a server, and is used as +# the install source when using the maintainer rsync copy as the +# install source) code=$? + +if [ -L /opt/minebest/mtkit ]; then + rm -f /opt/minebest/mtkit +elif [ -d /opt/minebest/mtkit ]; then + rm -rf /opt/minebest/mtkit +fi + +if [ -L /tmp/lmk ]; then + rm -f /tmp/lmk +elif [ -d /tmp/lmk ]; then + rm -rf /tmp/lmk +fi + +unzip /opt/minebest/prod/linux-minetest-kit.zip -d /tmp/lmk +mv /tmp/lmk/linux-minetest-kit /opt/minebest/mtkit +GOOD_MTKIT_FLAG="/opt/minebest/mtkit/mtcompile-program.sh" +if [ ! -f "$GOOD_MTKIT_FLAG" ]; then + echo "Error: extracting /opt/minebest/prod/linux-minetest-kit.zip didn't seem to work. There is no '$GOOD_MTKIT_FLAG'." + exit 1 +fi + +# mtkit +# - is the INSTALLED copy, +# - maybe OLDER than linux-minetest-kit.zip! + +# prod +# - delete prod/* to test building prod using "bash -e buildskipwin.sh" + # ^ exclude remotely-built copies of the program: # - mtkit/minetest/ # - prod/ ? @@ -14,18 +48,24 @@ code=$? # --info=progress2 \ # if [ $code -eq 0 ]; then - echo "Updating ~/minebest-rsync...OK" + echo "Updating /opt/minebest...OK" else - echo "Updating ~/minebest-rsync...FAILED" + echo "Updating /opt/minebest...FAILED" fi -cd ~/minebest-rsync +cd /opt/minebest cat <