From c37c432de66830e1ab9a0b69eed14df2e46b89ff Mon Sep 17 00:00:00 2001 From: Ghommie Date: Thu, 13 Jun 2019 22:18:13 +0200 Subject: [PATCH] port "PR to make travis use xenial and to make it work" --- .travis.yml | 5 +++- tools/ss13_genchangelog.py | 43 +++++++++++++---------------- tools/travis/build_dependencies.sh | 28 ++++++++++--------- tools/travis/install_build_tools.sh | 11 ++++---- 4 files changed, 43 insertions(+), 44 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7138b23354..bef3a69ad7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: generic sudo: false +dist: xenial branches: except: - ___TGS3TempBranch @@ -14,6 +15,7 @@ matrix: packages: - python3 - python3-pip + - python3-setuptools cache: directories: - tgui/node_modules @@ -43,7 +45,8 @@ matrix: - gcc-multilib - g++-7 - g++-7-multilib - - libmariadbclient-dev:i386 + - libmariadb-client-lgpl-dev:i386 + - libmariadbd-dev cache: directories: - $HOME/.cargo diff --git a/tools/ss13_genchangelog.py b/tools/ss13_genchangelog.py index 5c77063e96..b6c2e167e3 100644 --- a/tools/ss13_genchangelog.py +++ b/tools/ss13_genchangelog.py @@ -1,21 +1,16 @@ ''' Usage: $ python ss13_genchangelog.py [--dry-run] html/changelog.html html/changelogs/ - ss13_genchangelog.py - Generate changelog from YAML. - Copyright 2013 Rob "N3X15" Nelson - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -74,9 +69,9 @@ failed_cache_read = True if os.path.isfile(changelog_cache): try: with open(changelog_cache,encoding='utf-8') as f: - (_, all_changelog_entries) = yaml.load_all(f) + (_, all_changelog_entries) = yaml.load_all(f, Loader=yaml.SafeLoader) failed_cache_read = False - + # Convert old timestamps to newer format. new_entries = {} for _date in all_changelog_entries.keys(): @@ -92,10 +87,10 @@ if os.path.isfile(changelog_cache): except Exception as e: print("Failed to read cache:") print(e, file=sys.stderr) - -if args.dryRun: + +if args.dryRun: changelog_cache = os.path.join(args.ymlDir, '.dry_changelog.yml') - + if failed_cache_read and os.path.isfile(args.targetFile): from bs4 import BeautifulSoup from bs4.element import NavigableString @@ -111,7 +106,7 @@ if failed_cache_read and os.path.isfile(args.targetFile): if author.endswith('updated:'): author = author[:-8] author = author.strip() - + # Find \n' if len(changes_added) > 0: entry_htm += author_htm if write_entry: changelog.write(entry_htm) - + with open(os.path.join(targetDir, 'templates', 'footer.html'), 'r', encoding='utf-8') as h: for line in h: changelog.write(line) - + with open(changelog_cache, 'w') as f: cache_head = 'DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py.' @@ -217,4 +212,4 @@ if len(del_after): for fileName in del_after: if os.path.isfile(fileName): print(' Deleting {0} (delete-after set)...'.format(fileName)) - os.remove(fileName) + os.remove(fileName) \ No newline at end of file diff --git a/tools/travis/build_dependencies.sh b/tools/travis/build_dependencies.sh index 9e594733ea..39ec120292 100755 --- a/tools/travis/build_dependencies.sh +++ b/tools/travis/build_dependencies.sh @@ -4,6 +4,17 @@ set -e source dependencies.sh +#ensure the Dockerfile version matches the dependencies.sh version +line=$(head -n 1 Dockerfile) +if [[ $line != *"$BYOND_MAJOR.$BYOND_MINOR"* ]]; then + echo "Dockerfile BYOND version in FROM command does not match dependencies.sh (Or it's not on line 1)!" + exit 1 +#!/usr/bin/env bash + +set -e + +source dependencies.sh + #ensure the Dockerfile version matches the dependencies.sh version line=$(head -n 1 Dockerfile) if [[ $line != *"$BYOND_MAJOR.$BYOND_MINOR"* ]]; then @@ -41,19 +52,10 @@ if [ $BUILD_TOOLS = false ] && [ $BUILD_TESTING = false ]; then echo "Setting up MariaDB." rm -rf "$HOME/MariaDB" mkdir -p "$HOME/MariaDB" - wget http://mirrors.kernel.org/ubuntu/pool/universe/m/mariadb-client-lgpl/libmariadb2_2.0.0-1_i386.deb - dpkg -x libmariadb2_2.0.0-1_i386.deb /tmp/extract - rm libmariadb2_2.0.0-1_i386.deb - mv /tmp/extract/usr/lib/i386-linux-gnu/libmariadb.so.2 $HOME/MariaDB/ - ln -s $HOME/MariaDB/libmariadb.so.2 $HOME/MariaDB/libmariadb.so - rm -rf /tmp/extract - - wget http://mirrors.kernel.org/ubuntu/pool/universe/m/mariadb-connector-c/libmariadb-dev_2.3.3-1_i386.deb - dpkg -x libmariadb-dev_2.3.3-1_i386.deb /tmp/extract - rm libmariadb-dev_2.3.3-1_i386.deb - mv /tmp/extract/usr/include $HOME/MariaDB/ - #fuck what is this even? - mv $HOME/MariaDB/include/mariadb $HOME/MariaDB/include/mysql + mkdir -p "$HOME/MariaDB/include" + cp /usr/lib/i386-linux-gnu/libmariadb.so.2 $HOME/MariaDB/ + ln -s $HOME/MariaDB/libmariadb.so.2 $HOME/MariaDB/libmariadb.so + cp -r /usr/include/mariadb $HOME/MariaDB/include/ fi cd artifacts diff --git a/tools/travis/install_build_tools.sh b/tools/travis/install_build_tools.sh index 9dd73f854c..c1f91cec44 100755 --- a/tools/travis/install_build_tools.sh +++ b/tools/travis/install_build_tools.sh @@ -4,9 +4,8 @@ set -e source dependencies.sh if [ "$BUILD_TOOLS" = true ]; then - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $NODE_VERSION - pip3 install --user PyYaml -q - pip3 install --user beautifulsoup4 -q -fi; - - + source ~/.nvm/nvm.sh + nvm install $NODE_VERSION + pip3 install --user PyYaml + pip3 install --user beautifulsoup4 +fi; \ No newline at end of file